Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expanded test coverage.
  • Loading branch information
CodeBlanch committed Feb 10, 2020
commit e91a0b8ce6b0bed19fc431fea9d85e199d831285
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ public static void OverrideDefaultConverter()
Assert.Equal(1, myInt);
}

{
int? myInt = JsonSerializer.Deserialize<int?>("null", options);
Assert.False(myInt.HasValue);
}

{
int? myInt = JsonSerializer.Deserialize<int?>("1", options);
Assert.Equal(1, myInt.Value);
}

{
Int32Class myIntClass = JsonSerializer.Deserialize<Int32Class>(@"{""MyInt"":null}");
Assert.False(myIntClass.MyInt.HasValue);
Expand Down