예제 #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);
        }