given:
@JvmInline
value class FirstName private constructor(
override val value: String,
) : Value {
override fun toString() = value
companion object {
operator fun invoke(s: String) =
either {
ensure(s.isNotBlank()) { FirstNameError.Empty }
FirstName(s.trim())
}
}
}
and TO:
data class UserDto(
val firstName: String,
)
and FROM:
data class User(
val firstName: FirstName,
)
the function:
fun User.produce(): UserDto = mapper {}
compiles, but is not filled and the test fails: expected: but was:<>
given:
@JvmInline
value class FirstName private constructor(
override val value: String,
) : Value {
override fun toString() = value
}
and TO:
data class UserDto(
val firstName: String,
)
and FROM:
data class User(
val firstName: FirstName,
)
the function:
fun User.produce(): UserDto = mapper {}
compiles, but is not filled and the test fails: expected: but was:<>