예제 #1
0
        public void Day4_Part1_Valid()
        {
            // Arrange
            var testInput = new List <string> {
                "aa bb cc dd ee"
            };

            // Act
            var result = _itemUnderTest.SolvePart1(testInput);

            // Assert
            Assert.AreEqual(1, result);
        }
예제 #2
0
        public void What()
        {
            var subject = new Day4Solution();

            subject.SolvePart1(new List <Day4Solution.GuardLog>
            {
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.BeginShift, Timestamp = new DateTime(1518, 11, 1, 0, 0, 0), Id = 10
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 1, 0, 5, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 1, 0, 25, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 1, 0, 30, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 1, 0, 55, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.BeginShift, Timestamp = new DateTime(1518, 11, 1, 23, 58, 0), Id = 99
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 2, 0, 40, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 2, 0, 50, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.BeginShift, Timestamp = new DateTime(1518, 11, 3, 0, 5, 0), Id = 10
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 3, 0, 24, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 3, 0, 29, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.BeginShift, Timestamp = new DateTime(1518, 11, 4, 0, 2, 0), Id = 99
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 4, 0, 36, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 4, 0, 46, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.BeginShift, Timestamp = new DateTime(1518, 11, 5, 0, 3, 0), Id = 99
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.FallsAsleep, Timestamp = new DateTime(1518, 11, 5, 0, 45, 0)
                },
                new Day4Solution.GuardLog {
                    Event = Day4Solution.EventType.WakesUp, Timestamp = new DateTime(1518, 11, 5, 0, 55, 0)
                },
            }).Should().Be(240);
        }