Exemplo n.º 1
0
        public void CanPassNullAndThrowsException()
        {
            //arrange
            ICategory pair = new PairCategory();

            //act
            //assert
            Assert.Throws <ArgumentNullException>(() => pair.CalculateScore(null));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }