error tests expansion
.NET Test / .NET tests (push) Failing after 2m5s

This commit is contained in:
2026-07-12 18:06:53 +04:00
parent 2dbfd781ec
commit e8ae93799e
23 changed files with 1190 additions and 156 deletions
+4 -3
View File
@@ -8,7 +8,7 @@ public sealed class ErrorJsonConverter : JsonConverter<Error>
{
return reader.TokenType switch
{
JsonTokenType.StartObject => ToExpectedError(ReadOne(ref reader)),
JsonTokenType.StartObject => ToExpectedError(ReadOne(ref reader)), // deserialization always produce ExpectedError by design
JsonTokenType.StartArray => ReadMany(ref reader),
JsonTokenType.None => null,
JsonTokenType.Null => null,
@@ -42,6 +42,7 @@ public sealed class ErrorJsonConverter : JsonConverter<Error>
{
errors.Add(ToExpectedError(ReadOne(ref reader)));
}
else if (reader.TokenType == JsonTokenType.EndArray) break;
}
return new ManyErrors(errors.ToImmutable());
}
@@ -73,11 +74,11 @@ public sealed class ErrorJsonConverter : JsonConverter<Error>
if (string.IsNullOrEmpty(propvalue))
break;
if (propname == "type" || string.Equals(propname, "type", StringComparison.InvariantCultureIgnoreCase))
if (string.Equals(propname, "type", StringComparison.InvariantCultureIgnoreCase))
{
type = propvalue;
}
else if (propname == "msg" || string.Equals(propname, "msg", StringComparison.InvariantCultureIgnoreCase))
else if (string.Equals(propname, "msg", StringComparison.InvariantCultureIgnoreCase))
{
message = propvalue;
}