From caa164f2d43dbd3c4d2926256ddf3cfb9f704cf7 Mon Sep 17 00:00:00 2001 From: James Schafer Date: Sat, 10 Jun 2017 22:23:01 -0400 Subject: [PATCH] Implemented the TheaterScheduleComparer --- .../Models/TheaterScheduleComparer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Melody49Notifier/Models/TheaterScheduleComparer.cs b/Melody49Notifier/Models/TheaterScheduleComparer.cs index f9d3340..8557659 100644 --- a/Melody49Notifier/Models/TheaterScheduleComparer.cs +++ b/Melody49Notifier/Models/TheaterScheduleComparer.cs @@ -18,7 +18,21 @@ public TheaterScheduleComparer(TraceWriter log) public bool AreEqual(TheaterSchedule firstTheaterSchedule, TheaterSchedule secondTheaterSchedule) { - throw new NotImplementedException(); + bool areEqual = true; + + areEqual = areEqual && firstTheaterSchedule.ScheduleDescription == secondTheaterSchedule.ScheduleDescription; + areEqual = areEqual && firstTheaterSchedule.TheaterName == secondTheaterSchedule.TheaterName; + areEqual = areEqual && firstTheaterSchedule.Showings.Count == secondTheaterSchedule.Showings.Count; + + for (int i = 0; i < firstTheaterSchedule.Showings.Count; i++) + { + areEqual = areEqual && firstTheaterSchedule.Showings[i].MovieDescription == secondTheaterSchedule.Showings[i].MovieDescription; + //areEqual = areEqual && firstTheaterSchedule.Showings[i].Screen == secondTheaterSchedule.Showings[i].Screen; + //areEqual = areEqual && firstTheaterSchedule.Showings[i].ShowingScheduleDescription == secondTheaterSchedule.Showings[i].ShowingScheduleDescription; + //areEqual = areEqual && firstTheaterSchedule.Showings[i].ActorDescription == secondTheaterSchedule.Showings[i].ActorDescription; + } + + return areEqual; } } }