Fixes some warnings from unit tests
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Text.Json;
|
||||
using EnumerableAsyncProcessor.Extensions;
|
||||
using PkmnLib.Dynamic.Models;
|
||||
@@ -9,7 +8,7 @@ namespace PkmnLib.Tests.Integration;
|
||||
|
||||
public class IntegrationTestRunner
|
||||
{
|
||||
public static IEnumerable<IntegrationTestModel> TestCases()
|
||||
public static IEnumerable<Func<IntegrationTestModel>> TestCases()
|
||||
{
|
||||
var files = Directory.GetFiles("Integration/Tests", "*.json");
|
||||
var serializerOptions = new JsonSerializerOptions
|
||||
@@ -20,9 +19,11 @@ public class IntegrationTestRunner
|
||||
};
|
||||
foreach (var file in files)
|
||||
{
|
||||
var json = File.ReadAllText(file);
|
||||
var test = JsonSerializer.Deserialize<IntegrationTestModel>(json, serializerOptions)!;
|
||||
yield return test;
|
||||
yield return () =>
|
||||
{
|
||||
var json = File.ReadAllText(file);
|
||||
return JsonSerializer.Deserialize<IntegrationTestModel>(json, serializerOptions)!;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user