public void Test_ObjectID_NotSet() { //--------------- Set up test pack ------------------ //--------------- Test Preconditions ---------------- //--------------- Execute Test ---------------------- BOObjectID primaryKey = CreateBOObjectID(); //--------------- Test Result ----------------------- Assert.AreEqual(Guid.Empty, primaryKey.ObjectID); }
public void Test_EqualsOp_LeftNull() { //--------------- Set up test pack ------------------ BOObjectID id1 = null; BOObjectID id2 = CreateBOObjectID(); //--------------- Execute Test ---------------------- bool result = id1 == id2; //--------------- Test Result ----------------------- Assert.IsFalse(result); }
public void Test_EqualsOp() { //--------------- Set up test pack ------------------ BOObjectID id1 = null; BOObjectID id2 = null; //--------------- Execute Test ---------------------- bool result = id1 == id2; //--------------- Test Result ----------------------- Assert.IsTrue(result); }
public void Test_ObjectID_SetObjectGuidID() { //--------------- Set up test pack ------------------ BOObjectID primaryKey = CreateBOObjectID(); Guid id = Guid.NewGuid(); //--------------- Test Preconditions ---------------- Assert.AreEqual(Guid.Empty, primaryKey.ObjectID); //--------------- Execute Test ---------------------- primaryKey.SetObjectGuidID(id); //--------------- Test Result ----------------------- Assert.AreEqual(id, primaryKey.ObjectID); }
public void Test_EqualsOp_NotEqual() { //--------------- Set up test pack ------------------ BOObjectID id1 = CreateBOObjectID(); BOObjectID id2 = CreateBOObjectID(); id1[0].Value = Guid.NewGuid(); id2[0].Value = Guid.NewGuid(); //--------------- Execute Test ---------------------- bool result = id1 == id2; //--------------- Test Result ----------------------- Assert.IsFalse(result); }
public void Test_ObjectID_EqualsIdPropValue() { //--------------- Set up test pack ------------------ BOObjectID primaryKey = CreateBOObjectID(); Guid id = Guid.NewGuid(); IBOProp keyProp = primaryKey[0]; //--------------- Test Preconditions ---------------- Assert.AreEqual(Guid.Empty, primaryKey.ObjectID); //--------------- Execute Test ---------------------- keyProp.Value = id; //--------------- Test Result ----------------------- Assert.AreEqual(id, keyProp.Value); Assert.AreEqual(id, primaryKey.ObjectID); }
public void Test_SetObjectID_SetsThePreviousObjectID() { //--------------- Set up test pack ------------------ BOObjectID primaryKey = CreateBOObjectID(); Guid id = Guid.NewGuid(); //--------------- Test Preconditions ---------------- Assert.AreEqual(Guid.Empty, primaryKey.ObjectID); Assert.AreEqual(Guid.Empty, primaryKey.PreviousObjectID); //--------------- Execute Test ---------------------- primaryKey.SetObjectGuidID(id); //--------------- Test Result ----------------------- IBOProp iboProp = primaryKey[0]; Assert.AreEqual(id, primaryKey.ObjectID); Assert.AreEqual(id, iboProp.Value); Assert.AreEqual(id, primaryKey.PreviousObjectID); }
public void Test_ObjectID_ResetObjectIDProperty() { //--------------- Set up test pack ------------------ BOObjectID primaryKey = CreateBOObjectID(); Guid id = Guid.NewGuid(); primaryKey.SetObjectGuidID(id); IBOProp iboProp = primaryKey[0]; Guid newID = Guid.NewGuid(); //--------------- Test Preconditions ---------------- Assert.AreEqual(id, primaryKey.ObjectID); Assert.AreEqual(id, iboProp.Value); Assert.AreEqual(id, primaryKey.PreviousObjectID); //--------------- Execute Test ---------------------- iboProp.Value = newID; //--------------- Test Result ----------------------- Assert.AreEqual(id, primaryKey.PreviousObjectID); Assert.AreEqual(newID, iboProp.Value); Assert.AreEqual(newID, primaryKey.ObjectID); }
public void Test_ObjectID_SetObjectGuidID_Twice() { //--------------- Set up test pack ------------------ BOObjectID primaryKey = CreateBOObjectID(); Guid id = Guid.NewGuid(); primaryKey.SetObjectGuidID(id); //--------------- Test Preconditions ---------------- Assert.AreEqual(id, primaryKey.ObjectID); //--------------- Execute Test ---------------------- try { primaryKey.SetObjectGuidID(Guid.NewGuid()); //--------------- Test Result ----------------------- Assert.Fail("InvalidObjectIdException expected"); } catch (InvalidObjectIdException ex) { Assert.AreEqual("The ObjectGuidID has already been set for this object.", ex.Message); Assert.AreEqual(id, primaryKey.ObjectID); } }