Esempio n. 1
0
        // A number of tests created implementing cards from Yu-Gi-Oh implementing their skills
        // Some of these may require client-side tests (targeting-skills, option-skills, multi-targeting skills)

        // [Test]
        // public void DarkHole()
        // {
        //     Card support = CommonPlay(OpCodes.GetController, OpCodes.GetUnits, OpCodes.GetOpponent, OpCodes.GetUnits, OpCodes.Destroy);
        //     // Card support = CommonPlay(OpCodes.Literal, a, OpCodes.Literal, b, math,
        //     //     OpCodes.GetController, OpCodes.SetHealth);
        //     // int health = P1.Health;
        //     // Match.Activate(P1, support);
        //     // Match.PassPlay(P2);
        //     // Match.PassPlay(P1);
        //     // Assert.IsEqual(P1.Health, result, context);
        // }

        private Card CommonPlay(params object[] ops)
        {
            StartGame(BuildDeck("Basic Support"));
            Card support = P1.Hand[0];

            support.Skill = BuildSkill(support, ops);
            Match.Activate(P1, support);
            Match.EndTurn(P1);
            Match.EndTurn(P2);
            return(support);
        }
Esempio n. 2
0
        public void Calculation(OpCodes math, int a, int b, int result, string context)
        {
            Card support = CommonPlay(OpCodes.Literal, a, OpCodes.Literal, b, math,
                                      OpCodes.GetController, OpCodes.SetHealth);
            int health = P1.Health;

            Match.Activate(P1, support);
            Match.PassPlay(P2);
            Match.PassPlay(P1);
            Assert.IsEqual(P1.Health, result, context);
        }
Esempio n. 3
0
        public void PlayerGetter(bool isPlayer1, OpCodes getPlayer, string context)
        {
            Card   support = CommonPlay(OpCodes.Literal, 3, getPlayer, OpCodes.Draw);
            Player player  = isPlayer1 ? P1 : P2;
            int    count   = player.Hand.Count;

            Match.Activate(P1, support);
            Match.PassPlay(P2);
            Match.PassPlay(P1);
            Assert.IsEqual(player.Hand.Count, count + 3, context);
        }
Esempio n. 4
0
        public void Comparison(int a, int b, OpCodes comparison, string context)
        {
            const int jump    = 4;
            Card      support = CommonPlay(OpCodes.Literal, a, OpCodes.Literal, b, comparison,
                                           OpCodes.Literal, jump, OpCodes.If, OpCodes.Literal, 5, OpCodes.GetOpponent, OpCodes.Draw);
            int count = P2.Hand.Count;

            Match.Activate(P1, support);
            Match.PassPlay(P2);
            Match.PassPlay(P1);
            Assert.IsEqual(P2.Hand.Count, count + 5, context);
        }
Esempio n. 5
0
        public void CardGetter(OpCodes getZone, string zoneToAddTo, int cardsToAdd, int expected, string context)
        {
            StartGame(BuildDeck("Basic Support"));
            Card support = CommonPlay(OpCodes.GetController, getZone, OpCodes.CountCards, OpCodes.GetController, OpCodes.Draw);
            Zone zone    = (Zone)typeof(Player).GetProperty(zoneToAddTo) !.GetValue(P1);

            for (int i = 0; i < cardsToAdd; i++)
            {
                zone !.Add(new Card(0, P1));
            }
            Match.Activate(P1, support);
            Match.PassPlay(P2);
            Match.PassPlay(P1);
            Assert.IsEqual(P1.Hand.Count, expected, context);
        }
Esempio n. 6
0
        public void ActivationAction()
        {
            // How do we remove the current
            StartGame(BuildDeck("Basic Support"));
            Card support = P1.Hand[0];

            Match.SetFaceDown(P1, support);
            Match.EndTurn(P1);
            Match.EndTurn(P2);
            int handCount = P1.Hand.Count;
            int deckCount = P1.Deck.Count;

            Match.Activate(P1, support);
            Match.PassPlay(P2);
            Match.PassPlay(P1);

            Assert.IsEqual(P1.Hand.Count, handCount + 2, "Player added 2 cards to their hand");
            //Assert.IsEqual(P1.Deck.Count, deckCount - 2, "Player removed the drawn cards from their deck");
            //Assert.Contains(support, P1.Graveyard, "Support was moved to graveyard");
        }