using Core.Entities; using Tests.Builders; namespace Tests.Parsers; /// /// Shared helper methods for EventOccurrenceParser tests. /// public static class EventOccurrenceParserTestHelpers { /// /// Creates a temporary file with the specified content and returns the FileInfo. /// public static FileInfo CreateTempFile(string content) { var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".txt"); File.WriteAllText(tempPath, content); return new FileInfo(tempPath); } /// /// Creates a minimal EventDefinition for testing. /// public static EventDefinition CreateTestEvent(string name) { return EventDefinitionBuilder.Individual(name).Build(); } /// /// Cleans up a temporary file. /// public static void CleanupTempFile(FileInfo file) { try { if (file.Exists) File.Delete(file.FullName); } catch { // Ignore cleanup errors } } }