Exemplo n.º 1
0
        public void Test_AsString_CurrentValue_TwoPropKey()
        {
            //--------------- Set up test pack ------------------
            BOPrimaryKey primaryKey = CreatePrimaryBOKeyGuidAndString();
            Guid         guid       = Guid.NewGuid();

            //--------------- Test Preconditions ----------------

            //--------------- Execute Test ----------------------
            primaryKey.SetObjectGuidID(guid);
            string keyAsString = primaryKey.AsString_CurrentValue();

            //--------------- Test Result -----------------------
            StringAssert.AreEqualIgnoringCase(guid.ToString(), keyAsString);
        }
Exemplo n.º 2
0
        public void Test_AsString_CurrentValue_SetValue()
        {
            //--------------- Set up test pack ------------------
            BOPrimaryKey primaryKey = CreateBOPrimaryKeyString();
            Guid         guid       = Guid.NewGuid();
            string       str        = TestUtil.GetRandomString();

            //--------------- Test Preconditions ----------------

            //--------------- Execute Test ----------------------
            primaryKey.SetObjectGuidID(guid);
            primaryKey[0].Value = str;
            string keyAsString = primaryKey.AsString_CurrentValue();

            //--------------- Test Result -----------------------
            StringAssert.AreEqualIgnoringCase("ContactPersonTestBO.PropName1=" + str, keyAsString);
        }
Exemplo n.º 3
0
        public void Test_AsString_CurrentValue_SetValue()
        {
            //--------------- Set up test pack ------------------
            BOPrimaryKey primaryKey   = CreateBOObjectID();
            Guid         originalGuid = Guid.NewGuid();
            Guid         newGuid      = Guid.NewGuid();

            //--------------- Test Preconditions ----------------

            //--------------- Execute Test ----------------------
            primaryKey.SetObjectGuidID(originalGuid);
            primaryKey[0].Value = newGuid;
            string keyAsString = primaryKey.AsString_CurrentValue();

            //--------------- Test Result -----------------------
            StringAssert.AreEqualIgnoringCase(newGuid.ToString(), keyAsString);
        }
Exemplo n.º 4
0
        public void Test_AsString_CurrentValue_TwoPropKey_SetTwoProp()
        {
            //--------------- Set up test pack ------------------
            BOPrimaryKey primaryKey = CreatePrimaryBOKeyGuidAndString();
            Guid         guid       = Guid.NewGuid();

            primaryKey.SetObjectGuidID(guid);
            primaryKey[0].Value = Guid.NewGuid();
            primaryKey[1].Value = TestUtil.GetRandomString();
            //--------------- Test Preconditions ----------------

            //--------------- Execute Test ----------------------
            string keyAsString = primaryKey.AsString_CurrentValue();

            //--------------- Test Result -----------------------
            Assert.AreNotEqual(guid.ToString(), keyAsString);
            Assert.AreEqual("ContactPersonTestBO.PropName1=" + primaryKey[0].Value + ";ContactPersonTestBO.PropName2=" + primaryKey[1].Value, keyAsString);
        }
Exemplo n.º 5
0
        public void Test_AsString_PreviousValue_TwoPropKey_ResetOneProp()
        {
            //--------------- Set up test pack ------------------
            BOPrimaryKey primaryKey = CreatePrimaryBOKeyGuidAndString();
            Guid         guid       = Guid.NewGuid();

            primaryKey.SetObjectGuidID(guid);
            primaryKey[0].Value = Guid.NewGuid();
            primaryKey[1].Value = TestUtil.GetRandomString();
            string origKeyAsString = primaryKey.AsString_CurrentValue();

            //--------------- Test Preconditions ----------------

            //--------------- Execute Test ----------------------
            primaryKey[1].Value = TestUtil.GetRandomString();
            string keyAsString = primaryKey.AsString_PreviousValue();

            //--------------- Test Result -----------------------
            Assert.AreNotEqual(guid.ToString(), keyAsString);
            Assert.AreEqual(origKeyAsString, keyAsString);
        }