Ejemplo n.º 1
0
        public void InitCardManager()
        {
            CardManager manager = new CardManager();
            List <Card> draft   = manager.GetDraft();
            Card        card    = manager.CreateCardFromDraft(0);

            CardManagerTest.AssertCards(draft[0], card);
        }
Ejemplo n.º 2
0
        private void RunPickTest(int expectedPick)
        {
            List <Card> draft  = manager.GetDraft();
            PickAction  action = new PickAction(expectedPick, manager);

            bool result = action.Execute(player1, player2);

            Assert.IsTrue(result);
            Assert.AreEqual(player1.Deck.Count, 1);
            Assert.AreEqual(player2.Deck.Count, 0);
            CardManagerTest.AssertCards(draft[expectedPick], player1.Deck[0]);
        }
Ejemplo n.º 3
0
        private void RunInvalidAttackCreatureTest(int sourceId, int targetId)
        {
            player1.Table.TryGetValue(sourceId, out CombatCreature attackCreature);
            player2.Table.TryGetValue(sourceId, out CombatCreature defenseCreature);

            AttackAction action = new AttackAction(sourceId, targetId);
            bool         result = action.Execute(player1, player2);

            Assert.IsTrue(result);
            Assert.AreEqual(DEFAULT_MY_HEALTH, player1.Data.Health);
            Assert.AreEqual(DEFAULT_OPP_HEALTH, player2.Data.Health);
            if (attackCreature != null)
            {
                CardManagerTest.AssertCards(manager.AllPossibleCards[attackCreature.Card.Number - 1], attackCreature.Card);
            }
            if (defenseCreature != null)
            {
                CardManagerTest.AssertCards(manager.AllPossibleCards[defenseCreature.Card.Number - 1], defenseCreature.Card);
            }
        }