public void TestAutoTyping() { SimpleObject obj = new SimpleObject() { StringValue = "Hey" }; Document doc = obj.ToMutableDocument(); object newObject = doc.ToObject(); }
public void TestDefaultPropertyNameConverterToMutableDocument() { var simpleObject = new SimpleObject { StringValue = "Test Value" }; var mutableDocument = simpleObject.ToMutableDocument(); var result = mutableDocument?.Keys.Contains("stringValue"); Assert.True(result, "Property Name is not getting converted correctly."); }
public void TestFallbackType() { SimpleObject obj = new SimpleObject() { StringValue = "Hey" }; MutableDocument doc = obj.ToMutableDocument(); doc.SetString("$type", "not a type"); object newObject = doc.ToObject(typeof(SimpleObject)); }
public void TestCustomGlobalPropertyNameConverterToMutableDocument() { var simpleObject = new SimpleObject { StringValue = "Test Value" }; Settings.PropertyNameConverter = new CustomPropertyNameConverter(); var mutableDocument = simpleObject.ToMutableDocument(); var result = mutableDocument?.Keys.Contains("StringValue?"); Assert.True(result, "Property Name is not getting converted correctly."); }