Skip to content
Snippets Groups Projects
Unverified Commit 0c598b11 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Improve function name to better reflect its result. (#1159)

parent aae3618c
No related branches found
No related tags found
No related merge requests found
......@@ -321,7 +321,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
exportFiles: Collection<File>,
exposureConfiguration: ExposureConfiguration?
) = executeState(API_SUBMISSION) {
if (googleAPIVersion.isAbove(GoogleAPIVersion.V16)) {
if (googleAPIVersion.isAtLeast(GoogleAPIVersion.V16)) {
InternalExposureNotificationClient.asyncProvideDiagnosisKeys(
exportFiles,
exposureConfiguration,
......
......@@ -14,7 +14,7 @@ class GoogleAPIVersion @Inject constructor() {
*
* @return isAboveVersion, if connected to an old unsupported version, return false
*/
suspend fun isAbove(compareVersion: Long): Boolean {
suspend fun isAtLeast(compareVersion: Long): Boolean {
if (!compareVersion.isCorrectVersionLength) {
throw IllegalArgumentException("given version has incorrect length")
}
......
......@@ -38,7 +38,7 @@ internal class GoogleAPIVersionTest {
coEvery { InternalExposureNotificationClient.getVersion() } returns 17000000L
runBlockingTest {
classUnderTest.isAbove(GoogleAPIVersion.V16) shouldBe true
classUnderTest.isAtLeast(GoogleAPIVersion.V16) shouldBe true
}
}
......@@ -48,7 +48,7 @@ internal class GoogleAPIVersionTest {
coEvery { InternalExposureNotificationClient.getVersion() } returns 15000000L
runBlockingTest {
classUnderTest.isAbove(GoogleAPIVersion.V16) shouldBe false
classUnderTest.isAtLeast(GoogleAPIVersion.V16) shouldBe false
}
}
......@@ -56,7 +56,7 @@ internal class GoogleAPIVersionTest {
fun `isAbove API v16 throws IllegalArgument for invalid version`() {
assertThrows<IllegalArgumentException> {
runBlockingTest {
classUnderTest.isAbove(1L)
classUnderTest.isAtLeast(1L)
}
coVerify {
InternalExposureNotificationClient.getVersion() wasNot Called
......@@ -70,7 +70,7 @@ internal class GoogleAPIVersionTest {
ApiException(Status(API_NOT_CONNECTED))
runBlockingTest {
classUnderTest.isAbove(GoogleAPIVersion.V16) shouldBe false
classUnderTest.isAtLeast(GoogleAPIVersion.V16) shouldBe false
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment