Example #1
0
        public void Card_CanalBuildingAction1_HandEmptyScoreCards()
        {
            testGame.Players[0].Tableau.ScorePile = testGame.Players[0].Hand;
            testGame.Players[0].Hand = new List <ICard>();

            bool result = new CanalBuilding().Actions.ToList()[0].ActionHandler(new CardActionParameters {
                TargetPlayer = testGame.Players[0], Game = testGame, ActivePlayer = testGame.Players[0], PlayerSymbolCounts = new Dictionary <IPlayer, Dictionary <Symbol, int> >()
            });

            Assert.AreEqual(true, result);

            Assert.AreEqual(3, testGame.Players[0].Hand.Count);
            Assert.AreEqual(3, testGame.AgeDecks.Where(x => x.Age == 1).FirstOrDefault().Cards.Count);
            Assert.AreEqual(3, testGame.AgeDecks.Where(x => x.Age == 2).FirstOrDefault().Cards.Count);

            Assert.AreEqual(0, testGame.Players[0].Tableau.ScorePile.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.GetScore());
            Assert.AreEqual(0, testGame.Players[1].Tableau.ScorePile.Count);

            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Blue].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Green].Cards.Count);
            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Red].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Purple].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Yellow].Cards.Count);
        }
Example #2
0
        public void Card_CanalBuildingAction1_HandCardsScoreCards()
        {
            testGame.Players[0].Tableau.ScorePile = new List <ICard>()
            {
                new Card {
                    Name = "Test Yellow Card", Color = Color.Yellow, Age = 1, Top = Symbol.Blank, Left = Symbol.Crown, Center = Symbol.Tower, Right = Symbol.Tower
                },
                new Card {
                    Name = "Test Blue Card", Color = Color.Blue, Age = 2, Top = Symbol.Blank, Left = Symbol.Crown, Center = Symbol.Tower, Right = Symbol.Tower
                },
                new Card {
                    Name = "Test Green Card", Color = Color.Green, Age = 2, Top = Symbol.Blank, Left = Symbol.Crown, Center = Symbol.Tower, Right = Symbol.Tower
                }
            };

            bool result = new CanalBuilding().Actions.ToList()[0].ActionHandler(new CardActionParameters {
                TargetPlayer = testGame.Players[0], Game = testGame, ActivePlayer = testGame.Players[0], PlayerSymbolCounts = new Dictionary <IPlayer, Dictionary <Symbol, int> >()
            });

            Assert.AreEqual(true, result);

            Assert.AreEqual(2, testGame.Players[0].Hand.Count);
            Assert.AreEqual(2, testGame.Players[0].Hand.Where(x => x.Age == 2).Count());
            Assert.AreEqual(3, testGame.AgeDecks.Where(x => x.Age == 1).FirstOrDefault().Cards.Count);
            Assert.AreEqual(3, testGame.AgeDecks.Where(x => x.Age == 2).FirstOrDefault().Cards.Count);

            Assert.AreEqual(4, testGame.Players[0].Tableau.ScorePile.Count);
            Assert.AreEqual(4, testGame.Players[0].Tableau.GetScore());
            Assert.AreEqual(0, testGame.Players[1].Tableau.ScorePile.Count);

            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Blue].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Green].Cards.Count);
            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Red].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Purple].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Yellow].Cards.Count);
        }