using EDPlayerJournal.Entries;

namespace EDPlayerJournalTests;

public class Helper {
    public static List<Entry>? LoadTestData(string filename) {
        string path = Path.GetFullPath("./" + filename);
        string[] lines = File.ReadAllLines(path);
        List<Entry> entries = new();

        foreach (string line in lines) {
            line.Trim();
            if (string.IsNullOrEmpty(line)) {
                continue;
            }

            Entry? entry = Entry.Parse(line);
            if (entry != null) {
                entries.Add(entry);
            }
        }

        return entries;
    }
}
