public static void ReadSimpleTestStruct_NullableStructCollectionWrappers() { { SimpleTestStructWithNullableStructCollectionWrappers obj = JsonSerializer.Deserialize <SimpleTestStructWithNullableStructCollectionWrappers>(SimpleTestStructWithNullableStructCollectionWrappers.s_json); obj.Verify(); } { string json = @"{" + @"""List"" : null," + @"""Dictionary"" : null" + @"}"; SimpleTestStructWithNullableStructCollectionWrappers obj = JsonSerializer.Deserialize <SimpleTestStructWithNullableStructCollectionWrappers>(json); Assert.False(obj.List.HasValue); Assert.False(obj.Dictionary.HasValue); } }
public async Task ReadSimpleTestStruct_NullableStructCollectionWrappers() { { SimpleTestStructWithNullableStructCollectionWrappers obj = await JsonSerializerWrapperForString.DeserializeWrapper <SimpleTestStructWithNullableStructCollectionWrappers>(SimpleTestStructWithNullableStructCollectionWrappers.s_json); obj.Verify(); } { string json = @"{" + @"""List"" : null," + @"""Dictionary"" : null" + @"}"; SimpleTestStructWithNullableStructCollectionWrappers obj = await JsonSerializerWrapperForString.DeserializeWrapper <SimpleTestStructWithNullableStructCollectionWrappers>(json); Assert.False(obj.List.HasValue); Assert.False(obj.Dictionary.HasValue); } }