We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7a2325d + 7163a1a commit 56def5bCopy full SHA for 56def5b
IntelliTect.TestTools.TestFramework/IntelliTect.TestTools.TestFramework/TestBuilder.cs
@@ -196,7 +196,16 @@ public void ExecuteTestCase()
196
197
private static string GetObjectDataAsJsonString(object obj)
198
{
199
- return JsonSerializer.Serialize(obj, new JsonSerializerOptions { WriteIndented = true });
+
200
+ try
201
+ {
202
+ return JsonSerializer.Serialize(obj, new JsonSerializerOptions { WriteIndented = true });
203
+ }
204
+ catch (JsonException e)
205
206
+ return $"Unable to serialize object {obj?.GetType()} to JSON. Mark the relevant property with the [JsonIgnore] attribute: {e.Message}";
207
208
209
}
210
211
private object GetTestBlock(IServiceScope scope, Type tbType)
0 commit comments