diff options
Diffstat (limited to 'game-engine/src/test')
-rw-r--r-- | game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt | 5 | ||||
-rw-r--r-- | game-engine/src/test/kotlin/org/luxons/sevenwonders/game/cards/RequirementsTest.kt | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt index 11293b64..12f867f2 100644 --- a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt +++ b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt @@ -71,6 +71,11 @@ class GameTest { } private fun createPlayCardMove(turnInfo: PlayerTurnInfo): MoveExpectation { + val wonderBuildability = turnInfo.table.boards[turnInfo.playerIndex].wonder.buildability + if (wonderBuildability.isBuildable) { + val transactions = wonderBuildability.cheapestTransactions.first() + return planMove(turnInfo, MoveType.UPGRADE_WONDER, turnInfo.hand.first(), transactions) + } val playableCard = turnInfo.hand.firstOrNull { it.playability.isPlayable } return if (playableCard != null) { planMove(turnInfo, MoveType.PLAY, playableCard, playableCard.playability.cheapestTransactions.first()) diff --git a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/cards/RequirementsTest.kt b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/cards/RequirementsTest.kt index 5f6c18b0..eccca3e7 100644 --- a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/cards/RequirementsTest.kt +++ b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/cards/RequirementsTest.kt @@ -45,7 +45,7 @@ class RequirementsTest { assertEquals(boardGold >= requiredGold, requirements.areMetWithHelpBy(board, noTransactions())) - val satisfaction = requirements.computeSatisfaction(player) + val satisfaction = requirements.assess(player) if (boardGold >= requiredGold) { if (requiredGold == 0) { assertEquals(RequirementsSatisfaction.noRequirements(), satisfaction) @@ -67,7 +67,7 @@ class RequirementsTest { assertEquals(initialResource == requiredResource, requirements.areMetWithHelpBy(board, noTransactions())) if (initialResource == requiredResource) { - val satisfaction = requirements.computeSatisfaction(player) + val satisfaction = requirements.assess(player) assertEquals(RequirementsSatisfaction.enoughResources(), satisfaction) } } @@ -89,7 +89,7 @@ class RequirementsTest { assertEquals(producedResource == requiredResource, requirements.areMetWithHelpBy(board, noTransactions())) if (producedResource == requiredResource) { - val satisfaction = requirements.computeSatisfaction(player) + val satisfaction = requirements.assess(player) assertEquals(RequirementsSatisfaction.enoughResources(), satisfaction) } } @@ -115,7 +115,7 @@ class RequirementsTest { val neighbourHasResource = boughtResource == requiredResource assertEquals(neighbourHasResource, requirements.areMetWithHelpBy(board, resources)) - val satisfaction = requirements.computeSatisfaction(player) + val satisfaction = requirements.assess(player) if (neighbourHasResource) { val transactions = setOf( createTransactions(Provider.LEFT_PLAYER, requiredResource), @@ -141,7 +141,7 @@ class RequirementsTest { val transactions = createTransactions(Provider.RIGHT_PLAYER, requiredResource) assertTrue(requirements.areMetWithHelpBy(board, transactions)) - assertTrue(requirements.computeSatisfaction(player).satisfied) + assertTrue(requirements.assess(player).satisfied) requirements.pay(player, transactions) |