public void Test_ToString_WhenHasCompositePrimaryKey_AndValueSet_ShouldReturnGuidIdToString()
 {
     //---------------Set up test pack-------------------
     BOWithCompositePK.LoadClassDefs();
     var myBO = new BOWithCompositePK();
     //---------------Assert Precondition----------------
     Assert.IsNullOrEmpty(myBO.PK1Prop1);
     Assert.IsNullOrEmpty(myBO.PK1Prop2);
     //---------------Execute Test ----------------------
     string actualToString = myBO.ToString();
     //---------------Test Result -----------------------
     Assert.AreEqual(myBO.ID.GetAsGuid().ToString(), actualToString);
 }
Esempio n. 2
0
        public void Test_ToString_WhenHasCompositePrimaryKey_AndValueSet_ShouldReturnGuidIdToString()
        {
            //---------------Set up test pack-------------------
            BOWithCompositePK.LoadClassDefs();
            var myBO = new BOWithCompositePK();

            //---------------Assert Precondition----------------
            Assert.IsNullOrEmpty(myBO.PK1Prop1);
            Assert.IsNullOrEmpty(myBO.PK1Prop2);
            //---------------Execute Test ----------------------
            string actualToString = myBO.ToString();

            //---------------Test Result -----------------------
            Assert.AreEqual(myBO.ID.GetAsGuid().ToString(), actualToString);
        }
 public void Test_ToString_WhenHasCompositePrimaryKey_AndValueSet_ShouldReturnAggregateOfKeyProps()
 {
     //---------------Set up test pack-------------------
     BOWithCompositePK.LoadClassDefs();
     var myBO = new BOWithCompositePK();
     const string pk1Prop1Value = "somevalue";
     const string pk1Prop2Value = "anothervalue";
     myBO.PK1Prop1 = pk1Prop1Value;
     myBO.PK1Prop2 = pk1Prop2Value;
     //---------------Assert Precondition----------------
     Assert.IsNotNull(myBO.PK1Prop1);
     Assert.IsNotNull(myBO.PK1Prop2);
     //---------------Execute Test ----------------------
     string actualToString = myBO.ToString();
     //---------------Test Result -----------------------
     Assert.AreEqual(myBO.ID.ToString(), actualToString);
 }
Esempio n. 4
0
        public void Test_ToString_WhenHasCompositePrimaryKey_AndValueSet_ShouldReturnAggregateOfKeyProps()
        {
            //---------------Set up test pack-------------------
            BOWithCompositePK.LoadClassDefs();
            var          myBO          = new BOWithCompositePK();
            const string pk1Prop1Value = "somevalue";
            const string pk1Prop2Value = "anothervalue";

            myBO.PK1Prop1 = pk1Prop1Value;
            myBO.PK1Prop2 = pk1Prop2Value;
            //---------------Assert Precondition----------------
            Assert.IsNotNull(myBO.PK1Prop1);
            Assert.IsNotNull(myBO.PK1Prop2);
            //---------------Execute Test ----------------------
            string actualToString = myBO.ToString();

            //---------------Test Result -----------------------
            Assert.AreEqual(myBO.ID.ToString(), actualToString);
        }