public void TestMapBehavior() { Player DummyPlayer = new Player("Player 1", "Human", true, false, 0, new Card[] { new Card(), new Card(), new Card() }); SorcererStreetMap DummyMap = CreateDummyMap(); DummyMap.ListPlayer.Add(DummyPlayer); DummyMap.Update(new GameTime()); //Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelGainPhase)); //Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); //ActionPanelGainPhase GainPhase = (ActionPanelGainPhase)DummyMap.ListActionMenuChoice.Last(); //GainPhase.FinishPhase(); Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelDrawCardPhase)); Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); ActionPanelDrawCardPhase DrawCardPhase = (ActionPanelDrawCardPhase)DummyMap.ListActionMenuChoice.Last(); DrawCardPhase.FinishPhase(); Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelCardSelectionPhase)); Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); ActionPanelCardSelectionPhase CardSelectionPhase = (ActionPanelCardSelectionPhase)DummyMap.ListActionMenuChoice.Last(); CardSelectionPhase.PrepareToRollDice(); Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelRollDicePhase)); Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); ActionPanelRollDicePhase RollDicePhase = (ActionPanelRollDicePhase)DummyMap.ListActionMenuChoice.Last(); RollDicePhase.RollDice(); Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelChooseDirection)); Assert.IsTrue(DummyMap.ListActionMenuChoice.HasSubPanels); ActionPanelChooseDirection ChooseDirection = (ActionPanelChooseDirection)DummyMap.ListActionMenuChoice.Last(); DummyPlayer.CurrentDirection = Player.Directions.Right; ChooseDirection.FinalizeChoice(); Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelMovementPhase)); Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); while (DummyMap.ListActionMenuChoice.Last() is ActionPanelMovementPhase) { DummyMap.Update(new GameTime()); } Assert.IsInstanceOfType(DummyMap.ListActionMenuChoice.Last(), typeof(ActionPanelCardSelectionPhase)); Assert.IsFalse(DummyMap.ListActionMenuChoice.HasSubPanels); ActionPanelCardSelectionPhase CreatureCardSelectionPhase = (ActionPanelCardSelectionPhase)DummyMap.ListActionMenuChoice.Last(); }
public void TestPlayerMovementPhase() { Player DummyPlayer = new Player("Player 1", "Human", true, false, 0, new Card[0]); DummyPlayer.CurrentDirection = Player.Directions.Right; SorcererStreetMap DummyMap = CreateDummyMap(); DummyMap.ListPlayer.Add(DummyPlayer); ActionPanelMovementPhase MovementPhase = new ActionPanelMovementPhase(DummyMap, DummyPlayer, 3); DummyMap.ListActionMenuChoice.AddToPanelListAndSelect(MovementPhase); Assert.IsTrue(DummyMap.ListActionMenuChoice.HasMainPanel); Assert.AreEqual(1, DummyPlayer.GamePiece.Position.X); for (int i = 0; i < 6; ++i) { DummyMap.Update(new GameTime()); } Assert.IsTrue(DummyMap.ListActionMenuChoice.HasMainPanel); Assert.AreEqual(2, DummyPlayer.GamePiece.Position.X); for (int i = 0; i < 6; ++i) { DummyMap.Update(new GameTime()); } Assert.IsTrue(DummyMap.ListActionMenuChoice.HasMainPanel); Assert.AreEqual(3, DummyPlayer.GamePiece.Position.X); for (int i = 0; i < 6; ++i) { DummyMap.Update(new GameTime()); } Assert.IsTrue(DummyMap.ListActionMenuChoice.HasMainPanel); }