Exemplo n.º 1
0
        public void Day11_FullTest()
        {
            var data = TestUtil.GetFileContentsAsString("Day11.txt");

            Assert.AreEqual(2438, new SeatCalculator().CalculateTakenSeats(data));
            Assert.AreEqual(2174, new SeatCalculator().CalculateTakenSeats(data, true));
        }
Exemplo n.º 2
0
        public void TestPart2_Full()
        {
            var data = TestUtil.GetFileContentsAsString("Day18.txt").Split(Environment.NewLine);
            var sum  = data.Select(OperationOrder.CalculateLineForPartTwo).Sum();

            Assert.AreEqual(231235959382961, sum);
        }
Exemplo n.º 3
0
        public void Day12_FullTest01()
        {
            var data = TestUtil.GetFileContentsAsString("Day12.txt").Split(Environment.NewLine);

            Assert.AreEqual(938, RainRisk.CalculateDistance(data));
            Assert.AreEqual(54404, RainRisk.CalculateDistanceWithWaypoint(data));
        }
Exemplo n.º 4
0
 public void Setup()
 {
     _input = TestUtil
              .GetFileContentsAsString("Day2.txt")
              .Split(Environment.NewLine)
              .Select(PasswordPolicy.Parse)
              .ToArray();
 }
Exemplo n.º 5
0
        public void Day08_Full()
        {
            var input = TestUtil
                        .GetFileContentsAsString("Day8.txt")
                        .Split(Environment.NewLine);
            var output = GameConsole.GetLastValueBeforeInfiniteLoop(input);

            Assert.AreEqual(1563, output);
        }
Exemplo n.º 6
0
        public void Day07_Full()
        {
            var input = TestUtil
                        .GetFileContentsAsString("Day7.txt")
                        .Split(Environment.NewLine);
            var output = BagCounter.GetOuterBagCount(input, "shiny gold");

            Assert.AreEqual(259, output.Part1);
            Assert.AreEqual(45018, output.Part2);
        }
Exemplo n.º 7
0
        public void Day08_Full_02()
        {
            var input = TestUtil
                        .GetFileContentsAsString("Day8.txt")
                        .Split(Environment.NewLine);
            var output = GameConsole.GetValue(input);

            // 2604 == too high
            Assert.AreEqual(767, output);
        }
Exemplo n.º 8
0
        public void Day14_Full_Part2()
        {
            var data = TestUtil.GetFileContentsAsString("Day14.txt").Split(Environment.NewLine);

            Assert.AreEqual(3296185383161, DockingData.Part2(data));
        }
Exemplo n.º 9
0
        public void Day14_Full_Part1()
        {
            var data = TestUtil.GetFileContentsAsString("Day14.txt").Split(Environment.NewLine);

            Assert.AreEqual(14862056079561, DockingData.Part1(data));
        }
Exemplo n.º 10
0
        public void TestPart02()
        {
            var data = TestUtil.GetFileContentsAsString("Day16.txt");

            Assert.AreEqual(2355350878831, TicketTranslation.GetTicketDepartureFieldCount(data.Split(Environment.NewLine + Environment.NewLine).Select(x => x.Split(Environment.NewLine).ToList()).ToList()));
        }
Exemplo n.º 11
0
 public void Setup()
 {
     _items = TestUtil
              .GetFileContentsAsString("Day3.txt")
              .Split(Environment.NewLine);
 }
Exemplo n.º 12
0
        public void Day13_Full_Test02()
        {
            var data = TestUtil.GetFileContentsAsString("Day13.txt").Split(Environment.NewLine);

            Assert.AreEqual(600689120448303, ShuttleSearch.GetLastPart(data[1]));
        }
Exemplo n.º 13
0
        public void Day13_Full_Test01()
        {
            var data = TestUtil.GetFileContentsAsString("Day13.txt").Split(Environment.NewLine);

            Assert.AreEqual(3385, ShuttleSearch.GetEarliestCalculatedTimestamp(data));
        }
Exemplo n.º 14
0
        public void Part2()
        {
            var input = TestUtil.GetFileContentsAsString("Day17.txt");

            Assert.AreEqual(1792, new ConwayRecordHyperCubeCalculator().GetActiveCubes(6, input));
        }
Exemplo n.º 15
0
        public void Part1()
        {
            var input = TestUtil.GetFileContentsAsString("Day17.txt");

            Assert.AreEqual(298, ConwayRecordCalculator.GetActiveCubes(6, input));
        }
Exemplo n.º 16
0
 public void Setup()
 {
     _items = TestUtil
              .GetFileContentsAsString("Day4.txt");
 }
Exemplo n.º 17
0
        public void TestPart01()
        {
            var data = TestUtil.GetFileContentsAsString("Day16.txt");

            Assert.AreEqual(18227, TicketTranslation.GetTicketScanningErrorRate(data.Split(Environment.NewLine + Environment.NewLine).Select(x => x.Split(Environment.NewLine).ToList()).ToList()));
        }