Esempio n. 1
0
        public void TestSumNull()
        {
            //arrange
            var        sumElements = new SumElements();
            List <int> myList      = null;
            int        expected    = 0;
            //act
            int output = sumElements.Sum(myList);

            //assert
            Assert.AreEqual(expected, output);
        }
Esempio n. 2
0
        public void TestSumEmpty()
        {
            //arrange
            List <int> inputList   = new List <int>();
            var        sumElements = new SumElements();
            int        expected    = 0;
            //act
            int output = sumElements.Sum(inputList);

            //assert
            Assert.AreEqual(expected, output);
        }
Esempio n. 3
0
        public void TestSumMultiple()
        {
            //arrange
            List <int> inputList = new List <int>()
            {
                3, 4, 5
            };
            var sumElements = new SumElements();
            int expected    = 12;
            //act
            int output = sumElements.Sum(inputList);

            //assert
            Assert.AreEqual(expected, output);
        }