isCalledExactly(1) -> isCalledOnce()
This commit is contained in:
parent
3bde744d76
commit
fe771a37c2
7 changed files with 61 additions and 65 deletions
|
|
@ -192,9 +192,9 @@ class AcceptDeclineInvitePresenterTest {
|
|||
cancelAndConsumeRemainingEvents()
|
||||
}
|
||||
assert(joinRoomFailure)
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(value(A_ROOM_ID), value(emptyList<String>()), value(JoinedRoom.Trigger.Invite))
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(A_ROOM_ID), value(emptyList<String>()), value(JoinedRoom.Trigger.Invite)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -221,9 +221,9 @@ class AcceptDeclineInvitePresenterTest {
|
|||
cancelAndConsumeRemainingEvents()
|
||||
}
|
||||
assert(joinRoomSuccess)
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(value(A_ROOM_ID), value(emptyList<String>()), value(JoinedRoom.Trigger.Invite))
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(A_ROOM_ID), value(emptyList<String>()), value(JoinedRoom.Trigger.Invite)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class BugReportPresenterTest {
|
|||
initialState.eventSink.invoke(BugReportEvents.ResetAll)
|
||||
val resetState = awaitItem()
|
||||
assertThat(resetState.hasCrashLogs).isFalse()
|
||||
logFilesRemoverLambda.assertions().isCalledExactly(1)
|
||||
logFilesRemoverLambda.assertions().isCalledOnce()
|
||||
// TODO Make it live assertThat(resetState.screenshotUri).isNull()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ class DefaultJoinRoomTest {
|
|||
.isNeverCalled()
|
||||
joinRoomLambda
|
||||
.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(value(A_ROOM_ID))
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(A_ROOM_ID)
|
||||
)
|
||||
assertThat(analyticsService.capturedEvents).containsExactly(
|
||||
roomResult.toAnalyticsJoinedRoom(aTrigger)
|
||||
|
|
@ -88,9 +88,9 @@ class DefaultJoinRoomTest {
|
|||
sut.invoke(A_ROOM_ID, A_SERVER_LIST, aTrigger)
|
||||
joinRoomByIdOrAliasLambda
|
||||
.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(value(A_ROOM_ID), value(A_SERVER_LIST))
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(A_ROOM_ID), value(A_SERVER_LIST)
|
||||
)
|
||||
joinRoomLambda
|
||||
.assertions()
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class DefaultPushServiceTest {
|
|||
)
|
||||
assertThat(defaultPushService.testPush()).isTrue()
|
||||
testPushResult.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(aConfig)))
|
||||
.isCalledOnce()
|
||||
.with(value(aConfig))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -177,11 +177,11 @@ class DefaultPushServiceTest {
|
|||
assertThat(result.isSuccess).isTrue()
|
||||
assertThat(userPushStore.getPushProviderName()).isEqualTo(aPushProvider.name)
|
||||
unregisterLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(client)))
|
||||
.isCalledOnce()
|
||||
.with(value(client))
|
||||
registerLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(client), value(aDistributor)))
|
||||
.isCalledOnce()
|
||||
.with(value(client), value(aDistributor))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -99,21 +99,19 @@ class DefaultPusherSubscriberTest {
|
|||
)
|
||||
assertThat(result).isEqualTo(registerResult)
|
||||
setHttpPusherResult.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(
|
||||
value(
|
||||
SetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
url = "aGateway",
|
||||
appDisplayName = "MyApp",
|
||||
deviceDisplayName = "MyDevice",
|
||||
profileTag = DEFAULT_PUSHER_FILE_TAG + "_",
|
||||
lang = "en",
|
||||
defaultPayload = "{\"cs\":\"$A_SECRET\"}",
|
||||
),
|
||||
)
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(
|
||||
SetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
url = "aGateway",
|
||||
appDisplayName = "MyApp",
|
||||
deviceDisplayName = "MyDevice",
|
||||
profileTag = DEFAULT_PUSHER_FILE_TAG + "_",
|
||||
lang = "en",
|
||||
defaultPayload = "{\"cs\":\"$A_SECRET\"}",
|
||||
),
|
||||
)
|
||||
)
|
||||
assertThat(userPushStore.getCurrentRegisteredPushKey()).isEqualTo(
|
||||
|
|
@ -167,15 +165,13 @@ class DefaultPusherSubscriberTest {
|
|||
)
|
||||
assertThat(result).isEqualTo(unregisterResult)
|
||||
unsetHttpPusherResult.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(
|
||||
listOf(
|
||||
value(
|
||||
UnsetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
),
|
||||
)
|
||||
.isCalledOnce()
|
||||
.with(
|
||||
value(
|
||||
UnsetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
),
|
||||
)
|
||||
)
|
||||
assertThat(userPushStore.getCurrentRegisteredPushKey()).isEqualTo(
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ class FirebasePushProviderTest {
|
|||
val result = firebasePushProvider.registerWith(matrixClient, Distributor("value", "Name"))
|
||||
assertThat(result).isEqualTo(Result.success(Unit))
|
||||
registerPusherResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(matrixClient), value("aToken"), value(FirebaseConfig.PUSHER_HTTP_URL)))
|
||||
.isCalledOnce()
|
||||
.with(value(matrixClient), value("aToken"), value(FirebaseConfig.PUSHER_HTTP_URL))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -129,8 +129,8 @@ class FirebasePushProviderTest {
|
|||
val result = firebasePushProvider.unregister(matrixClient)
|
||||
assertThat(result).isEqualTo(Result.success(Unit))
|
||||
unregisterPusherResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(matrixClient), value("aToken"), value(FirebaseConfig.PUSHER_HTTP_URL)))
|
||||
.isCalledOnce()
|
||||
.with(value(matrixClient), value("aToken"), value(FirebaseConfig.PUSHER_HTTP_URL))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -92,14 +92,14 @@ class UnifiedPushProviderTest {
|
|||
val result = unifiedPushProvider.registerWith(FakeMatrixClient(), Distributor("value", "Name"))
|
||||
assertThat(result).isEqualTo(Result.success(Unit))
|
||||
getSecretForUserResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(A_SESSION_ID)))
|
||||
.isCalledOnce()
|
||||
.with(value(A_SESSION_ID))
|
||||
executeLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(Distributor("value", "Name")), value(A_SECRET)))
|
||||
.isCalledOnce()
|
||||
.with(value(Distributor("value", "Name")), value(A_SECRET))
|
||||
setDistributorValueResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(A_SESSION_ID), value("value")))
|
||||
.isCalledOnce()
|
||||
.with(value(A_SESSION_ID), value("value"))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -121,11 +121,11 @@ class UnifiedPushProviderTest {
|
|||
val result = unifiedPushProvider.registerWith(FakeMatrixClient(), Distributor("value", "Name"))
|
||||
assertThat(result).isEqualTo(Result.failure<Unit>(AN_EXCEPTION))
|
||||
getSecretForUserResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(A_SESSION_ID)))
|
||||
.isCalledOnce()
|
||||
.with(value(A_SESSION_ID))
|
||||
executeLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(Distributor("value", "Name")), value(A_SECRET)))
|
||||
.isCalledOnce()
|
||||
.with(value(Distributor("value", "Name")), value(A_SECRET))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -144,11 +144,11 @@ class UnifiedPushProviderTest {
|
|||
val result = unifiedPushProvider.unregister(matrixClient)
|
||||
assertThat(result).isEqualTo(Result.success(Unit))
|
||||
getSecretForUserResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(A_SESSION_ID)))
|
||||
.isCalledOnce()
|
||||
.with(value(A_SESSION_ID))
|
||||
executeLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(matrixClient), value(A_SECRET)))
|
||||
.isCalledOnce()
|
||||
.with(value(matrixClient), value(A_SECRET))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -167,11 +167,11 @@ class UnifiedPushProviderTest {
|
|||
val result = unifiedPushProvider.unregister(matrixClient)
|
||||
assertThat(result).isEqualTo(Result.failure<Unit>(AN_EXCEPTION))
|
||||
getSecretForUserResultLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(A_SESSION_ID)))
|
||||
.isCalledOnce()
|
||||
.with(value(A_SESSION_ID))
|
||||
executeLambda.assertions()
|
||||
.isCalledExactly(1)
|
||||
.withSequence(listOf(value(matrixClient), value(A_SECRET)))
|
||||
.isCalledOnce()
|
||||
.with(value(matrixClient), value(A_SECRET))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue