Esempio n. 1
0
        public void ShouldSerializeTest_Null_Default()
        {
            PropertyDescriptor           p    = TypeDescriptor.GetProperties(typeof(ShouldSerialize_Null_Default)) ["Prop"];
            ShouldSerialize_Null_Default test = new ShouldSerialize_Null_Default();

            Assert.IsFalse(p.ShouldSerializeValue(test), "#1");
            test.SerializeProp = true;
            Assert.IsFalse(p.ShouldSerializeValue(test), "#2");
            test.Prop = "whatever";
            Assert.IsTrue(p.ShouldSerializeValue(test), "#3");
            test.SerializeProp = false;
            Assert.IsTrue(p.ShouldSerializeValue(test), "#4");
        }
Esempio n. 2
0
		public void ShouldSerializeTest_Null_Default ()
		{
			PropertyDescriptor p = TypeDescriptor.GetProperties (typeof (ShouldSerialize_Null_Default)) ["Prop"];
			ShouldSerialize_Null_Default test = new ShouldSerialize_Null_Default ();

			Assert.IsFalse (p.ShouldSerializeValue (test), "#1");
			test.SerializeProp = true;
			Assert.IsFalse (p.ShouldSerializeValue (test), "#2");
			test.Prop = "whatever";
			Assert.IsTrue (p.ShouldSerializeValue (test), "#3");
			test.SerializeProp = false;
			Assert.IsTrue (p.ShouldSerializeValue (test), "#4");
		}