This commit refactors the EventOccurrence parsing logic to utilize the EventOccurrenceParseGroup class, enhancing the organization of parsed occurrences by grouping them based on event definitions and optional section levels. The changes include updates to the EventOccurrenceParseResult, EventOccurrenceParser, and EventOccurrenceParserService to accommodate the new grouping structure. Additionally, tests are modified to reflect these changes, ensuring that the parsing functionality remains intact and accurate. This refactor improves data handling and aligns with the overall architecture of the application.
30 lines
732 B
C#
30 lines
732 B
C#
using Core.Entities;
|
|
using Core.Models;
|
|
using GoogleSheetsScheduleImport;
|
|
|
|
namespace Tests.GoogleSheets;
|
|
|
|
[TestFixture]
|
|
public class OccurrenceDisplayNameReducerTests
|
|
{
|
|
private static EventDefinition Cyber() =>
|
|
new()
|
|
{
|
|
Id = 1,
|
|
Name = "Cybersecurity",
|
|
ShortName = "Cyber",
|
|
Eligibility = "",
|
|
EventFormat = EventFormat.Team
|
|
};
|
|
|
|
[Test]
|
|
public void Strips_ms_prefix_and_event_name()
|
|
{
|
|
var n = OccurrenceDisplayNameReducer.ReduceForSection(
|
|
"MS Cybersecurity Semifinals Presentations",
|
|
Cyber(),
|
|
SchoolLevel.MiddleSchool);
|
|
Assert.That(n, Is.EqualTo("Semifinals Presentations"));
|
|
}
|
|
}
|