Skip to content

Commit

Permalink
now we have an ActionType in ItemWorkflow that defaults to copy
Browse files Browse the repository at this point in the history
  • Loading branch information
vextorspace committed Jul 13, 2024
1 parent dd501a6 commit 64c6cc4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions composeApp/src/commonMain/kotlin/model/ActionType.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package model

enum class ActionType {
Copy;
}
3 changes: 2 additions & 1 deletion composeApp/src/commonMain/kotlin/model/ItemWorkflow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {



}
16 changes: 16 additions & 0 deletions composeApp/src/commonTest/kotlin/model/ItemWorkflowTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package model

import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeInstanceOf
import kotlin.test.Test

Expand All @@ -17,4 +18,19 @@ class ItemWorkflowTest {
// Then
destination.shouldBeInstanceOf<Item>()
}

@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>()

actionType.shouldBe(ActionType.Copy)
}
}

0 comments on commit 64c6cc4

Please sign in to comment.