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

38 lines
976 B
Kotlin
Raw Normal View History

import java.io.File
import kotlin.test.Test
import kotlin.test.assertEquals
class Solution03Test {
@Test
fun testGetSumOfParts() {
2024-01-09 11:08:24 +05:00
val text = ResourceReader().readFile("day-03/test.txt")
val instance = Solution03(text)
val res = instance.getSumOfParts()
assertEquals(4361, res)
}
@Test
fun solvePart1() {
2024-01-09 11:08:24 +05:00
val text = ResourceReader().readFile("day-03/input.txt")
val instance = Solution03(text)
val res = instance.getSumOfParts()
println(res)
}
@Test
fun testGetGearRatio() {
2024-01-09 11:08:24 +05:00
val text = ResourceReader().readFile("day-03/test.txt")
val instance = Solution03(text)
val res = instance.getGearRatioSum()
assertEquals(467835, res)
}
@Test
fun solvePart2() {
2024-01-09 11:08:24 +05:00
val text = ResourceReader().readFile("day-03/input.txt")
val instance = Solution03(text)
val res = instance.getGearRatioSum()
println(res)
}
}