Esempio n. 1
0
        public void TestSetNullOnDateTimeProperty()
        {
            Property prop = new Property();

            prop.DateTime = DateTime.Now;

            // Property accessor
            datetimeSetAccessor.Set(prop, null);
            Assert.AreEqual(DateTime.MinValue, prop.DateTime);
        }
Esempio n. 2
0
        public void TestSetNullOnDecimalProperty()
        {
            Property prop = new Property();

            prop.Decimal = 45.187M;

            // Property accessor
            decimalSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0M, prop.Decimal);
        }
Esempio n. 3
0
        public void TestSetNullOnLongProperty()
        {
            Property prop = new Property();

            prop.Long = 78945566664213223;

            // Property accessor
            longSetAccessor.Set(prop, null);
            Assert.AreEqual((long)0, prop.Long);
        }
Esempio n. 4
0
        public void TestSetNullOnStringProperty()
        {
            Property prop = new Property();

            prop.String = "abc";

            // Property accessor
            stringSetAccessor.Set(prop, null);
            Assert.IsNull(prop.String);
        }
Esempio n. 5
0
        public void TestSetNullOnNullableIntProperty()
        {
            Property prop = new Property();

            prop.IntNullable = 85;

            // Property accessor
            nullableSetAccessor.Set(prop, null);
            Assert.AreEqual(null, prop.IntNullable);
        }
Esempio n. 6
0
        public void TestSetNullOnIntegerProperty()
        {
            Property prop = new Property();

            prop.Int = -99;

            // Property accessor
            intSetAccessor.Set(prop, null);
            Assert.AreEqual(0, prop.Int);
        }
Esempio n. 7
0
        public void TestSetNullOnGuidField()
        {
            Property prop = new Property();

            prop.publicGuid = Guid.NewGuid();

            // Property accessor
            guidSetAccessor.Set(prop, null);
            Assert.AreEqual(Guid.Empty, prop.publicGuid);
        }
Esempio n. 8
0
        public void TestSetNullOnShortProperty()
        {
            Property prop = new Property();

            prop.Short = 5;

            // Property accessor
            shortSetAccessor.Set(prop, null);
            Assert.AreEqual((short)0, prop.Short);
        }
Esempio n. 9
0
        public void TestSetNullOnDoubleField()
        {
            Property prop = new Property();

            prop.publicDouble = 788956.56D;

            // Property accessor
            doubleSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0D, prop.publicDouble);
        }
Esempio n. 10
0
        public void TestSetNullOnFloatField()
        {
            Property prop = new Property();

            prop.publicFloat = 565.45F;

            // Property accessor
            floatSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0D, prop.publicFloat);
        }
Esempio n. 11
0
        public void TestSetNullOnBoolField()
        {
            Property prop = new Property();

            prop.publicBool = true;

            // Property accessor
            boolSetAccessor.Set(prop, null);
            Assert.AreEqual(false, prop.publicBool);
        }
Esempio n. 12
0
        public void TestSetNullOnULongField()
        {
            Property prop = new Property();

            prop.publicUlong = 5L;

            // Property accessor
            ulongSetAccessor.Set(prop, null);
            Assert.AreEqual((ulong)0, prop.publicUlong);
        }
Esempio n. 13
0
        public void TestSetNullOnUIntField()
        {
            Property prop = new Property();

            prop.publicUint = 5;

            // Property accessor
            uintSetAccessor.Set(prop, null);
            Assert.AreEqual((uint)0, prop.publicUint);
        }
Esempio n. 14
0
        public void TestSetNullOnUShortField()
        {
            Property prop = new Property();

            prop.publicUshort = 5;

            // Property accessor
            ushortSetAccessor.Set(prop, null);
            Assert.AreEqual((ushort)0, prop.publicUshort);
        }
Esempio n. 15
0
        public void TestSetNullOnTimeSpanField()
        {
            Property prop = new Property();

            prop.publicTimeSpan = new TimeSpan(5, 12, 57, 21, 13);

            // Property accessor
            timespanSetAccessor.Set(prop, null);
            Assert.AreEqual(new TimeSpan(0, 0, 0), prop.publicTimeSpan);
        }
Esempio n. 16
0
        public void TestSetNullOnCharProperty()
        {
            Property prop = new Property();

            prop.Char = 'r';

            // Property accessor
            charSetAccessor.Set(prop, null);
            Assert.AreEqual('\0', prop.Char);
        }
