Add unit tests

This commit is contained in:
Kirill Kamakin
2022-10-31 19:41:49 +01:00
parent 98e082b95e
commit 7c02df4d30
27 changed files with 903 additions and 180 deletions

View File

@@ -16,14 +16,47 @@ data class UpdateRecipeRequestV1(
data class AddRecipeIngredientV1(
@SerialName("referenceId") val id: String,
@SerialName("note") val note: String,
)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as AddRecipeIngredientV1
if (note != other.note) return false
return true
}
override fun hashCode(): Int {
return note.hashCode()
}
}
@Serializable
data class AddRecipeInstructionV1(
@SerialName("id") val id: String,
@SerialName("text") val text: String = "",
@SerialName("ingredientReferences") val ingredientReferences: List<String>,
)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as AddRecipeInstructionV1
if (text != other.text) return false
if (ingredientReferences != other.ingredientReferences) return false
return true
}
override fun hashCode(): Int {
var result = text.hashCode()
result = 31 * result + ingredientReferences.hashCode()
return result
}
}
@Serializable
data class AddRecipeSettingsV1(