Skip to content

Commit d3917a1

Browse files
committed
✅ improve tests
1 parent 5319298 commit d3917a1

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using FluentAssertions;
1+
using EliteAPI.Json;
2+
using FluentAssertions;
23

34
namespace EliteAPI.Tests;
45

@@ -16,15 +17,24 @@ public static IEnumerable<FileInfo> GetFiles(string pattern)
1617
public static IEnumerable<FileInfo> GetJournalFiles() => GetFiles("*.log");
1718
public static IEnumerable<FileInfo> GetStatusFiles() => GetFiles("*.json");
1819

19-
// [Test]
20-
// [MethodDataSource(nameof(GetJournalFiles))]
21-
// public async Task JournalFile(FileInfo file)
22-
// {
23-
// var jsons = await File.ReadAllLinesAsync(file.FullName);
24-
//
25-
// foreach (var json in jsons)
26-
// await Assert.That(json).IsEqualTo("poop");
27-
// }
20+
[Test]
21+
[MethodDataSource(nameof(GetJournalFiles))]
22+
public async Task JournalFile(FileInfo file)
23+
{
24+
var jsons = await File.ReadAllLinesAsync(file.FullName);
25+
26+
foreach (var json in jsons)
27+
{
28+
try
29+
{
30+
JsonUtils.FlattenJson(json);
31+
}
32+
catch (Exception ex)
33+
{
34+
Assert.Fail($"{ex.Message}\n{json}");
35+
}
36+
}
37+
}
2838

2939
// [Test]
3040
// [MethodDataSource(nameof(GetStatusFiles))]

0 commit comments

Comments
 (0)