Skip to content

Commit

Permalink
Merge pull request #1028 from dorssel/add_test
Browse files Browse the repository at this point in the history
Add unit test
  • Loading branch information
dorssel authored Sep 4, 2024
2 parents ed0301a + 0e9938a commit 5528425
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions UnitTests/Automation_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,15 @@ public void JsonConverterIPAddress_Write_NullWriter()
});
}

[TestMethod]
public void JsonConverterIPAddress_Write_NullValue()
{
using var memoryStream = new MemoryStream();
using var writer = new Utf8JsonWriter(memoryStream, new() { SkipValidation = true });
var converter = new JsonConverterIPAddress();
Assert.ThrowsException<ArgumentNullException>(() =>
{
converter.Write(writer, null!, JsonSerializerOptions.Default);
});
}
}

0 comments on commit 5528425

Please sign in to comment.