示例#1
0
        public void FromString__FallSleep()
        {
            GuardEvent guardEvent = GuardEvent.FromString("[1518-11-02 00:40] falls asleep");

            Assert.AreEqual(null, guardEvent.ID);
            Assert.AreEqual(11, guardEvent.Date.Month);
            Assert.AreEqual(2, guardEvent.Date.Day);
            Assert.AreEqual(0, guardEvent.Date.Hour);
            Assert.AreEqual(40, guardEvent.Date.Minute);
            Assert.AreEqual(GuardEventType.FallSleep, guardEvent.Type);
        }
示例#2
0
        public void FromString__WakeUp()
        {
            GuardEvent guardEvent = GuardEvent.FromString("[1518-11-03 00:29] wakes up");

            Assert.AreEqual(null, guardEvent.ID);
            Assert.AreEqual(11, guardEvent.Date.Month);
            Assert.AreEqual(3, guardEvent.Date.Day);
            Assert.AreEqual(0, guardEvent.Date.Hour);
            Assert.AreEqual(29, guardEvent.Date.Minute);
            Assert.AreEqual(GuardEventType.WakeUp, guardEvent.Type);
        }
示例#3
0
        public void FromString__ShiftBegin()
        {
            GuardEvent guardEvent = GuardEvent.FromString("[1518-11-01 00:00] Guard #10 begins shift");

            Assert.AreEqual(10, guardEvent.ID);
            Assert.AreEqual(11, guardEvent.Date.Month);
            Assert.AreEqual(1, guardEvent.Date.Day);
            Assert.AreEqual(0, guardEvent.Date.Hour);
            Assert.AreEqual(0, guardEvent.Date.Minute);
            Assert.AreEqual(GuardEventType.ShiftBegin, guardEvent.Type);
        }