public void IgnoreProperty_WhenFieldDoesntExist_ThrowsError() { SerializerSettings context = new SerializerSettings(); ITypeData handler = context.Type <SimpleObject>(); handler.IgnoreProperty("Foo"); }
public void IgnoreProperty_DoesNotDeleteField() { SerializerSettings context = new SerializerSettings(); ITypeData handler = context.Type <SimpleObject>(); foreach (IPropertyData prop in handler.AllProperties) { ; // force properties to load } handler.IgnoreProperty("IntValue"); bool found = false; foreach (IPropertyData prop in handler.AllProperties) { if (prop.Name == "IntValue") { found = true; } } Assert.IsTrue(found, "Ignored property deleted"); }