Example #1
0
        public void Problem026()
        {
            var problem = new Problem026()
            {
                ConsoleOutput = false, DetailedOutput = false
            };

            Assert.AreEqual(983, problem.Answer());
        }
Example #2
0
        public void PerformanceTest()
        {
            uint      sum       = 2112532500u;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            string solution1 = Problem026.Solve(sum);

            stopwatch.Stop();
            Console.WriteLine(stopwatch.Elapsed);

            stopwatch.Restart();
            string solution2 = Problem026.ClearlySolve(sum);

            stopwatch.Stop();
            Console.WriteLine(stopwatch.Elapsed);

            Assert.AreEqual(solution1, solution2);
            Console.WriteLine(solution1);
        }
Example #3
0
        public void IsCorrectProblem026()
        {
            var problem = new Problem026();

            Assert.Equal(Answers["26"], problem.Solve());
        }
Example #4
0
        public void CleverSolveTest(uint sum, string expected)
        {
            string solution = Problem026.ClearlySolve(sum);

            Assert.AreEqual(expected, solution);
        }
Example #5
0
        public void SolveTest(uint n, string expected)
        {
            string solution = Problem026.Solve(n);

            Assert.AreEqual(expected, solution);
        }