Esempio n. 1
0
        public void Day04_ParseRecordTest(string s, string expectedDateTimeString, int expectedGuardId, States expectedState)
        {
            var record = Records.FromRecordBases(new[] { RecordBase.FromString(s), }).Single();

            Assert.Equal(DateTime.Parse(expectedDateTimeString), record.DateTime);
            Assert.True(record.GuardId == default || record.GuardId == expectedGuardId);
            Assert.Equal(expectedState, record.State);
        }
Esempio n. 2
0
 private static IEnumerable <IRecord> LogsToRecords(IEnumerable <string> logs) => Records.FromRecordBases(logs.Select(RecordBase.FromString));