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

38 lines
968 B
Kotlin
Raw Normal View History

import java.io.File
import kotlin.test.Test
import kotlin.test.assertEquals
class Solution03Test {
@Test
fun testGetSumOfParts() {
val file = File("inputs/day-03/test.txt")
val instance = Solution03(file.readLines())
val res = instance.getSumOfParts()
assertEquals(4361, res)
}
@Test
fun solvePart1() {
val file = File("inputs/day-03/input.txt")
val instance = Solution03(file.readLines())
val res = instance.getSumOfParts()
println(res)
}
@Test
fun testGetGearRatio() {
val file = File("inputs/day-03/test.txt")
val instance = Solution03(file.readLines())
val res = instance.getGearRatioSum()
assertEquals(467835, res)
}
@Test
fun solvePart2() {
val file = File("inputs/day-03/input.txt")
val instance = Solution03(file.readLines())
val res = instance.getGearRatioSum()
println(res)
}
}