Esempio n. 17
0
        public void TestSetNullOnByteProperty()
        {
            Property prop = new Property();

            prop.Byte = 78;

            // Property accessor
            byteSetAccessor.Set(prop, null);
            Assert.AreEqual((byte)0, prop.Byte);
        }
Esempio n. 18
0
        public void TestSetNullOnSbyteField()
        {
            Property prop = new Property();

            prop.publicSbyte = 78;

            // Property accessor
            sbyteSetAccessor.Set(prop, null);
            Assert.AreEqual((sbyte)0, prop.publicSbyte);
        }
Esempio n. 19
0
        public void TestSetNullOnAccountField()
        {
            Property prop = new Property();

            prop.publicAccount           = new Account();
            prop.publicAccount.FirstName = "test";

            // Property accessor
            accountSetAccessor.Set(prop, null);
            Assert.AreEqual(null, prop.publicAccount);
        }
Esempio n. 20
0
        public void TestSetNullOnGuidField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedGuid");

            fieldInfo.SetValue(prop, Guid.NewGuid());

            // Property accessor
            guidSetAccessor.Set(prop, null);
            Assert.AreEqual(Guid.Empty, fieldInfo.GetValue(prop));
        }
Esempio n. 21
0
        public void TestSetNullOnTimeSpanField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedTimeSpan");

            fieldInfo.SetValue(prop, new TimeSpan(5, 12, 57, 21, 13));

            // Property accessor
            timespanSetAccessor.Set(prop, null);
            Assert.AreEqual(new TimeSpan(0, 0, 0), fieldInfo.GetValue(prop));
        }
Esempio n. 22
0
        public void TestSetNullOnDoubleField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedDouble");

            fieldInfo.SetValue(prop, 788956.56D);

            // Property accessor
            doubleSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0D, fieldInfo.GetValue(prop));
        }
Esempio n. 23
0
        public void TestSetNullOnFloatField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedFloat");

            fieldInfo.SetValue(prop, 565.45F);

            // Property accessor
            floatSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0D, fieldInfo.GetValue(prop));
        }
Esempio n. 24
0
        public void TestSetNullOnULongField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedUlong");

            fieldInfo.SetValue(prop, (UInt64)5L);

            // Property accessor
            ulongSetAccessor.Set(prop, null);
            Assert.AreEqual((ulong)0, fieldInfo.GetValue(prop));
        }
Esempio n. 25
0
        public void TestSetNullOnBoolField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedBool");

            fieldInfo.SetValue(prop, true);

            // Property accessor
            boolSetAccessor.Set(prop, null);
            Assert.AreEqual(false, fieldInfo.GetValue(prop));
        }
Esempio n. 26
0
        public void TestSetNullOnUIntField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedUint");

            fieldInfo.SetValue(prop, (UInt32)5);

            // Property accessor
            uintSetAccessor.Set(prop, null);
            Assert.AreEqual((uint)0, fieldInfo.GetValue(prop));
        }
Esempio n. 27
0
        public void TestSetNullOnShortField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedShort");

            fieldInfo.SetValue(prop, (short)5);

            // Property accessor
            shortSetAccessor.Set(prop, null);
            Assert.AreEqual((short)0, fieldInfo.GetValue(prop));
        }
Esempio n. 28
0
        public void TestSetNullOnCharField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedChar");

            fieldInfo.SetValue(prop, 'r');

            // Property accessor
            charSetAccessor.Set(prop, null);
            Assert.AreEqual('\0', fieldInfo.GetValue(prop));
        }
Esempio n. 29
0
        public void TestSetNullOnByteField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedByte");

            fieldInfo.SetValue(prop, (Byte)78);

            // Property accessor
            byteSetAccessor.Set(prop, null);
            Assert.AreEqual((byte)0, fieldInfo.GetValue(prop));
        }
Esempio n. 30
0
        public void TestSetNullOnDecimalField()
        {
            Property  prop      = new Property();
            FieldInfo fieldInfo = GetFieldInfo("protectedDecimal");

            fieldInfo.SetValue(prop, 45.187M);

            // Property accessor
            decimalSetAccessor.Set(prop, null);
            Assert.AreEqual(0.0M, fieldInfo.GetValue(prop));
        }