Enhance event occurrence parsing with detailed issue reporting and location configuration
This commit introduces a new structure for handling parsing issues in the EventOccurrenceParser, allowing for detailed reporting of parsing problems such as unmatched lines, missing event definitions, and parsing failures for time, date, and location. A new ParsingIssue class has been added to encapsulate these details. Additionally, a LocationParsingConfiguration class has been implemented to support customizable location patterns, enhancing the flexibility of the parser. The EventOccurrenceParserService has been updated to utilize this configuration, and new tests have been added to ensure robust issue detection and reporting. Furthermore, the UI has been updated to display parsing issues, improving user feedback during the import process.
This commit is contained in:
@@ -3,15 +3,18 @@ using Core.Parsers;
|
||||
|
||||
namespace Tests.Parsers;
|
||||
|
||||
/// <summary>
|
||||
/// Integration tests for EventOccurrenceParser using real test data files.
|
||||
/// </summary>
|
||||
public class EventOccurrenceParser_Tests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void ParseNationalsTest()
|
||||
{
|
||||
var events = TestEntityHandler.GetEvents();
|
||||
var parser = new EventOccurrenceParser(TestEntityHandler.GetEventOccurrenceNationalsFileInfo(), events);
|
||||
var dictionary = parser.Parse();
|
||||
var result = parser.Parse();
|
||||
var dictionary = result.Occurrences;
|
||||
Console.WriteLine($"Occurrence, Month, Date, Time, Location");
|
||||
foreach (var @event in events)
|
||||
{
|
||||
@@ -74,7 +77,8 @@ public class EventOccurrenceParser_Tests
|
||||
{
|
||||
var events = TestEntityHandler.GetEvents();
|
||||
var parser = new EventOccurrenceParser(TestEntityHandler.GetEventOccurrenceStateFileInfo(), events);
|
||||
var dictionary = parser.Parse();
|
||||
var result = parser.Parse();
|
||||
var dictionary = result.Occurrences;
|
||||
Console.WriteLine($"Occurrence, Month, Date, Time, Location");
|
||||
foreach (var @event in events)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user