From 64c6cc41be2416884062f79664b57a10c17740fa Mon Sep 17 00:00:00 2001 From: Douglas Ronne Date: Sat, 13 Jul 2024 11:38:01 -0400 Subject: [PATCH] now we have an ActionType in ItemWorkflow that defaults to copy --- .../src/commonMain/kotlin/model/ActionType.kt | 5 +++++ .../src/commonMain/kotlin/model/ItemWorkflow.kt | 3 ++- .../commonTest/kotlin/model/ItemWorkflowTest.kt | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 composeApp/src/commonMain/kotlin/model/ActionType.kt diff --git a/composeApp/src/commonMain/kotlin/model/ActionType.kt b/composeApp/src/commonMain/kotlin/model/ActionType.kt new file mode 100644 index 0000000..1c9902f --- /dev/null +++ b/composeApp/src/commonMain/kotlin/model/ActionType.kt @@ -0,0 +1,5 @@ +package model + +enum class ActionType { + Copy; +} diff --git a/composeApp/src/commonMain/kotlin/model/ItemWorkflow.kt b/composeApp/src/commonMain/kotlin/model/ItemWorkflow.kt index 9871604..1e3d3e6 100644 --- a/composeApp/src/commonMain/kotlin/model/ItemWorkflow.kt +++ b/composeApp/src/commonMain/kotlin/model/ItemWorkflow.kt @@ -3,7 +3,8 @@ package model import kotlinx.serialization.Serializable @Serializable -data class ItemWorkflow(val destination: Item) { +data class ItemWorkflow(val destination: Item, val actionType: ActionType = ActionType.Copy) { + } diff --git a/composeApp/src/commonTest/kotlin/model/ItemWorkflowTest.kt b/composeApp/src/commonTest/kotlin/model/ItemWorkflowTest.kt index dd5b179..6bd46c4 100644 --- a/composeApp/src/commonTest/kotlin/model/ItemWorkflowTest.kt +++ b/composeApp/src/commonTest/kotlin/model/ItemWorkflowTest.kt @@ -1,5 +1,6 @@ package model +import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeInstanceOf import kotlin.test.Test @@ -17,4 +18,19 @@ class ItemWorkflowTest { // Then destination.shouldBeInstanceOf() } + + @Test + fun `ItemWorkflow contains actionType defaults to Copy`() { + // Given + val destinationItem = Item() + val itemWorkflow = ItemWorkflow(destinationItem) + + // When + val actionType = itemWorkflow.actionType + + // Then + actionType.shouldBeInstanceOf() + + actionType.shouldBe(ActionType.Copy) + } } \ No newline at end of file