public void Test_GetBusinessObject_WithPrimaryKey_WhenNotExistsWhenComposite_ShouldRetNull_FixBug533() { //--------------- Set up test pack ------------------ var businessObjectManager = new BusinessObjectManager(); BORegistry.BusinessObjectManager = businessObjectManager; ContactPersonCompositeKey.LoadClassDefs(); var cp = CreateCompositeCP(); var otherBOMan = new BusinessObjectManager(); //----------------Assert Preconditions--------------- Assert.IsNotNull(cp.ID); Assert.IsFalse(otherBOMan.Contains(cp.ID)); //--------------- Execute Test ---------------------- var found = otherBOMan.GetBusinessObject(cp.ID); //--------------- Test Result ----------------------- Assert.IsNull(found); }
public void Test_GetBusinessObject_WithPrimaryKey_WhenNotExists_ShouldRetNull_FixBug533() { //--------------- Set up test pack ------------------ var businessObjectManager = new BusinessObjectManager(); BORegistry.BusinessObjectManager = businessObjectManager; SetupDefaultContactPersonBO(); var cp = new ContactPersonTestBO(); var otherBOMan = new BusinessObjectManager(); //----------------Assert Preconditions--------------- Assert.IsFalse(otherBOMan.Contains(cp.ID)); //--------------- Execute Test ---------------------- var found = otherBOMan.GetBusinessObject(cp.ID); //--------------- Test Result ----------------------- Assert.IsNull(found); }
public void Test_GetBusinessObject_WithPrimaryKey_WhenExistsWhenComposite_ShouldRetObject_FixBug533() { //--------------- Set up test pack ------------------ var businessObjectManager = new BusinessObjectManager(); BORegistry.BusinessObjectManager = businessObjectManager; ContactPersonCompositeKey.LoadClassDefs(); var expectedFound = CreateCompositeCP(); //----------------Assert Preconditions--------------- Assert.IsNotNull(expectedFound.ID); Assert.IsNotNull(((BOPrimaryKey)expectedFound.ID).BusinessObject); Assert.IsTrue(businessObjectManager.Contains(expectedFound.ID)); //--------------- Execute Test ---------------------- var found = businessObjectManager.GetBusinessObject(expectedFound.ID); //--------------- Test Result ----------------------- Assert.AreSame(expectedFound, found); }
public void Test_GetBusinessObject_WithPrimaryKey_WhenExists_ShouldRetObject_FixBug533() { //--------------- Set up test pack ------------------ var businessObjectManager = new BusinessObjectManager(); BORegistry.BusinessObjectManager = businessObjectManager; SetupDefaultContactPersonBO(); var expectedFound = new ContactPersonTestBO(); //----------------Assert Preconditions--------------- Assert.IsTrue( businessObjectManager.Contains(expectedFound.ID)); //--------------- Execute Test ---------------------- var found = businessObjectManager.GetBusinessObject(expectedFound.ID); //--------------- Test Result ----------------------- Assert.AreSame(expectedFound, found); }