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 TestDrawCardPhase() { Player DummyPlayer = new Player("Player 1", "Human", true, false, 0, new Card[] { new Card(), new Card(), new Card() }); SorcererStreetMap DummyMap = CreateDummyMap(); ActionPanelDrawCardPhase DrawCardPhase = new ActionPanelDrawCardPhase(DummyMap, DummyPlayer); Assert.AreEqual(3, DummyPlayer.ListRemainingCardInDeck.Count); Assert.AreEqual(0, DummyPlayer.ListCardInHand.Count); DrawCardPhase.OnSelect(); Assert.AreEqual(2, DummyPlayer.ListRemainingCardInDeck.Count); Assert.AreEqual(1, DummyPlayer.ListCardInHand.Count); }