Enhance event definitions and parsing logic for new event types
Added new event definitions for "Meet the Candidates", "Chapter Officer Meeting", "Voting Delegate Meeting", and "Social Gathering". Updated the EventOccurrenceParser to handle these new event types and modified related services and views to accommodate the changes. Improved test coverage for the new event definitions and ensured proper parsing and display in the calendar components.
This commit is contained in:
@@ -7,10 +7,10 @@ public class EventOccurrenceParser_Tests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void ParseTest()
|
||||
public void ParseNationalsTest()
|
||||
{
|
||||
var events = TestEntityHandler.GetEvents();
|
||||
var parser = new EventOccurrenceParser(TestEntityHandler.GetEventOccurrenceFileInfo(), events);
|
||||
var parser = new EventOccurrenceParser(TestEntityHandler.GetEventOccurrenceNationalsFileInfo(), events);
|
||||
var dictionary = parser.Parse();
|
||||
Console.WriteLine($"Occurrence, Month, Date, Time, Location");
|
||||
foreach (var @event in events)
|
||||
@@ -30,17 +30,104 @@ public class EventOccurrenceParser_Tests
|
||||
}
|
||||
|
||||
Console.WriteLine("General Schedule");
|
||||
foreach (var eo in dictionary[EventDefinition.GeneralSchedule].OrderBy(occurrence => occurrence.StartTime))
|
||||
if (dictionary.ContainsKey(EventDefinition.GeneralSchedule))
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
foreach (var eo in dictionary[EventDefinition.GeneralSchedule].OrderBy(occurrence => occurrence.StartTime))
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
if (dictionary.ContainsKey(EventDefinition.VotingDelegates))
|
||||
foreach (var eo in dictionary[EventDefinition.VotingDelegates])
|
||||
Console.WriteLine("Meet the Candidates");
|
||||
if (dictionary.ContainsKey(EventDefinition.MeetTheCandidates))
|
||||
{
|
||||
Console.WriteLine($"{eo.Name} {eo.StartTime}, {eo.Location}");
|
||||
foreach (var eo in dictionary[EventDefinition.MeetTheCandidates])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Chapter Officer Meeting");
|
||||
if (dictionary.ContainsKey(EventDefinition.ChapterOfficerMeeting))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.ChapterOfficerMeeting])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Voting Delegate Meeting");
|
||||
if (dictionary.ContainsKey(EventDefinition.VotingDelegateMeeting))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.VotingDelegateMeeting])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.Pass();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ParseStatesTest()
|
||||
{
|
||||
var events = TestEntityHandler.GetEvents();
|
||||
var parser = new EventOccurrenceParser(TestEntityHandler.GetEventOccurrenceStateFileInfo(), events);
|
||||
var dictionary = parser.Parse();
|
||||
Console.WriteLine($"Occurrence, Month, Date, Time, Location");
|
||||
foreach (var @event in events)
|
||||
{
|
||||
Console.WriteLine($"{@event.Name}");
|
||||
|
||||
if (!dictionary.ContainsKey(@event))
|
||||
{
|
||||
Console.WriteLine("!!! eventDefinition not found " + @event.Name);
|
||||
continue;
|
||||
}
|
||||
var eventOccurrences = dictionary[@event];
|
||||
foreach (var eo in eventOccurrences)
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("General Schedule");
|
||||
if (dictionary.ContainsKey(EventDefinition.GeneralSchedule))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.GeneralSchedule].OrderBy(occurrence => occurrence.StartTime))
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Meet the Candidates");
|
||||
if (dictionary.ContainsKey(EventDefinition.MeetTheCandidates))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.MeetTheCandidates])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Chapter Officer Meeting");
|
||||
if (dictionary.ContainsKey(EventDefinition.ChapterOfficerMeeting))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.ChapterOfficerMeeting])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Voting Delegate Meeting");
|
||||
if (dictionary.ContainsKey(EventDefinition.VotingDelegateMeeting))
|
||||
{
|
||||
foreach (var eo in dictionary[EventDefinition.VotingDelegateMeeting])
|
||||
{
|
||||
Console.WriteLine($"\t{eo.StartTime.DayOfWeek} {eo.Time}, {eo.Name}, {eo.Location}");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.Pass();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user