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

32 lines
900 B
Kotlin
Raw Normal View History

2023-12-05 00:28:46 +05:00
import kotlin.test.Test
import kotlin.test.assertEquals
class Solution02Test {
@Test
fun testGetSumOfCorrectGameIDs() {
val games = Solution02.readGames("inputs/day-02/test.txt")
val res = Solution02.getSumOfCorrectGameIDs(games, CubeCount(12, 13, 14))
assertEquals(8, res)
}
@Test
fun testGetPowerSum() {
val games = Solution02.readGames("inputs/day-02/test.txt")
val res = Solution02.getSumOfPowers(games)
assertEquals(2286, res)
}
@Test
fun solvePart1() {
val games = Solution02.readGames("inputs/day-02/input.txt")
val res = Solution02.getSumOfCorrectGameIDs(games, CubeCount(12, 13, 14))
println(res)
}
@Test
fun solvePart2() {
val games = Solution02.readGames("inputs/day-02/input.txt")
val res = Solution02.getSumOfPowers(games)
println(res)
}
}