Skip to content

Commit

Permalink
✅ Improve Coverage on data maps
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Feb 7, 2025
1 parent 00c2142 commit 7353583
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class AngerTest : FunSpec({

val target = AngerDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.16,
ofDays(0) to 0.16,
ofDays(2) to 0.35,
ofDays(5) to 0.38,
ofDays(8) to 0.39,
ofDays(11) to 0.40,
ofDays(14) to 0.36,
ofDays(17) to 0.38,
ofDays(20) to 0.20,
ofDays(23) to 0.17,
ofDays(25) to 0.09,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class DecreasedAppetiteTest : FunSpec({

val target = DecreasedAppetiteDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.32,
ofDays(0) to 0.32,
ofDays(2) to 0.89,
ofDays(5) to 0.65,
ofDays(8) to 0.39,
ofDays(11) to 0.36,
ofDays(14) to 0.29,
ofDays(17) to 0.20,
ofDays(20) to 0.19,
ofDays(23) to 0.22,
ofDays(25) to 0.16,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class DiscomfortTest : FunSpec({

val target = DiscomfortDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 3.5,
ofDays(0) to 3.5,
ofDays(2) to 7.5,
ofDays(5) to 7.3,
ofDays(8) to 6.6,
ofDays(11) to 5.3,
ofDays(14) to 5.0,
ofDays(17) to 5.0,
ofDays(20) to 4.0,
ofDays(23) to 3.5,
ofDays(25) to 3.0,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class IrritabilityTest : FunSpec({

val target = IrritabilityDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.5,
ofDays(0) to 0.5,
ofDays(2) to 0.9,
ofDays(5) to 1.0,
ofDays(8) to 0.85,
ofDays(11) to 0.75,
ofDays(14) to 0.70,
ofDays(17) to 0.66,
ofDays(20) to 0.52,
ofDays(23) to 0.32,
ofDays(25) to 0.26,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class NervousnessAnxietyTest : FunSpec({

val target = NervousnessAnxietyDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.43,
ofDays(0) to 0.43,
ofDays(2) to 0.60,
ofDays(5) to 0.61,
ofDays(8) to 0.54,
ofDays(11) to 0.46,
ofDays(14) to 0.39,
ofDays(17) to 0.37,
ofDays(20) to 0.21,
ofDays(23) to 0.25,
ofDays(25) to 0.25,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class RestlessnessTest : FunSpec({

val target = RestlessnessDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.43,
ofDays(0) to 0.43,
ofDays(2) to 0.71,
ofDays(5) to 1.06,
ofDays(8) to 0.81,
ofDays(11) to 0.53,
ofDays(14) to 0.45,
ofDays(17) to 0.33,
ofDays(20) to 0.29,
ofDays(23) to 0.32,
ofDays(25) to 0.17,
)

target shouldBe snapshot
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.colman.petals.withdrawal.data

import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.time.Duration.ofDays

class SleepDifficultyTest : FunSpec({

val target = SleepDifficultyDataPoints

test("Should match the snapshot") {
val snapshot = mapOf(
ofDays(-1) to 0.5,
ofDays(0) to 0.5,
ofDays(2) to 1.0,
ofDays(5) to 0.87,
ofDays(8) to 0.90,
ofDays(11) to 0.53,
ofDays(14) to 0.56,
ofDays(17) to 0.97,
ofDays(20) to 0.85,
ofDays(23) to 0.53,
ofDays(25) to 0.53,
)

target shouldBe snapshot
}
})

0 comments on commit 7353583

Please sign in to comment.