Mark objects as data objects in tests
This commit is contained in:
parent
d8ea6e1c04
commit
104f6a8ecd
@ -3,29 +3,29 @@ package com.github.michaelbull.result.example.model.domain
|
||||
/**
|
||||
* All possible things that can happen in the use-cases
|
||||
*/
|
||||
sealed class DomainMessage
|
||||
sealed interface DomainMessage
|
||||
|
||||
/* validation errors */
|
||||
|
||||
object CustomerRequired : DomainMessage()
|
||||
object CustomerIdMustBePositive : DomainMessage()
|
||||
data object CustomerRequired : DomainMessage
|
||||
data object CustomerIdMustBePositive : DomainMessage
|
||||
|
||||
object FirstNameRequired : DomainMessage()
|
||||
object FirstNameTooLong : DomainMessage()
|
||||
data object FirstNameRequired : DomainMessage
|
||||
data object FirstNameTooLong : DomainMessage
|
||||
|
||||
object LastNameRequired : DomainMessage()
|
||||
object LastNameTooLong : DomainMessage()
|
||||
data object LastNameRequired : DomainMessage
|
||||
data object LastNameTooLong : DomainMessage
|
||||
|
||||
object EmailRequired : DomainMessage()
|
||||
object EmailTooLong : DomainMessage()
|
||||
object EmailInvalid : DomainMessage()
|
||||
data object EmailRequired : DomainMessage
|
||||
data object EmailTooLong : DomainMessage
|
||||
data object EmailInvalid : DomainMessage
|
||||
|
||||
/* exposed errors */
|
||||
|
||||
object CustomerNotFound : DomainMessage()
|
||||
data object CustomerNotFound : DomainMessage
|
||||
|
||||
/* internal errors */
|
||||
|
||||
object SqlCustomerInvalid : DomainMessage()
|
||||
object DatabaseTimeout : DomainMessage()
|
||||
class DatabaseError(val reason: String?) : DomainMessage()
|
||||
data object SqlCustomerInvalid : DomainMessage
|
||||
data object DatabaseTimeout : DomainMessage
|
||||
data class DatabaseError(val reason: String?) : DomainMessage
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.github.michaelbull.result.example.model.domain
|
||||
|
||||
sealed class Event
|
||||
sealed interface Event
|
||||
|
||||
object Created : Event()
|
||||
class FirstNameChanged(val old: String, val new: String) : Event()
|
||||
class LastNameChanged(val old: String, val new: String) : Event()
|
||||
class EmailAddressChanged(val old: String, val new: String) : Event()
|
||||
data object Created : Event
|
||||
data class FirstNameChanged(val old: String, val new: String) : Event
|
||||
data class LastNameChanged(val old: String, val new: String) : Event
|
||||
data class EmailAddressChanged(val old: String, val new: String) : Event
|
||||
|
@ -18,8 +18,8 @@ import kotlin.test.assertTrue
|
||||
class AsyncSuspendableBindingTest {
|
||||
|
||||
private sealed class BindingError {
|
||||
object BindingErrorA : BindingError()
|
||||
object BindingErrorB : BindingError()
|
||||
data object BindingErrorA : BindingError()
|
||||
data object BindingErrorB : BindingError()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -148,9 +148,9 @@ class GetTest {
|
||||
}
|
||||
|
||||
class Merge {
|
||||
interface Direction
|
||||
object Left : Direction
|
||||
object Right : Direction
|
||||
sealed interface Direction
|
||||
data object Left : Direction
|
||||
data object Right : Direction
|
||||
|
||||
@Test
|
||||
fun returnsValueIfOk() {
|
||||
|
Loading…
Reference in New Issue
Block a user