コード例 #1
0
ファイル: OarsTest.cs プロジェクト: Kovaces/Innovation
        public void Card_OarsAction2_NoTransfer()
        {
            //testGame.Players[0].AlwaysParticipates = true;
            //testGame.Players[0].SelectsCards = new List<int>() { 0 };

            //testGame.Players[1].SelectsCards = new List<int>() { 0 };

            testGame.Players[1].Hand.Remove(testGame.Players[1].Hand.First());

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

            Assert.AreEqual(true, result);

            Assert.AreEqual(2, testGame.Players[1].Hand.Count);

            Assert.AreEqual(0, testGame.Players[0].Tableau.ScorePile.Count);
            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);
        }
コード例 #2
0
ファイル: OarsTest.cs プロジェクト: Kovaces/Innovation
        public void Card_OarsAction2_NothingHappens()
        {
            //testGame.Players[0].AlwaysParticipates = true;
            //testGame.Players[0].SelectsCards = new List<int>() { 0 };

            //testGame.Players[1].SelectsCards = new List<int>() { 0 };

            string cardName = testGame.Players[1].Hand.Where(x => x.HasSymbol(Symbol.Crown)).First().Name;

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

            Assert.AreEqual(false, result);

            Assert.AreEqual(2, testGame.Players[1].Hand.Count);

            Assert.AreEqual(1, testGame.Players[0].Tableau.ScorePile.Count);
            Assert.AreEqual(cardName, testGame.Players[0].Tableau.ScorePile.First().Name);
            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);
        }