Exemplo n.º 1
0
        public void Problem008_Convert_To_Hex_Test_1()
        {
            string act      = Problem008.ConvertToHex("hello world");
            string excepted = "68 65 6c 6c 6f 20 77 6f 72 6c 64";

            Assert.Equal(act, excepted);
        }
Exemplo n.º 2
0
        public void Problem008_Convert_To_Hex_Test_3()
        {
            string act      = Problem008.ConvertToHex("Big Boi");
            string excepted = "42 69 67 20 42 6f 69";

            Assert.Equal(act, excepted);
        }
Exemplo n.º 3
0
        public void Problem008_Convert_To_Hex_Test_2()
        {
            string act      = Problem008.ConvertToHex("Marty Poppinson");
            string excepted = "4d 61 72 74 79 20 50 6f 70 70 69 6e 73 6f 6e";

            Assert.Equal(act, excepted);
        }
Exemplo n.º 4
0
        public void Problem008()
        {
            var problem = new Problem008()
            {
                ConsoleOutput = false, DetailedOutput = false
            };

            Assert.AreEqual(23514624000L, problem.Answer());
        }
Exemplo n.º 5
0
        public void IsCorrectProblem008()
        {
            var problem = new Problem008();

            Assert.Equal(Answers["8"], problem.Solve());
        }
Exemplo n.º 6
0
        public void Solve2Test(int n)
        {
            int sum = (n + 1) * n / 2;

            Assert.AreEqual(sum, Problem008.Solve2(n));
        }