Skip to content

Commit 68d7c21

Browse files
add tests
1 parent 36b3d0f commit 68d7c21

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ android {
100100
outputs.upToDateWhen { false }
101101
showStandardStreams = true
102102
}
103+
jvmArgs '-noverify'
103104
}
104105
}
105106
}

app/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Build Properties
2-
#Sun May 22 12:18:26 EDT 2022
2+
#Sun May 22 15:24:51 EDT 2022
33
version_minor=0
44
version_store=58
55
version_patch=6
6-
version_build=7
6+
version_build=8
77
version_major=3

app/src/test/kotlin/com/vrem/util/CompatUtilsTest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,20 @@ class CompatUtilsTest {
116116
verify(context).getColor(R.color.regular)
117117
}
118118

119+
@Test
120+
@Config(sdk = [Build.VERSION_CODES.LOLLIPOP])
121+
@Suppress("DEPRECATION")
122+
fun testContextCompatColorLegacy() {
123+
// setup
124+
val expected = 300
125+
whenever(context.resources).thenReturn(resources)
126+
whenever(resources.getColor(R.color.regular)).thenReturn(expected)
127+
// execute
128+
val actual = context.compatColor(R.color.regular)
129+
// validate
130+
assertEquals(expected, actual)
131+
verify(context).resources
132+
verify(resources).getColor(R.color.regular)
133+
}
134+
119135
}

app/src/test/kotlin/com/vrem/wifianalyzer/wifi/manager/WiFiManagerWrapperTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class WiFiManagerWrapperTest {
5959
verify(wifiManager).isWifiEnabled
6060
}
6161

62-
@Suppress("DEPRECATION")
6362
@Test
63+
@Suppress("DEPRECATION")
6464
fun testEnableWiFi() {
6565
// setup
6666
whenever(wifiManager.isWifiEnabled).thenReturn(true)
@@ -69,7 +69,6 @@ class WiFiManagerWrapperTest {
6969
// validate
7070
assertTrue(actual)
7171
verify(wifiManager).isWifiEnabled
72-
verify(wifiManager, never()).isWifiEnabled = any()
7372
}
7473

7574
@Test
@@ -196,6 +195,7 @@ class WiFiManagerWrapperTest {
196195
verify(wifiManager).scanResults
197196
}
198197

198+
@Suppress("DEPRECATION")
199199
@Test
200200
fun testWiFiInfo() {
201201
// setup
@@ -207,6 +207,7 @@ class WiFiManagerWrapperTest {
207207
verify(wifiManager).connectionInfo
208208
}
209209

210+
@Suppress("DEPRECATION")
210211
@Test
211212
fun testWiFiInfoWithException() {
212213
// setup

0 commit comments

Comments
 (0)