Skip to content

Commit

Permalink
Codecov and test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
isuPatches committed Aug 19, 2018
1 parent 845b8cb commit e11176f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codecov:
branch: 3.x
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal class ConnectToNetworkTests : BaseAndroidJUnit4TestClass() {
mockWiseFyPrechecksUtil.connectToNetwork_success()
mockWiseFySearchUtil.findSavedNetworkByRegex_null()
val mockCallbacks = mock(ConnectToNetworkCallbacks::class.java)
wiseFy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
wisefy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
verify(mockCallbacks, timeout(VERIFICATION_SUCCESS_TIMEOUT)).networkNotFoundToConnectTo()
verificationUtil.didNotTryToConnectToNetwork()
}
Expand All @@ -86,7 +86,7 @@ internal class ConnectToNetworkTests : BaseAndroidJUnit4TestClass() {
mockWiseFySearchUtil.findSavedNetworkByRegex_success()
mockWiseFyConnectionUtil.waitToConnectToSSID(false)
val mockCallbacks = mock(ConnectToNetworkCallbacks::class.java)
wiseFy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
wisefy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
verify(mockCallbacks, timeout(VERIFICATION_SUCCESS_TIMEOUT)).failureConnectingToNetwork()
verificationUtil.triedToConnectToNetwork()
}
Expand All @@ -104,7 +104,7 @@ internal class ConnectToNetworkTests : BaseAndroidJUnit4TestClass() {
mockWiseFySearchUtil.findSavedNetworkByRegex_success()
mockWiseFyConnectionUtil.waitToConnectToSSID(true)
val mockCallbacks = mock(ConnectToNetworkCallbacks::class.java)
wiseFy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
wisefy.connectToNetwork(TEST_SSID, TEST_TIMEOUT, mockCallbacks)
verify(mockCallbacks, timeout(VERIFICATION_SUCCESS_TIMEOUT)).connectedToNetwork()
verificationUtil.triedToConnectToNetwork()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ internal class IsNetworkPSKTest : BaseAndroidJUnit4TestClass() {

@Test fun failure_differentCapability() {
val scanResult = createMockAccessPointWithCapabilities("Other")
assertEquals(false, wiseFy.isNetworkPSK(scanResult))
assertEquals(false, wisefy.isNetworkPSK(scanResult))
}

@Test fun failure_emptyCapabilities() {
val scanResult = createMockAccessPointWithCapabilities("")
assertEquals(false, wiseFy.isNetworkPSK(scanResult))
assertEquals(false, wisefy.isNetworkPSK(scanResult))
}

@Test fun failure_nullCapabilities() {
val scanResult = createMockAccessPointWithCapabilities(null)
assertEquals(false, wiseFy.isNetworkPSK(scanResult))
assertEquals(false, wisefy.isNetworkPSK(scanResult))
}

@Test fun failure_nullScanResult() {
assertEquals(false, wiseFy.isNetworkPSK(null))
assertEquals(false, wisefy.isNetworkPSK(null))
}

@Test fun success() {
val scanResult = createMockAccessPointWithCapabilities(PSK)
assertEquals(true, wiseFy.isNetworkPSK(scanResult))
assertEquals(true, wisefy.isNetworkPSK(scanResult))
}
}

0 comments on commit e11176f

Please sign in to comment.