コード例 #1
0
        public void OnlyEven()
        {
            int        expected = 42;
            List <int> onlyEven = new List <int> {
                40, 2
            };

            int actual = NumberAdder.SumOfEvenNumbers(onlyEven);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void OnlyUneven()
        {
            int        expected = 0;
            List <int> onlyOne  = new List <int> {
                1
            };

            int actual = NumberAdder.SumOfEvenNumbers(onlyOne);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void NullListSumOfEvenNumbers()
        {
            int actual = NumberAdder.SumOfEvenNumbers(null);

            Assert.Fail();
        }