38 lines
968 B
Kotlin
38 lines
968 B
Kotlin
|
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)
|
||
|
}
|
||
|
}
|