Some renaming.

This commit is contained in:
Benoit Marty
2024-07-10 16:27:29 +02:00
parent 21fafe2fc9
commit 922f65cc96
5 changed files with 7 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ class SetupPinPresenter @Inject constructor(
if (confirmPinEntry == choosePinEntry) {
pinCodeManager.createPinCode(confirmPinEntry.toText())
} else {
setupPinFailure = SetupPinFailure.PinsDontMatch
setupPinFailure = SetupPinFailure.PinsDoNotMatch
}
}
}
@@ -93,7 +93,7 @@ class SetupPinPresenter @Inject constructor(
}
SetupPinEvents.ClearFailure -> {
when (setupPinFailure) {
is SetupPinFailure.PinsDontMatch -> {
is SetupPinFailure.PinsDoNotMatch -> {
choosePinEntry = choosePinEntry.clear()
confirmPinEntry = confirmPinEntry.clear()
}

View File

@@ -35,7 +35,7 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> {
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
isConfirmationStep = true,
creationFailure = SetupPinFailure.PinsDontMatch
creationFailure = SetupPinFailure.PinsDoNotMatch
),
aSetupPinState(
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),

View File

@@ -136,7 +136,7 @@ private fun SetupPinContent(
private fun SetupPinFailure.content(): String {
return when (this) {
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_content)
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
}
}
@@ -144,7 +144,7 @@ private fun SetupPinFailure.content(): String {
private fun SetupPinFailure.title(): String {
return when (this) {
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_title)
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
}
}

View File

@@ -18,5 +18,5 @@ package io.element.android.features.lockscreen.impl.setup.pin.validation
sealed interface SetupPinFailure {
data object ForbiddenPin : SetupPinFailure
data object PinsDontMatch : SetupPinFailure
data object PinsDoNotMatch : SetupPinFailure
}

View File

@@ -89,7 +89,7 @@ class SetupPinPresenterTest {
awaitLastSequentialItem().also { state ->
state.choosePinEntry.assertText(completePin)
state.confirmPinEntry.assertText(mismatchedPin)
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDontMatch)
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDoNotMatch)
state.eventSink(SetupPinEvents.ClearFailure)
}
awaitLastSequentialItem().also { state ->