public int[] AnalyzerReturnsCorrectConflicts( int hour1, int minute1, int duration1, int hour2, int minute2, int duration2) { var analyzer = new EventConflictsAnalyzer(new EventArraySortSorter()); var eventList = new List <IEvent>(); eventList.Add(MockFactory.CreateEventMockForGetOnly(hour1, minute1, duration1, "Event Mock 1").Object); eventList.Add(MockFactory.CreateEventMockForGetOnly(hour2, minute2, duration2, "Event Mock 2").Object); EventConflicts[] conflicts = analyzer.Process(eventList).ToArray(); if (!conflicts.Any()) { return new[] { 0, 0 } } ; return(new[] { conflicts[0].FutureConflicts.Count + conflicts[0].PastConflicts.Count, conflicts[1].FutureConflicts.Count + conflicts[1].PastConflicts.Count }); } }
private static IEnumerable <EventConflicts> GetAllConflicts(IList <IEvent> events) { IEventStartEndSorter?sorter = Container.Current.Get <IEventStartEndSorter>() ?? throw new ArgumentNullException( $"Could not get an instance of an {nameof(IEventSorter)} from container."); EventConflictsAnalyzer conflictsAnalyzer = new EventConflictsAnalyzer(sorter); IEnumerable <EventConflicts> conflictsList = conflictsAnalyzer.Process(events); return(conflictsList); }