Skip to content

Commit 5528425

Browse files
authored
Merge pull request #1028 from dorssel/add_test
Add unit test
2 parents ed0301a + 0e9938a commit 5528425

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

UnitTests/Automation_Tests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,15 @@ public void JsonConverterIPAddress_Write_NullWriter()
334334
});
335335
}
336336

337+
[TestMethod]
338+
public void JsonConverterIPAddress_Write_NullValue()
339+
{
340+
using var memoryStream = new MemoryStream();
341+
using var writer = new Utf8JsonWriter(memoryStream, new() { SkipValidation = true });
342+
var converter = new JsonConverterIPAddress();
343+
Assert.ThrowsException<ArgumentNullException>(() =>
344+
{
345+
converter.Write(writer, null!, JsonSerializerOptions.Default);
346+
});
347+
}
337348
}

0 commit comments

Comments
 (0)