public void ReadWithJsonPropertyName() { JsonSerializerOptions options = new JsonSerializerOptions(); options.SetupExtensions(); const string json = @"{""id"":12}"; ObjectWithJsonPropertyName obj = Helper.Read <ObjectWithJsonPropertyName>(json, options); Assert.NotNull(obj); Assert.Equal(12, obj.Id); }
public void WriteWithJsonPropertyName() { JsonSerializerOptions options = new JsonSerializerOptions(); options.SetupExtensions(); const string json = @"{""id"":12}"; ObjectWithJsonPropertyName obj = new ObjectWithJsonPropertyName { Id = 12 }; Helper.TestWrite(obj, json, options); }