示例#1
0
        public void CanPassNullAndThrowsException()
        {
            //arrange
            ICategory pair = new PairCategory();

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => pair.CalculateScore(null));
        }
示例#2
0
        public void WhenThereAReTwoTestsReturnTheSumOfTheBiggerOne()
        {
            //arrange
            ICategory  pair        = new PairCategory();
            List <int> diceNumbers = new List <int>()
            {
                1, 1, 3, 3, 5
            };

            //act
            var score = pair.CalculateScore(diceNumbers);

            //assert
            Assert.AreEqual(6, score);
        }
示例#3
0
        public void WhenThereIsOnePairItReturnsItsSum()
        {
            //arrange
            ICategory  pair        = new PairCategory();
            List <int> diceNumbers = new List <int>()
            {
                1, 1, 3, 4, 5
            };

            //act
            var score = pair.CalculateScore(diceNumbers);

            //assert
            Assert.AreEqual(2, score);
        }
示例#4
0
        public void Returns0WhenTehreAreNoPairs()
        {
            //arrange
            ICategory  pair        = new PairCategory();
            List <int> diceNumbers = new List <int>()
            {
                1, 2, 3, 4, 5
            };

            //act
            var score = pair.CalculateScore(diceNumbers);

            //Assert

            Assert.AreEqual(0, score);
        }