-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
110 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/jvmTest/kotlin/pro/respawn/flowmvi/test/store/StoreComparisonTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@file:Suppress("UnnecessaryVariable") | ||
|
||
package pro.respawn.flowmvi.test.store | ||
|
||
import io.kotest.core.spec.style.FreeSpec | ||
import io.kotest.matchers.equals.shouldBeEqual | ||
import io.kotest.matchers.equals.shouldNotBeEqual | ||
import pro.respawn.flowmvi.util.testStore | ||
|
||
class StoreComparisonTest : FreeSpec({ | ||
"Given two stores without names" - { | ||
val a = testStore { name = null } | ||
val b = testStore { name = null } | ||
"then stores are distinct" { | ||
a shouldNotBeEqual b | ||
} | ||
} | ||
"given two stores with different names" - { | ||
val a = testStore { name = "a" } | ||
val b = testStore { name = "b" } | ||
"then stores are distinct" { | ||
a shouldNotBeEqual b | ||
} | ||
} | ||
"given same store without a name" - { | ||
val a = testStore { name = null } | ||
val b = a | ||
"then store is equal to itself" { | ||
a shouldBeEqual b | ||
} | ||
} | ||
"given different stores with the same name" - { | ||
val a = testStore { name = "a" } | ||
val b = testStore { name = "a" } | ||
"then stores are equal" { | ||
a shouldBeEqual b | ||
} | ||
"then stores are equal to themselves" { | ||
a shouldBeEqual a | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters