コード例 #1
0
        public void TestInput()
        {
            var data   = Day3InputParser.ParseBinaryString("input_data/day3-test.txt");
            var result = RatingDeviner.PowerConsumption(data);

            Assert.Equal((22, 9), result);
        }
コード例 #2
0
        public void PuzzelOne()
        {
            var data   = Day3InputParser.ParseBinaryString("input_data/day3-1.txt");
            var result = RatingDeviner.PowerConsumption(data);

            Assert.Equal((2277, 1818), result);
        }
コード例 #3
0
        public void PuzzelTwo()
        {
            var o = RatingDeviner.OxygenGeneratorRating(
                Day3InputParser.ParseBinaryString("input_data/day3-1.txt"));
            var co = RatingDeviner.CO2ScrubberRating(
                Day3InputParser.ParseBinaryString("input_data/day3-1.txt"));

            Assert.Equal(2539, o);
            Assert.Equal(709, co);
        }
コード例 #4
0
        public void TestInputTwo()
        {
            var o = RatingDeviner.OxygenGeneratorRating(
                Day3InputParser.ParseBinaryString("input_data/day3-test.txt"));
            var co = RatingDeviner.CO2ScrubberRating(
                Day3InputParser.ParseBinaryString("input_data/day3-test.txt"));

            Assert.Equal(23, o);
            Assert.Equal(10, co);
        }