day1
This commit is contained in:
36
app/src/test/kotlin/org/day01/Day01Test.kt
Normal file
36
app/src/test/kotlin/org/day01/Day01Test.kt
Normal file
@@ -0,0 +1,36 @@
|
||||
package org.example
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.test.assertIs
|
||||
|
||||
class Day01Test {
|
||||
@Test fun part1() {
|
||||
val day = Day01()
|
||||
val test = """3 4
|
||||
4 3
|
||||
2 5
|
||||
1 3
|
||||
3 9
|
||||
3 3"""
|
||||
|
||||
val output = day.part1(test)
|
||||
println(output)
|
||||
assert(output == 11)
|
||||
}
|
||||
|
||||
@Test fun part2() {
|
||||
val day = Day01()
|
||||
|
||||
val test = """3 4
|
||||
4 3
|
||||
2 5
|
||||
1 3
|
||||
3 9
|
||||
3 3"""
|
||||
|
||||
val output = day.part2(test)
|
||||
println(output)
|
||||
assert(output == 31)
|
||||
}
|
||||
}
|
14
app/src/test/kotlin/org/example/AppTest.kt
Normal file
14
app/src/test/kotlin/org/example/AppTest.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* This source file was generated by the Gradle 'init' task
|
||||
*/
|
||||
package org.example
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class AppTest {
|
||||
@Test fun appHasAGreeting() {
|
||||
val classUnderTest = App()
|
||||
assertNotNull(classUnderTest.greeting, "app should have a greeting")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user