public void LongestBreakStatsFact_OnlyOneEvent_FactIsNone() { var tracker = EntityMaker.CreateSomeTracker(Guid.NewGuid(), _mockTrackerRepository); EntityMaker.CreateSomeEvent(tracker.Id, _mockEventRepository); var statsFact = new LongestBreakStatsFact() .Apply(_mockEventRepository.GetAll()); Assert.IsTrue(statsFact.IsNone); }
public void LongestBreakStatsFact_TwoEventsWithThreeDaysBreak_CorrectBreak() { var tracker = EntityMaker.CreateSomeTracker(Guid.NewGuid(), _mockTrackerRepository); var date1 = new DateTime(2020, 1, 1, 1, 0, 0); var date2 = new DateTime(2020, 1, 4, 2, 0, 0); var event1 = new Event(Guid.NewGuid(), tracker.Id, "Event1", date1, date1); var event2 = new Event(Guid.NewGuid(), tracker.Id, "Event2", date2, date2); _mockEventRepository.Save(event1); _mockEventRepository.Save(event2); var statsFact = new LongestBreakStatsFact() .Apply(_mockEventRepository.GetAll()); Assert.AreEqual(3, ((LongestBreakStatsFact)statsFact).Break.Days); }