Exemplo n.º 1
0
        public void WhenRollCardIsCurrentAndValidMoveAvailableInStackThenTrueIsR()
        {
            var currentCardStack = new CurrentCardStacks();
            var column1          = new List <ICard>
            {
                new NumberedCard(1, Color.Blue),
                new NumberedCard(4, Color.Green),
            };
            var column2 = new List <ICard>
            {
                new NumberedCard(2, Color.Blue),
                new NumberedCard(3, Color.Yellow),
                new RollCard()
            };
            var column3 = new List <ICard>
            {
                new NumberedCard(1, Color.Blue),
                new NumberedCard(6, Color.Red),
                new RollCard()
            };

            currentCardStack.Columns[0].AddRange(column1);
            currentCardStack.Columns[1].AddRange(column2);
            currentCardStack.Columns[2].AddRange(column3);

            var currentCard = new RollCard();

            var isValidMove = Game.IsValidMoveAvailableInCurrentCardStacks(currentCard, currentCardStack);

            Assert.IsTrue(isValidMove);
        }
Exemplo n.º 2
0
        public void WhenRollCardValidMoveIsAvailableTrueIsReturned()
        {
            var cardDeckToValidateAgainst = new List <ICard>
            {
                new NumberedCard(1, Color.Blue),
                new NumberedCard(3, Color.Red)
            };
            var currentCard = new RollCard();
            var isValidMove = Game.IsValidMoveAvailable(currentCard, cardDeckToValidateAgainst);

            Assert.IsTrue(isValidMove);
        }
Exemplo n.º 3
0
        public void WhenRollCardIsCurrentAndValidMoveAvailableInStackThenTrueIsReturned()
        {
            var currentCardStack = new CurrentCardStacks();

            currentCardStack.Columns[0].Add(new NumberedCard(5, Color.Green));
            currentCardStack.Columns[1].Add(new NumberedCard(1, Color.Green));
            currentCardStack.Columns[2].Add(new NumberedCard(4, Color.Green));

            var currentCard = new RollCard();

            var isValidMove = Game.IsValidMoveAvailableInCurrentCardStacks(currentCard, currentCardStack);

            Assert.IsTrue(isValidMove);
        }