示例#1
0
        public void NonGenericLoadProperty()
        {
            var root = new EditableGetSet();

            root.LoadM02(123);
            Assert.AreEqual(123, root.M02);

            root.LoadInternalAndPrivate("Test");
            Assert.AreEqual("Test", root.M08);

            var cmd = new Command();

            cmd.Load("abc");
            Assert.AreEqual("abc", cmd.Name);

            var ro = new ReadOnly();

            ro.Load("abc");
            Assert.AreEqual("abc", ro.Name);
        }
示例#2
0
        public void NonGenericLoadProperty()
        {
            IDataPortal <EditableGetSet> dataPortal = _testDIContext.CreateDataPortal <EditableGetSet>();

            EditableGetSet root = EditableGetSet.GetObject(dataPortal);

            root.LoadM02(123);
            Assert.AreEqual(123, root.M02);

            root.LoadInternalAndPrivate("Test");
            Assert.AreEqual("Test", root.M08);

            IDataPortal <Command> commandDataPortal = _testDIContext.CreateDataPortal <Command>();
            var cmd = commandDataPortal.Create();

            cmd.Load("abc");
            Assert.AreEqual("abc", cmd.Name);

            IDataPortal <ReadOnly> roDataPortal = _testDIContext.CreateDataPortal <ReadOnly>();
            var ro = roDataPortal.Fetch();

            ro.Load("abc");
            Assert.AreEqual("abc", ro.Name);
        }