my-solutions/advent-of-code-2023/src/test/kotlin/Solution02Test.kt

32 lines
893 B
Kotlin

import kotlin.test.Test
import kotlin.test.assertEquals
class Solution02Test {
@Test
fun testGetSumOfCorrectGameIDs() {
val text = ResourceReader().readFile("day-02/test.txt")
val res = Solution02().getSumOfCorrectGameIDs(text, CubeCount(12, 13, 14))
assertEquals(8, res)
}
@Test
fun testGetPowerSum() {
val text = ResourceReader().readFile("day-02/test.txt")
val res = Solution02().getSumOfPowers(text)
assertEquals(2286, res)
}
@Test
fun solvePart1() {
val text = ResourceReader().readFile("day-02/input.txt")
val res = Solution02().getSumOfCorrectGameIDs(text, CubeCount(12, 13, 14))
println(res)
}
@Test
fun solvePart2() {
val text = ResourceReader().readFile("day-02/input.txt")
val res = Solution02().getSumOfPowers(text)
println(res)
}
}