Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dorssel committed Sep 4, 2024
1 parent ed0301a commit 0e9938a
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 0e9938a

Please sign in to comment.