Пример #1
0
        public void CanTakeNullAndThrowException()
        {
            //Arrange
            ICategory twoPairs = new TwoPairsCategory();

            //Act

            //Assert
            Assert.Throws <ArgumentNullException>(() => twoPairs.CalculateScore(null));
        }
Пример #2
0
        public void CanReturnSumOfPairsWhenThereAreFourOfAKind()
        {
            //Arrange
            ICategory  twoPairs  = new TwoPairsCategory();
            List <int> finalDice = new List <int>()
            {
                1, 3, 3, 3, 3
            };

            //Act
            var score = twoPairs.CalculateScore(finalDice);

            //Assert

            Assert.AreEqual(12, score);
        }
Пример #3
0
        public void CanReturn0WhenThereIsOnePair()
        {
            //Arrange
            ICategory  twoPairs  = new TwoPairsCategory();
            List <int> finalDice = new List <int>()
            {
                1, 2, 2, 3, 4
            };

            //Act
            var score = twoPairs.CalculateScore(finalDice);

            //Assert

            Assert.AreEqual(0, score);
        }