This commit is contained in:
@@ -37,17 +37,17 @@ class TichuUnitTest {
|
||||
assertGeneratedRound(tichu, 400, 0)
|
||||
|
||||
//Good rounds trough Tichu
|
||||
assertValidRound(tichu, Round(0,0))
|
||||
assertValidRound(tichu, Round(-100,0))
|
||||
assertValidRound(tichu, Round(1, 0, 0))
|
||||
assertValidRound(tichu, Round(1, -100, 0))
|
||||
|
||||
//Bad rounds
|
||||
assertInvalidRound(tichu, Round(5, 12))
|
||||
assertInvalidRound(tichu, Round(12, 5))
|
||||
assertInvalidRound(tichu, Round(5, 55))
|
||||
assertInvalidRound(tichu, Round(1, 5, 12))
|
||||
assertInvalidRound(tichu, Round(1, 12, 5))
|
||||
assertInvalidRound(tichu, Round(1, 5, 55))
|
||||
}
|
||||
|
||||
private fun assertGeneratedRound(tichu: Tichu, scoreA: Int, expectedScoreB: Int) {
|
||||
val round = Round(scoreA, tichu.calculateOtherScore(scoreA))
|
||||
val round = Round(1, scoreA, tichu.calculateOtherScore(scoreA))
|
||||
assertEquals(expectedScoreB, round.scoreB)
|
||||
assertTrue(tichu.isValidRound(round))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user