예제 #1
0
        public void SolveTest1()
        {
            var numbers = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8
            };

            var expected = Problem005.Solve(numbers, 4);
            var solution = Problem005.BetterSolve(numbers, 4);

            Assert.AreEqual(expected, solution);
        }
예제 #2
0
        public void SolveTest2(int n, int k)
        {
            var random  = new Random((int)DateTime.Now.Ticks);
            var numbers = new List <int>();

            for (int i = 0; i < n; i++)
            {
                numbers.Add(random.Next());
            }

            var expected = Problem005.Solve(numbers, k);
            var solution = Problem005.BetterSolve(numbers, k);

            Assert.AreEqual(expected, solution);
        }
예제 #3
0
파일: TestCSharp.cs 프로젝트: ajdust/euler
        public void IsCorrectProblem005()
        {
            var problem = new Problem005();

            Assert.Equal(Answers["5"], problem.Solve());
        }