Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eoinobrien committed Jun 30, 2024
1 parent 8d7fb64 commit edd2686
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions LuasAPI.NET/StationInformation/StationInformationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ namespace LuasAPI.NET

public class StationInformationLoader : IStationInformationLoader
{
private JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
};

public Dictionary<string, Station> Load()
{
var options = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
};

var json = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), StationsDataFile));
return JsonSerializer.Deserialize<Dictionary<string, Station>>(json, options);
var json = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "StationInformation", "Stations.json"));
return JsonSerializer.Deserialize<Dictionary<string, Station>>(json, this.jsonSerializerOptions);
}

private const string StationsDataFile = "StationInformation\\Stations.json";
}
}

0 comments on commit edd2686

Please sign in to comment.