예제 #1
0
        public void CanPassNullAndThrowsException()
        {
            //arrange
            ICategory three = new ThreeOfAKindCategory();

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => three.CalculateScore(null));
        }
예제 #2
0
        public void ReturnsSumIfThereAre3OfAKindWhenAllAreSameNumbers()
        {
            //arrange
            ICategory  three       = new ThreeOfAKindCategory();
            List <int> diceNumbers = new List <int>()
            {
                2, 2, 2, 2, 2
            };

            //act
            //assert
            Assert.AreEqual(6, three.CalculateScore(diceNumbers));
        }
예제 #3
0
        public void ReturnsSumIfThereAre3OfAKind()
        {
            //arrange
            ICategory  three       = new ThreeOfAKindCategory();
            List <int> diceNumbers = new List <int>()
            {
                1, 1, 1, 4, 5
            };

            //act
            //assert
            Assert.AreEqual(3, three.CalculateScore(diceNumbers));
        }