示例#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));
        }
示例#2
0
文件: Day18.cs 项目: rceuls/AoC2020
        public void TestPart2_Full()
        {
            var data = TestUtil.GetFileContentsAsString("Day18.txt").Split(Environment.NewLine);
            var sum  = data.Select(OperationOrder.CalculateLineForPartTwo).Sum();

            Assert.AreEqual(231235959382961, sum);
        }
示例#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));
        }
示例#4
0
 public void Setup()
 {
     _input = TestUtil
              .GetFileContentsAsString("Day2.txt")
              .Split(Environment.NewLine)
              .Select(PasswordPolicy.Parse)
              .ToArray();
 }
示例#5
0
        public void Day08_Full()
        {
            var input = TestUtil
                        .GetFileContentsAsString("Day8.txt")
                        .Split(Environment.NewLine);
            var output = GameConsole.GetLastValueBeforeInfiniteLoop(input);

            Assert.AreEqual(1563, output);
        }
示例#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);
        }
示例#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);
        }
示例#8
0
文件: Day14.cs 项目: rceuls/AoC2020
        public void Day14_Full_Part2()
        {
            var data = TestUtil.GetFileContentsAsString("Day14.txt").Split(Environment.NewLine);

            Assert.AreEqual(3296185383161, DockingData.Part2(data));
        }
示例#9
0
文件: Day14.cs 项目: rceuls/AoC2020
        public void Day14_Full_Part1()
        {
            var data = TestUtil.GetFileContentsAsString("Day14.txt").Split(Environment.NewLine);

            Assert.AreEqual(14862056079561, DockingData.Part1(data));
        }
示例#10
0
文件: Day16.cs 项目: rceuls/AoC2020
        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()));
        }
示例#11
0
 public void Setup()
 {
     _items = TestUtil
              .GetFileContentsAsString("Day3.txt")
              .Split(Environment.NewLine);
 }
示例#12
0
        public void Day13_Full_Test02()
        {
            var data = TestUtil.GetFileContentsAsString("Day13.txt").Split(Environment.NewLine);

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

            Assert.AreEqual(3385, ShuttleSearch.GetEarliestCalculatedTimestamp(data));
        }
示例#14
0
文件: Day17.cs 项目: rceuls/AoC2020
        public void Part2()
        {
            var input = TestUtil.GetFileContentsAsString("Day17.txt");

            Assert.AreEqual(1792, new ConwayRecordHyperCubeCalculator().GetActiveCubes(6, input));
        }
示例#15
0
文件: Day17.cs 项目: rceuls/AoC2020
        public void Part1()
        {
            var input = TestUtil.GetFileContentsAsString("Day17.txt");

            Assert.AreEqual(298, ConwayRecordCalculator.GetActiveCubes(6, input));
        }
示例#16
0
 public void Setup()
 {
     _items = TestUtil
              .GetFileContentsAsString("Day4.txt");
 }
示例#17
0
文件: Day16.cs 项目: rceuls/AoC2020
        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()));
        }