day 2
This commit is contained in:
42
app/src/test/kotlin/day02/Day02Test.kt
Normal file
42
app/src/test/kotlin/day02/Day02Test.kt
Normal file
@@ -0,0 +1,42 @@
|
||||
package day02
|
||||
|
||||
import kotlin.test.Test
|
||||
import util.InputDownloader
|
||||
|
||||
class Day02Test {
|
||||
val day = 2
|
||||
|
||||
val input = InputDownloader().getInput(day)
|
||||
val example = InputDownloader().getExample(day)
|
||||
|
||||
@Test fun part1Example() {
|
||||
part1(example, 2)
|
||||
}
|
||||
|
||||
@Test fun part2Example() {
|
||||
part2(example, 4)
|
||||
}
|
||||
|
||||
@Test fun part1Solution() {
|
||||
part1(input, 663)
|
||||
}
|
||||
|
||||
@Test fun part2Solution() {
|
||||
part2(input, 692)
|
||||
}
|
||||
|
||||
|
||||
fun part1(input: String, expected: Int) {
|
||||
val day = Day02()
|
||||
val output = day.part1(input)
|
||||
println("output: $output")
|
||||
assert(output == expected)
|
||||
}
|
||||
|
||||
fun part2(input: String, expected: Int) {
|
||||
val day = Day02()
|
||||
val output = day.part2(input)
|
||||
println("output: $output")
|
||||
assert(output == expected)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user