public void Test_ToString_WhenHasStringPKProp_AndValueSet_ShouldReturnTheSingleValueAsAToString() { //---------------Set up test pack------------------- BOWithStringPKProp.LoadClassDefs(); var myBO = new BOWithStringPKProp(); const string pk1Prop1Value = "somevalue"; myBO.PK1Prop1 = pk1Prop1Value; //---------------Assert Precondition---------------- Assert.IsNotNull(myBO.PK1Prop1); //---------------Execute Test ---------------------- string actualToString = myBO.ToString(); //---------------Test Result ----------------------- Assert.AreEqual(pk1Prop1Value, actualToString); }
public void Test_ToString_WhenHasStringPKProp_AndValueSet_ShouldReturnGuidIDToString() { //---------------Set up test pack------------------- BOWithStringPKProp.LoadClassDefs(); var myBO = new BOWithStringPKProp(); //---------------Assert Precondition---------------- Assert.IsNullOrEmpty(myBO.PK1Prop1); //---------------Execute Test ---------------------- string actualToString = myBO.ToString(); //---------------Test Result ----------------------- Assert.AreEqual(myBO.ID.GetAsGuid().ToString(), actualToString); }