Skip to content

Commit 782221a

Browse files
add more tests
1 parent b414fce commit 782221a

4 files changed

Lines changed: 37 additions & 4 deletions

File tree

app/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Build Properties
2-
#Thu Jan 01 12:10:30 EST 2026
3-
version_build=41
2+
#Thu Jan 01 14:06:26 EST 2026
3+
version_build=42
44
version_major=3
55
version_minor=2
66
version_patch=1

app/jacoco.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def jacocoCoverageVerificationProvider = tasks.register('jacocoTestCoverageVerif
7373
}
7474
limit {
7575
counter = 'BRANCH'
76-
minimum = 0.94
76+
minimum = 0.95
7777
}
7878
limit {
7979
counter = 'COMPLEXITY'
80-
minimum = 0.95
80+
minimum = 0.96
8181
}
8282
limit {
8383
counter = 'LINE'

app/src/test/kotlin/com/vrem/wifianalyzer/wifi/accesspoint/AccessPointsAdapterGroupTest.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,25 @@ class AccessPointsAdapterGroupTest {
223223
verify(expandableListAdapter).groupCount
224224
}
225225

226+
@Test
227+
fun updateExpandsGroupWhenInExpandedSet() {
228+
// setup
229+
val wiFiDetails = withWiFiDetails()
230+
doReturn(GroupBy.CHANNEL).whenever(settings).groupBy()
231+
fixture.updateGroupBy()
232+
fixture.expanded.add(GroupBy.CHANNEL.group(wiFiDetails[0]))
233+
doReturn(expandableListAdapter).whenever(expandableListView).expandableListAdapter
234+
doReturn(wiFiDetails.size).whenever(expandableListAdapter).groupCount
235+
// execute
236+
fixture.update(wiFiDetails, expandableListView)
237+
// validate
238+
verify(settings, times(2)).groupBy()
239+
verify(expandableListView).expandableListAdapter
240+
verify(expandableListAdapter).groupCount
241+
verify(expandableListView).expandGroup(0)
242+
verify(expandableListView, times(2)).collapseGroup(any())
243+
}
244+
226245
@Test
227246
fun onGroupCollapsedDoesNotRemoveIfHasChildren() {
228247
// setup

app/src/test/kotlin/com/vrem/wifianalyzer/wifi/filter/FilterTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ import org.junit.After
3535
import org.junit.Before
3636
import org.junit.Test
3737
import org.junit.runner.RunWith
38+
import org.mockito.kotlin.doReturn
3839
import org.mockito.kotlin.never
3940
import org.mockito.kotlin.verify
41+
import org.mockito.kotlin.whenever
4042
import org.robolectric.Shadows
4143
import org.robolectric.annotation.Config
4244

@@ -240,4 +242,16 @@ class FilterTest {
240242
// validate
241243
assertThat(fixture.alertDialog!!.isShowing).isTrue
242244
}
245+
246+
@Test
247+
fun buildReturnsNullDialogWhenActivityIsFinishing() {
248+
// setup
249+
val mainActivity = MainContextHelper.INSTANCE.mainActivity
250+
doReturn(true).whenever(mainActivity).isFinishing
251+
// execute
252+
val actual = build()
253+
// validate
254+
assertThat(actual.alertDialog).isNull()
255+
verify(mainActivity).isFinishing
256+
}
243257
}

0 commit comments

Comments
 (0)