Exemplo n.º 1
0
        public void Test_CreateWithValue_ClassDef_WithSuperClass()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            var value             = Guid.NewGuid();
            var inheritedClassDef = MyInheritedType.LoadInheritedTypeClassDef();
            //---------------Execute Test ----------------------
            var key = BOPrimaryKey.CreateWithValue((ClassDef)inheritedClassDef, value);

            //---------------Test Result -----------------------
            Assert.AreEqual(value.ToString(), key.ToString());
            //---------------Tear Down -------------------------
        }
Exemplo n.º 2
0
        public void Test_CreateWithValue_ClassDef_WriteNewProp()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            string              value               = TestUtil.GetRandomString();
            IClassDef           classDef            = ContactPersonTestBO.LoadClassDefWithSurnameAsPrimaryKey_WriteNew();
            ContactPersonTestBO contactPersonTestBO = new ContactPersonTestBO {
                Surname = value
            };
            object expectedID = contactPersonTestBO.ID;

            //---------------Execute Test ----------------------
            BOPrimaryKey key = BOPrimaryKey.CreateWithValue((ClassDef)classDef, value);

            //---------------Test Result -----------------------

            Assert.AreEqual(expectedID.ToString(), key.ToString());
            //---------------Tear Down -------------------------
        }
Exemplo n.º 3
0
        public void Test_CreateWithValue_ClassDef()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            int         value           = TestUtil.GetRandomInt();
            IClassDef   autoIncClassDef = BOWithIntID.LoadClassDefWithIntID();
            BOWithIntID bo = new BOWithIntID {
                TestField = "PropValue", IntID = value
            };
            object expectedID = bo.ID;

            //---------------Execute Test ----------------------
            BOPrimaryKey key = BOPrimaryKey.CreateWithValue((ClassDef)autoIncClassDef, value);

            //---------------Test Result -----------------------

            Assert.AreEqual(expectedID.ToString(), key.ToString());
            //---------------Tear Down -------------------------
        }