Skip to content

Commit

Permalink
Minot refactor building test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Jun 8, 2024
1 parent 698c85e commit 20c41b3
Showing 1 changed file with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,9 @@ public static void DeserializeDtoWithValueToDtoWithUnitFromObject_ExpectNoExcept
{
get
{
IEnumerable<JsonValue> values =
[
JsonValue.Create(true),
JsonValue.Create(false),

JsonValue.Create(int.MinValue),
JsonValue.Create(-1),
JsonValue.Create(0),
JsonValue.Create(1.1m),
JsonValue.Create(1.2),
JsonValue.Create(int.MaxValue),

JsonValue.Create(double.MinValue),
JsonValue.Create(double.MaxValue),

JsonValue.Create(""),
JsonValue.Create("1"),
JsonValue.Create("0AFB2897-BA58-4E10-A083-4C33341B6238")
];

var result = new TheoryData<JsonValue, JsonSerializerOptions?>();

foreach (var value in values)
foreach (var value in EnumerateValues())
{
foreach (var options in EnumerateJsonSerializerOptionsCases())
{
Expand All @@ -80,6 +60,26 @@ public static void DeserializeDtoWithValueToDtoWithUnitFromObject_ExpectNoExcept
}

return result;

static IEnumerable<JsonValue> EnumerateValues()
{
yield return JsonValue.Create(true);
yield return JsonValue.Create(false);

yield return JsonValue.Create(int.MinValue);
yield return JsonValue.Create(-1);
yield return JsonValue.Create(0);
yield return JsonValue.Create(1.1m);
yield return JsonValue.Create(1.2);
yield return JsonValue.Create(int.MaxValue);

yield return JsonValue.Create(double.MinValue);
yield return JsonValue.Create(double.MaxValue);

yield return JsonValue.Create("");
yield return JsonValue.Create("1");
yield return JsonValue.Create("0AFB2897-BA58-4E10-A083-4C33341B6238");
}
}
}
}

0 comments on commit 20c41b3

Please sign in to comment.