コード例 #1
0
ファイル: GameBoardTest.cs プロジェクト: Chane/Cards
        public void TestAllOneSuit()
        {
            var mDeck = new Mock<IDeck<PlayingCard>>();
            mDeck.Setup(m => m.CardsLeft()).Returns(4);
            mDeck.SetupSequence(m => m.Deal())
                .Returns(new PlayingCard(PlayingCard.CardFace.Three, PlayingCard.CardSuit.Hearts))
                .Returns(new PlayingCard(PlayingCard.CardFace.Eight, PlayingCard.CardSuit.Hearts))
                .Returns(new PlayingCard(PlayingCard.CardFace.Five, PlayingCard.CardSuit.Hearts))
                .Returns(new PlayingCard(PlayingCard.CardFace.Two, PlayingCard.CardSuit.Hearts));
            var board = new GameBoard(mDeck.Object);
            board.DealRound();

            board.Play();

            Assert.AreEqual(3, board.ClearSlotCount);
            Assert.AreEqual(1, board.Slot2.Count);
        }
コード例 #2
0
ファイル: GameBoardTest.cs プロジェクト: Chane/Cards
        public void TestSlot3And4ComparisonSlot4Lower()
        {
            var mDeck = new Mock<IDeck<PlayingCard>>();
            mDeck.Setup(m => m.CardsLeft()).Returns(4);
            mDeck.SetupSequence(m => m.Deal())
                .Returns(new PlayingCard(PlayingCard.CardFace.Three, PlayingCard.CardSuit.Spades))
                .Returns(new PlayingCard(PlayingCard.CardFace.Five, PlayingCard.CardSuit.Clubs))
                .Returns(new PlayingCard(PlayingCard.CardFace.Five, PlayingCard.CardSuit.Hearts))
                .Returns(new PlayingCard(PlayingCard.CardFace.Two, PlayingCard.CardSuit.Hearts));
            var board = new GameBoard(mDeck.Object);
            board.DealRound();

            board.Play();

            Assert.AreEqual(1, board.ClearSlotCount);
            Assert.AreEqual(0, board.Slot4.Count);
        }