Unit tests: adding verification that redaction does not happen when event id is empty

This commit is contained in:
Maxime NATUREL 2022-07-18 15:02:30 +02:00
parent 2121ec5739
commit 7961525869
2 changed files with 9 additions and 2 deletions

View File

@ -45,5 +45,7 @@ class RedactLiveLocationShareEventUseCaseTest {
val event = Event(eventId = "") val event = Event(eventId = "")
redactLiveLocationShareEventUseCase.execute(event = event, room = fakeRoom, reason = A_REASON) redactLiveLocationShareEventUseCase.execute(event = event, room = fakeRoom, reason = A_REASON)
fakeRoom.locationSharingService().verifyRedactLiveLocationShare(inverse = true, beaconInfoEventId = "", reason = A_REASON)
} }
} }

View File

@ -56,7 +56,12 @@ class FakeLocationSharingService : LocationSharingService by mockk() {
coEvery { redactLiveLocationShare(beaconInfoEventId, reason) } just runs coEvery { redactLiveLocationShare(beaconInfoEventId, reason) } just runs
} }
fun verifyRedactLiveLocationShare(beaconInfoEventId: String, reason: String?) { /**
coVerify { redactLiveLocationShare(beaconInfoEventId, reason) } * @param inverse when true it will check redaction of the live did not happen
* @param beaconInfoEventId event id of the beacon related to the live
* @param reason reason explaining the redaction
*/
fun verifyRedactLiveLocationShare(inverse: Boolean = false, beaconInfoEventId: String, reason: String?) {
coVerify(inverse = inverse) { redactLiveLocationShare(beaconInfoEventId, reason) }
} }
} }