예제 #1
0
        public void TestNullableAfterEditCycle()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            NullableObject nullRoot = NullableObject.NewNullableObject();

            nullRoot.NullableInteger    = null;
            nullRoot._nullableIntMember = null;

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = 45;
            nullRoot._nullableIntMember = 32;
            nullRoot.ApplyEdit();

            Assert.AreEqual(45, nullRoot.NullableInteger);
            Assert.AreEqual(32, nullRoot._nullableIntMember);

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = null;
            nullRoot._nullableIntMember = null;
            nullRoot.ApplyEdit();

            Assert.AreEqual(null, nullRoot.NullableInteger);
            Assert.AreEqual(null, nullRoot._nullableIntMember);

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = 444;
            nullRoot._nullableIntMember = 222;
            nullRoot.CancelEdit();

            Assert.AreEqual(null, nullRoot.NullableInteger);
            Assert.AreEqual(null, nullRoot._nullableIntMember);
        }
예제 #2
0
        public void TestNullableAfterEditCycle()
        {
            IDataPortal <NullableObject> dataPortal = _testDIContext.CreateDataPortal <NullableObject>();

            TestResults.Reinitialise();
            NullableObject nullRoot = NullableObject.NewNullableObject(dataPortal);

            nullRoot.NullableInteger    = null;
            nullRoot._nullableIntMember = null;

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = 45;
            nullRoot._nullableIntMember = 32;
            nullRoot.ApplyEdit();

            Assert.AreEqual(45, nullRoot.NullableInteger);
            Assert.AreEqual(32, nullRoot._nullableIntMember);

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = null;
            nullRoot._nullableIntMember = null;
            nullRoot.ApplyEdit();

            Assert.AreEqual(null, nullRoot.NullableInteger);
            Assert.AreEqual(null, nullRoot._nullableIntMember);

            nullRoot.BeginEdit();
            nullRoot.NullableInteger    = 444;
            nullRoot._nullableIntMember = 222;
            nullRoot.CancelEdit();

            Assert.AreEqual(null, nullRoot.NullableInteger);
            Assert.AreEqual(null, nullRoot._nullableIntMember);
        }
예제 #3
0
        public void TestNullableField()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            NullableObject nullRoot = NullableObject.NewNullableObject();

            nullRoot._nullableIntMember = null;
            Assert.AreEqual(null, nullRoot._nullableIntMember);
        }
예제 #4
0
        public void TestNullableProperty()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            NullableObject nullRoot = NullableObject.NewNullableObject();

            nullRoot.NullableInteger = null;
            nullRoot.Name            = null;
            Assert.AreEqual(null, nullRoot.Name);
            Assert.AreEqual(null, nullRoot.NullableInteger);
        }
예제 #5
0
        public void TestNullableField()
        {
            IDataPortal <NullableObject> dataPortal = _testDIContext.CreateDataPortal <NullableObject>();

            TestResults.Reinitialise();
            NullableObject nullRoot = NullableObject.NewNullableObject(dataPortal);

            nullRoot._nullableIntMember = null;
            Assert.AreEqual(null, nullRoot._nullableIntMember);
        }
예제 #6
0
        public void TestNullableAfterClone()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            NullableObject nullRoot = NullableObject.NewNullableObject();

            nullRoot._nullableIntMember = null;
            nullRoot.NullableInteger    = null;
            NullableObject nullRoot2 = nullRoot.Clone();

            Assert.AreEqual(null, nullRoot2._nullableIntMember);
            Assert.AreEqual(null, nullRoot2.NullableInteger);
        }