Ejemplo n.º 1
0
        public void IgnoreProperty_WhenFieldDoesntExist_ThrowsError()
        {
            SerializerSettings context = new SerializerSettings();
            ITypeData          handler = context.Type <SimpleObject>();

            handler.IgnoreProperty("Foo");
        }
Ejemplo n.º 2
0
        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");
        }