-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Leonardo Colman Lopes <[email protected]>
- Loading branch information
Showing
3 changed files
with
39 additions
and
14 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
27 changes: 27 additions & 0 deletions
27
app/src/test/kotlin/br/com/colman/petals/withdrawal/data/ChartConfigTest.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,27 @@ | ||
package br.com.colman.petals.withdrawal.data | ||
|
||
import io.kotest.core.spec.style.FunSpec | ||
import io.kotest.inspectors.forAll | ||
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder | ||
import io.kotest.matchers.shouldBe | ||
|
||
class ChartConfigTest : FunSpec({ | ||
|
||
test("Entries should contain all subclasses") { | ||
val classes = ChartConfig::class.sealedSubclasses | ||
|
||
ChartConfig.entries().map { it::class } shouldContainExactlyInAnyOrder classes | ||
} | ||
|
||
test("All subclasses but ThcConcentration should use the default x and y values") { | ||
ChartConfig.entries().forAll { | ||
if (it is ChartConfig.ThcConcentration) { | ||
it.maxX shouldBe 20.0 | ||
it.maxY shouldBe 100.0 | ||
} else { | ||
it.maxX shouldBe 25.0 | ||
it.maxY shouldBe 10.0 | ||
} | ||
} | ||
} | ||
}) |