public void StartOfMainPlayerTurn_ChooseResourceFromOpponentCalledOutOfSequence_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 7u, 0u }); ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; var resourceUpdateReceived = false; localGameController.ResourcesTransferredEvent = (ResourceTransactionList r) => { resourceUpdateReceived = true; }; // Act localGameController.ChooseResourceFromOpponent(testInstances.FirstOpponent.Id); // Assert resourceUpdateReceived.ShouldBeFalse(); errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Cannot call 'ChooseResourceFromOpponent' until 'SetRobberLocation' has completed."); }
public void BuildRoadSegment_MainPlayerFirstToBuildLongestRoad_MainPlayerGetsTwoVictoryPoints() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 5); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); // Act localGameController.BuildRoadSegment(turnToken, 4, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 1); localGameController.BuildRoadSegment(turnToken, 1, 0); // Assert player.VictoryPoints.ShouldBe(4u); }
private LocalGameControllerTestCreator.TestInstances TestSetupWithExplicitDevelopmentCardHolder(IDevelopmentCardHolder developmentCardHolder) { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(developmentCardHolder); LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(testInstances.LocalGameController); testInstances.Dice.AddSequence(new[] { 8u }); // First turn roll i.e. no robber triggered return(testInstances); }
private TestInstances TestSetup(IDevelopmentCardHolder developmentCardHolder) { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(developmentCardHolder); LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(testInstances.LocalGameController); testInstances.Dice.AddSequence(new[] { 8u }); return(testInstances); }
public void CompleteSetupForPlayer_PlayerGetsExpectedStartingVictoryPoints() { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.MainPlayer.VictoryPoints.ShouldBe(2u); }
public void CompleteSetupForComputerPlayers_ComputerPlayersGetExpectedStartingVictoryPoints() { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(testInstances.LocalGameController); testInstances.FirstOpponent.VictoryPoints.ShouldBe(2u); testInstances.SecondOpponent.VictoryPoints.ShouldBe(2u); testInstances.ThirdOpponent.VictoryPoints.ShouldBe(2u); }
private LocalGameControllerTestCreator.TestInstances TestSetup() { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(null, null, null, new GameBoard(BoardSizes.Standard)); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); // First turn roll i.e. no robber triggered return(testInstances); }
private LocalGameControllerTestCreator.TestInstances TestSetup(IDevelopmentCardHolder developmentCardHolder, GameBoard gameBoard) { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(null, null, developmentCardHolder, gameBoard); testInstances.Dice.AddSequence(new[] { 8u }); LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(testInstances.LocalGameController); this.LoadPlayersByIdForCustomAsserts(testInstances.MainPlayer, testInstances.FirstOpponent, testInstances.SecondOpponent, testInstances.ThirdOpponent); return(testInstances); }
public void BuildRoadSegment_GameIsOver_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 6); player.AddResources(ResourceClutch.Settlement * 3); player.AddResources(ResourceClutch.City * 4); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4u, 3u); localGameController.BuildRoadSegment(turnToken, 3u, 2u); localGameController.BuildRoadSegment(turnToken, 2u, 1u); localGameController.BuildRoadSegment(turnToken, 2u, 10u); localGameController.BuildSettlement(turnToken, 1); localGameController.BuildSettlement(turnToken, 3); localGameController.BuildSettlement(turnToken, 10); localGameController.BuildCity(turnToken, 1); localGameController.BuildCity(turnToken, 3); localGameController.BuildCity(turnToken, 10); localGameController.BuildCity(turnToken, 12); localGameController.BuildRoadSegment(turnToken, 1, 0); // Got 10VP, Game is over // Act localGameController.BuildRoadSegment(turnToken, LocalGameControllerTestCreator.MainRoadTwoEnd, 47); // Assert errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Cannot build road segment. Game is over."); }
public void Scenario_OpponentBuildsLongerRoadThanPlayer_LongestRoadEventReturned() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); var player = testInstances.MainPlayer; var firstOpponent = testInstances.FirstOpponent; testInstances.Dice.AddSequence(new uint[] { 8, 8, 8, 8, 8 }); player.AddResources(ResourceClutch.RoadSegment * 5); firstOpponent.AddResources(ResourceClutch.RoadSegment * 6); firstOpponent.AddBuildRoadSegmentInstruction(new BuildRoadSegmentInstruction { Locations = new UInt32[] { 17, 16, 16, 27, 27, 28, 28, 29, 29, 18 } }); var actualEvents = new List <List <GameEvent> >(); localGameController.GameEvents = (List <GameEvent> e) => { actualEvents.Add(e); }; GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 10); localGameController.BuildRoadSegment(turnToken, 10, 9); // Act - Opponent builds longer road. localGameController.EndTurn(turnToken); // Assert var expectedEvents = new GameEvent[] { new RoadSegmentPlacedEvent(firstOpponent.Id, 17, 16), new RoadSegmentPlacedEvent(firstOpponent.Id, 16, 27), new RoadSegmentPlacedEvent(firstOpponent.Id, 27, 28), new RoadSegmentPlacedEvent(firstOpponent.Id, 28, 29), new RoadSegmentPlacedEvent(firstOpponent.Id, 29, 18), new LongestRoadBuiltEvent(firstOpponent.Id, null, player.Id) }; //actualEvents.ShouldContainExact(expectedEvents); }
public void TradeWithBank_GameIsOver_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 5); player.AddResources(ResourceClutch.Settlement * 3); player.AddResources(ResourceClutch.City * 4); player.AddResources(ResourceClutch.OneBrick * 4); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4u, 3u); localGameController.BuildRoadSegment(turnToken, 3u, 2u); localGameController.BuildRoadSegment(turnToken, 2u, 1u); localGameController.BuildRoadSegment(turnToken, 1u, 0u); // Got 2VP for longest road (4VP) localGameController.BuildRoadSegment(turnToken, 2u, 10u); localGameController.BuildSettlement(turnToken, 3); localGameController.BuildSettlement(turnToken, 10); localGameController.BuildCity(turnToken, 3); localGameController.BuildCity(turnToken, 10); localGameController.BuildCity(turnToken, 12); localGameController.BuildCity(turnToken, 40); // Got 10VP, Game over event raised // Act localGameController.TradeWithBank(turnToken, ResourceTypes.Grain, 1, ResourceTypes.Brick); // Assert errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Cannot trade with bank. Game is over."); }
public void BuildSettlement_GotNineVictoryPoints_EndOfGameEventRaisedWithPlayerAsWinner() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 5); player.AddResources(ResourceClutch.Settlement * 4); player.AddResources(ResourceClutch.City * 4); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; Guid winningPlayer = Guid.Empty; localGameController.GameOverEvent = (Guid g) => { winningPlayer = g; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4u, 3u); localGameController.BuildRoadSegment(turnToken, 3u, 2u); localGameController.BuildRoadSegment(turnToken, 2u, 1u); localGameController.BuildRoadSegment(turnToken, 1u, 0u); // Got 2VP for longest road (4VP) localGameController.BuildRoadSegment(turnToken, 2u, 10u); localGameController.BuildSettlement(turnToken, 3); localGameController.BuildSettlement(turnToken, 10); localGameController.BuildCity(turnToken, 3); localGameController.BuildCity(turnToken, 10); localGameController.BuildCity(turnToken, 40); // Act localGameController.BuildSettlement(turnToken, 1); // Assert winningPlayer.ShouldBe(player.Id); player.VictoryPoints.ShouldBe(10u); }
public void BuildRoadSegment_MainPlayerBuildsLongerRoadThanOpponent_LongestRoadEventRaised() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u, 8u, 8u, 8u, 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 7); var firstOpponent = testInstances.FirstOpponent; firstOpponent.AddResources(ResourceClutch.RoadSegment * 6); firstOpponent.AddBuildRoadSegmentInstruction(new BuildRoadSegmentInstruction { Locations = new UInt32[] { 17, 16, 16, 27, 27, 28, 28, 29, 29, 18 } }); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; Guid previousLongestRoadPlayerId = Guid.Empty; Guid newLongestRoadPlayerId = Guid.Empty; localGameController.LongestRoadBuiltEvent = (Guid p, Guid n) => { previousLongestRoadPlayerId = p; newLongestRoadPlayerId = n; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 10); localGameController.BuildRoadSegment(turnToken, 10, 9); localGameController.EndTurn(turnToken); // First opponent builds 6 road segments to take the longest road title // Build two more road segments for a new longest road of 7 localGameController.BuildRoadSegment(turnToken, 9, 8); localGameController.BuildRoadSegment(turnToken, 8, 0); // Assert previousLongestRoadPlayerId.ShouldBe(firstOpponent.Id); newLongestRoadPlayerId.ShouldBe(player.Id); }
public void BuildRoadSegment_MainPlayerBuildsLongerRoadThanOpponent_VictoryPointsChangesFromOpponentToPlayer() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u, 8u, 8u, 8u, 8u }); var player = testInstances.MainPlayer; player.AddResources(ResourceClutch.RoadSegment * 7); var firstOpponent = testInstances.FirstOpponent; firstOpponent.AddResources(ResourceClutch.RoadSegment * 6); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; Guid previousLongestRoadPlayerId = Guid.Empty; Guid newLongestRoadPlayerId = Guid.Empty; localGameController.LongestRoadBuiltEvent = (Guid p, Guid n) => { previousLongestRoadPlayerId = p; newLongestRoadPlayerId = n; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 10); localGameController.BuildRoadSegment(turnToken, 10, 9); localGameController.EndTurn(turnToken); localGameController.BuildRoadSegment(turnToken, 9, 8); localGameController.BuildRoadSegment(turnToken, 8, 0); // Assert player.VictoryPoints.ShouldBe(4u); firstOpponent.VictoryPoints.ShouldBe(2u); }
public void BuildSettlement_TurnTokenNotCorrect_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; // Act localGameController.BuildSettlement(new GameToken(), 3); // Assert errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Turn token not recognised."); }
private LocalGameControllerTestCreator.TestInstances TestSetupWithExplictGameBoard(Guid bankId, GameBoard gameBoard) { MockPlayer player; MockComputerPlayer firstOpponent, secondOpponent, thirdOpponent; LocalGameControllerTestCreator.CreateDefaultPlayerInstances(out player, out firstOpponent, out secondOpponent, out thirdOpponent); var playerPool = LocalGameControllerTestCreator.CreateMockPlayerPool(player, firstOpponent, secondOpponent, thirdOpponent); playerPool.GetBankId().Returns(bankId); var playerSetup = new LocalGameControllerTestCreator.PlayerSetup(player, firstOpponent, secondOpponent, thirdOpponent, playerPool); var testInstances = LocalGameControllerTestCreator.CreateTestInstances(null, playerSetup, null, gameBoard); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); // First turn roll i.e. no robber triggered return(testInstances); }
public void BuildCity_TurnTokenIsNull_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; localGameController.StartGamePlay(); // Act localGameController.BuildCity(null, 3); // Assert errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Turn token is null."); }
public void CompleteSetupForComputerPlayers_ComputerPlayersGetExpectedResources() { var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(testInstances.LocalGameController); var firstOpponent = testInstances.FirstOpponent; var secondOpponent = testInstances.SecondOpponent; var thirdOpponent = testInstances.ThirdOpponent; firstOpponent.Resources.GrainCount.ShouldBe(1); firstOpponent.Resources.LumberCount.ShouldBe(1); firstOpponent.Resources.WoolCount.ShouldBe(1); secondOpponent.Resources.LumberCount.ShouldBe(1); secondOpponent.Resources.OreCount.ShouldBe(1); secondOpponent.Resources.WoolCount.ShouldBe(1); thirdOpponent.Resources.GrainCount.ShouldBe(1); thirdOpponent.Resources.LumberCount.ShouldBe(1); thirdOpponent.Resources.WoolCount.ShouldBe(1); }
public void BuildSettlement_InsufficientResourcesAfterBuildingSettlement_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; var player = testInstances.MainPlayer; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); player.AddResources(ResourceClutch.RoadSegment * 3); player.AddResources(ResourceClutch.Settlement); Int32 settlementBuilt = 0; localGameController.SettlementBuiltEvent = s => { settlementBuilt++; }; ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, MainRoadOneEnd, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 1); localGameController.BuildSettlement(turnToken, 3); // Act localGameController.BuildSettlement(turnToken, 1); // Assert settlementBuilt.ShouldBe(1); errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Cannot build settlement. Missing 1 brick and 1 grain and 1 lumber and 1 wool."); }
public void Scenario_OpponentBuildsLongerRoadThanPlayer_VictoryPointsChangesFromPlayerToOpponent() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); var player = testInstances.MainPlayer; var firstOpponent = testInstances.FirstOpponent; testInstances.Dice.AddSequence(new uint[] { 8, 8, 8, 8, 8 }); player.AddResources(ResourceClutch.RoadSegment * 5); firstOpponent.AddResources(ResourceClutch.RoadSegment * 6); firstOpponent.AddBuildRoadSegmentInstruction(new BuildRoadSegmentInstruction { Locations = new UInt32[] { 17, 16, 16, 27, 27, 28, 28, 29, 29, 18 } }); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, 4, 3); localGameController.BuildRoadSegment(turnToken, 3, 2); localGameController.BuildRoadSegment(turnToken, 2, 10); localGameController.BuildRoadSegment(turnToken, 10, 9); player.VictoryPoints.ShouldBe(4u); firstOpponent.VictoryPoints.ShouldBe(2u); // Act - Opponent builds longer road. localGameController.EndTurn(turnToken); // Assert player.VictoryPoints.ShouldBe(2u); firstOpponent.VictoryPoints.ShouldBe(4u); }
public void StartOfMainPlayerTurn_RobberLocationHasNoSettlementsAndCallingChooseResourceFromOpponent_MeaningfulErrorIsReceived() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(); var localGameController = testInstances.LocalGameController; testInstances.Dice.AddSequence(new[] { 7u, 0u }); ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); localGameController.StartGamePlay(); localGameController.SetRobberHex(0u); // Act localGameController.ChooseResourceFromOpponent(Guid.NewGuid()); // Assert errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe("Cannot call 'ChooseResourceFromOpponent' when no robbing choices are available."); }
[TestCase(1, 0, 0, 0, 1, "Cannot build settlement. Missing 1 grain and 1 lumber.")] // Missing grain and lumber public void BuildSettlement_InsufficientResources_MeaningfulErrorIsReceived(Int32 brickCount, Int32 grainCount, Int32 lumberCount, Int32 oreCount, Int32 woolCount, String expectedMessage) { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; var player = testInstances.MainPlayer; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); player.AddResources(ResourceClutch.RoadSegment); // Need resources to build the precursor road player.AddResources(new ResourceClutch(brickCount, grainCount, lumberCount, oreCount, woolCount)); Boolean settlementBuilt = false; localGameController.SettlementBuiltEvent = s => { settlementBuilt = true; }; ErrorDetails errorDetails = null; localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; }; GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); localGameController.BuildRoadSegment(turnToken, MainRoadOneEnd, 3); // Act localGameController.BuildSettlement(turnToken, 3); // Assert settlementBuilt.ShouldBeFalse(); errorDetails.ShouldNotBeNull(); errorDetails.Message.ShouldBe(expectedMessage); }
public void BuildRoadSegment_RequiredResourcesAvailable_PlayerResourcesUpdated() { // Arrange var testInstances = LocalGameControllerTestCreator.CreateTestInstances(new MockGameBoardWithNoResourcesCollected()); var localGameController = testInstances.LocalGameController; var player = testInstances.MainPlayer; LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController); testInstances.Dice.AddSequence(new[] { 8u }); player.AddResources(ResourceClutch.RoadSegment); GameToken turnToken = null; localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; }; localGameController.StartGamePlay(); // Act localGameController.BuildRoadSegment(turnToken, 4u, 3u); // Assert player.Resources.BrickCount.ShouldBe(0); player.Resources.LumberCount.ShouldBe(0); }