AddExtraSettings doesn't respect NullValueHandling? #1467
-
It looks like Verify ignores JSON serialization setting for public class TypeWithNullableProperty
{
public int? DebugPort { get; set; }
}
public async Task VerificationTest()
{
var obj = new TypeWithNullableProperty();
await Verifier.Verify(obj)
.UseStrictJson()
.AddExtraSettings(x =>
{
x.NullValueHandling = NullValueHandling.Include;
x.Formatting = Formatting.Indented;
});
} Expected {
"DebugPort": null
} Actual {
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
i suspect it is because DebugPort is not public |
Beta Was this translation helpful? Give feedback.
-
That's not the case, though. Even if public, the setting is not respected. |
Beta Was this translation helpful? Give feedback.
-
i am going to need a stand alone repro. i added a test for this scenario and it works |
Beta Was this translation helpful? Give feedback.
-
hmmm r u missing |
Beta Was this translation helpful? Give feedback.
-
also, is there some reason you are not using the static APIs for those tweaks? i would assume u want them to be global? |
Beta Was this translation helpful? Give feedback.
hmmm r u missing
DefaultValueHandling = DefaultValueHandling.Include
?