22 lines
460 B
Kotlin
22 lines
460 B
Kotlin
package rps
|
|
|
|
import rps.Move.*
|
|
import rps.Outcome.*
|
|
import kotlin.test.Test
|
|
import kotlin.test.assertEquals
|
|
|
|
class GameTest {
|
|
@Test
|
|
fun testOutcomeCalculation() {
|
|
val games = listOf(
|
|
Triple(PAPER, ROCK, WIN),
|
|
Triple(ROCK, PAPER, LOSS),
|
|
Triple(PAPER, SCISSORS, LOSS),
|
|
Triple(ROCK, ROCK, DRAW),
|
|
)
|
|
for ((first, second, expected) in games) {
|
|
assertEquals(determineOutcome(first, second), expected)
|
|
}
|
|
}
|
|
}
|