public async Task TestDay8Part2()
    {
        var inputMock    = PrepareInput();
        var objUnderTest = new Day8(inputMock.Object);

        Assert.That(await objUnderTest.Part2(), Is.EqualTo(61229));
    }
        public void Part2Test()
        {
            string[] input =
            {
                "b inc 5 if a > 1",
                "a inc 1 if b < 5",
                "c dec -10 if a >= 1",
                "c inc -20 if c == 10"
            };

            Assert.AreEqual(Day8.Part2(input), 10);
        }
Exemple #3
0
        internal void Handle()
        {
            Day d = new Day(0);

            switch (selected + 1)
            {
            case 1:
                d = new Day1(GetPath("Day1-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 2:
                d = new Day2(GetPath("Day2-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 3:
                d = new Day3(GetPath("Day3-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1Long()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2Long()));
                break;

            case 4:
                d = new Day4(GetPath("Day4-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 5:
                d = new Day5(GetPath("Day5-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 6:
                d = new Day6(GetPath("Day6-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 7:
                d = new Day7(GetPath("Day7-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 8:
                d = new Day8(GetPath("Day8-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 9:
                d = new Day9(GetPath("Day9-Part1.txt"), 25);
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1Long()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2Long()));
                break;

            case 10:
                d = new Day10(GetPath("Day10-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2Long()));
                break;

            case 11:
                d = new Day11(GetPath("Day11-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 12:
                d = new Day12(GetPath("Day12-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2()));
                break;

            case 13:
                d = new Day13(GetPath("Day13-Part1.txt"));
                Console.WriteLine(String.Format("Result Part 1: {0}", d.Part1Long()));
                Console.WriteLine(String.Format("Result Part 2: {0}", d.Part2Long()));
                break;
            }

            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Exemple #4
0
        public void Part2(string input, int output)
        {
            var result = Day8.Part2(input);

            Assert.True(result == output, $"Expected: {output}, Received: {result}");
        }
 public void Part2_real_test()
 {
     Assert.That(Day8.Part2(_input), Is.EqualTo(19276));
 }
 public void Part2_simple_test()
 {
     Assert.That(Day8.Part2(_simpleTestInput), Is.EqualTo(66));
 }
Exemple #7
0
 public void TestPart2()
 {
     Assert.AreEqual(8, d.Part2());
 }