示例#1
0
        public void Test1()
        {
            var sumRec = new SumRec();
            var result = sumRec.Sum(6);

            var expected = (6 * (6 + 1)) / 2;

            Console.WriteLine($"Exp: {expected}");
            Assert.That(result, Is.EqualTo(expected));
        }
示例#2
0
        public void Test2()
        {
            int n = 253;

            var sumRec = new SumRec();
            var result = sumRec.Sum(n);

            var expected = (n * (n + 1)) / 2;

            Console.WriteLine($"Exp: {expected}");
            Assert.That(result, Is.EqualTo(expected));
        }