public void Test_CreateObjectManager()
        {
            //---------------Set up test pack-------------------

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
//            Assert.IsInstanceOf(typeof(BusinessObjectManager), boMan);
        }
Esempio n. 2
0
        public void Test_CreateObjectManager()
        {
            //---------------Set up test pack-------------------

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
//            Assert.IsInstanceOf(typeof(BusinessObjectManager), boMan);
        }
Esempio n. 3
0
        public void Test_Add_ObjectTwiceToObjectManagerDoesNothing()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO    cp    = new ContactPersonTestBO();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.Add(cp);
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 4
0
        public void Test_ContainsBusinessObject_ReturnsFalse()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO    originalContactPerson = new ContactPersonTestBO();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            bool containsOrigContactPerson = boMan.Contains(originalContactPerson);

            //---------------Test Result -----------------------
            Assert.IsFalse(containsOrigContactPerson);
        }
Esempio n. 5
0
        public void Test_RemoveBusinessObject_DoesNothing()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO    originalContactPerson = ContactPersonTestBO.CreateSavedContactPerson();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.Remove(originalContactPerson);
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 6
0
        public void Test_Find_NotFound()
        {
            //--------------- Set up test pack ------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            boMan.ClearLoadedObjects();
            ContactPersonTestBO.LoadDefaultClassDef();
            Criteria criteria = new Criteria("Surname", Criteria.ComparisonOp.Equals, TestUtil.GetRandomString());

            //--------------- Execute Test ----------------------
            IList <ContactPersonTestBO> found = boMan.Find <ContactPersonTestBO>(criteria);

            //--------------- Test Result -----------------------
            Assert.AreEqual(0, found.Count);
        }
Esempio n. 7
0
        public void Test_Contains_ByObjectID_False()
        {
            //--------------- Set up test pack ------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO    cp    = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            //--------------- Test Preconditions ----------------
            Assert.AreEqual(0, boMan.Count);
            //--------------- Execute Test ----------------------
            bool isContained = boMan.Contains(Guid.Empty);

            //--------------- Test Result -----------------------
            Assert.IsFalse(isContained);
        }
Esempio n. 8
0
        public void Test_AddedToObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO    cp    = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Add(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count, "The Business Object should not be added to the Object Manager");
        }
Esempio n. 9
0
        public void Test_FindFirst_OneMatch_ShouldReturnNull()
        {
            //--------------- Set up test pack ------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            boMan.ClearLoadedObjects();
            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO cp = new ContactPersonTestBO();
            string   surname       = cp.Surname = TestUtil.GetRandomString();
            Criteria criteria      = new Criteria("Surname", Criteria.ComparisonOp.Equals, surname);

            //--------------- Execute Test ----------------------
            IBusinessObject found = boMan.FindFirst <ContactPersonTestBO>(criteria);

            //--------------- Test Result -----------------------
            Assert.IsNull(found);
        }
Esempio n. 10
0
        public void Test_Find_NonGeneric_OneMatch()
        {
            //--------------- Set up test pack ------------------

            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO cp = new ContactPersonTestBO();
            string   surname       = cp.Surname = TestUtil.GetRandomString();
            Criteria criteria      = new Criteria("Surname", Criteria.ComparisonOp.Equals, surname);

            //--------------- Execute Test ----------------------
            IList found = boMan.Find(criteria, typeof(ContactPersonTestBO));

            //--------------- Test Result -----------------------
            Assert.AreEqual(0, found.Count);
        }
Esempio n. 11
0
        public void Test_ClearsBOManager_DoesNothing()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            new ContactPersonTestBO();
            new ContactPersonTestBO();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.ClearLoadedObjects();
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 12
0
        public void Test_ClearLoadedObjects()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO    cp    = new ContactPersonTestBO {
                Surname = TestUtil.GetRandomString()
            };

            boMan.Add(cp);
            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.ClearLoadedObjects();
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
            Assert.IsFalse(boMan.Contains(cp));
        }
Esempio n. 13
0
        public void Test_RemoveObjectFromObjectManagerTwice()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = CreateSavedCP();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Remove(cp);
            boMan.Remove(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 14
0
        public void Test_SavedObjectAddedToObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = new ContactPersonTestBO {
                Surname = TestUtil.GetRandomString()
            };

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            cp.Save();

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 15
0
        public void Test_AddSameObjectTwiceShouldNotCauseError()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO    cp    = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            cp.Surname = TestUtil.GetRandomString();
            boMan.Add(cp);

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Add(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
Esempio n. 16
0
        public void Test_SettingTheID_CopyOfSameObjectTwiceShould_DoesNotThrowError()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO    cp    = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            BORegistry.BusinessObjectManager = boMan;
            ContactPersonTestBO cp2 = new ContactPersonTestBO();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------

            cp2.ContactPersonID = cp.ContactPersonID;

            //---------------Test Result -----------------------
            Assert.IsTrue(true, "If gets here then OK");
        }
Esempio n. 17
0
        public void Test_ObjectManagerIndexers()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = new ContactPersonTestBO();

            boMan.Add(cp);

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            //IBusinessObject boFromObjMan_StringID = boMan[cp.ID.AsString_CurrentValue()];
            IBusinessObject boFromObjMan_StringID = boMan[cp.ID.ObjectID];

            IBusinessObject boFromMan_ObjectID = boMan[cp.ID];

            //---------------Test Result -----------------------
            Assert.IsNull(boFromObjMan_StringID);
            Assert.IsNull(boFromMan_ObjectID);
        }
 public void Test_Add_ObjectTwiceToObjectManagerDoesNothing()
 {
     //---------------Set up test pack-------------------
     ContactPersonTestBO.LoadDefaultClassDef();
     IBusinessObjectManager boMan = new BusinessObjectManagerNull();
     ContactPersonTestBO cp = new ContactPersonTestBO();
     //---------------Assert Precondition----------------
     Assert.AreEqual(0, boMan.Count);
     //---------------Execute Test ----------------------
     boMan.Add(cp);
     //---------------Test Result -----------------------
     Assert.AreEqual(0, boMan.Count);
 }
        public void Test_SettingTheID_CopyOfSameObjectTwiceShould_DoesNotThrowError()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            BORegistry.BusinessObjectManager = boMan;
            ContactPersonTestBO cp2 = new ContactPersonTestBO();
            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------

            cp2.ContactPersonID = cp.ContactPersonID;

            //---------------Test Result -----------------------
            Assert.IsTrue(true, "If gets here then OK");
        }
        public void Test_AddSameObjectTwiceShouldNotCauseError()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            cp.Surname = TestUtil.GetRandomString();
            boMan.Add(cp);

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Add(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
        public void Test_SavedObjectAddedToObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = new ContactPersonTestBO {Surname = TestUtil.GetRandomString()};

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            cp.Save();

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
        public void Test_Find_NonGeneric_NotFound()
        {
            //--------------- Set up test pack ------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            boMan.ClearLoadedObjects();
            ContactPersonTestBO.LoadDefaultClassDef();
            Criteria criteria = new Criteria("Surname", Criteria.ComparisonOp.Equals, TestUtil.GetRandomString());

            //--------------- Execute Test ----------------------
            //BusinessObjectCollection<ContactPersonTestBO> found = BORegistry.BusinessObjectManager.Find<ContactPersonTestBO>(criteria);
            IList found = boMan.Find(criteria, typeof(ContactPersonTestBO));

            //--------------- Test Result -----------------------
            Assert.AreEqual(0, found.Count);
        }
        public void Test_ClearsBOManager_DoesNothing()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            new ContactPersonTestBO();
            new ContactPersonTestBO();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.ClearLoadedObjects();
            //---------------Test Result ----------------------- 
            Assert.AreEqual(0, boMan.Count);
        }
 public void Test_ContainsBusinessObject_ReturnsFalse()
 {
     //---------------Set up test pack-------------------
     ContactPersonTestBO.LoadDefaultClassDef();
     IBusinessObjectManager boMan = new BusinessObjectManagerNull();
     ContactPersonTestBO originalContactPerson = new ContactPersonTestBO();
     //---------------Assert Precondition----------------
     Assert.AreEqual(0, boMan.Count);
     //---------------Execute Test ----------------------
     bool containsOrigContactPerson = boMan.Contains(originalContactPerson);
     //---------------Test Result -----------------------
     Assert.IsFalse(containsOrigContactPerson);
 }
        public void Test_RemoveBusinessObject_DoesNothing()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO originalContactPerson = ContactPersonTestBO.CreateSavedContactPerson();
            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);
            //---------------Execute Test ----------------------
            boMan.Remove(originalContactPerson);
            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
        public void Test_RemoveFromObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            ContactPersonTestBO cp = new ContactPersonTestBO {Surname = TestUtil.GetRandomString()};
            boMan.Add(cp);

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Remove(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
            Assert.IsFalse(boMan.Contains(cp));
        }
        public void Test_Find_OneMatch()
        {
            //--------------- Set up test pack ------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            boMan.ClearLoadedObjects();
            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO cp = new ContactPersonTestBO();
            string surname = cp.Surname = TestUtil.GetRandomString();
            Criteria criteria = new Criteria("Surname", Criteria.ComparisonOp.Equals, surname);

            //--------------- Execute Test ----------------------
            IList<ContactPersonTestBO> found = boMan.Find<ContactPersonTestBO>(criteria);

            //--------------- Test Result -----------------------
            Assert.AreEqual(0, found.Count);
        }
        public void Test_ObjectManagerIndexers()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            boMan.Add(cp);

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            //IBusinessObject boFromObjMan_StringID = boMan[cp.ID.AsString_CurrentValue()];
            IBusinessObject boFromObjMan_StringID = boMan[cp.ID.ObjectID];

            IBusinessObject boFromMan_ObjectID = boMan[cp.ID];

            //---------------Test Result -----------------------
            Assert.IsNull(boFromObjMan_StringID);
            Assert.IsNull(boFromMan_ObjectID);
        }
        public void Test_FindFirst_NonGeneric_OneMatch_ShouldReturnNull()
        {
            //--------------- Set up test pack ------------------
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            boMan.ClearLoadedObjects();
            ContactPersonTestBO.LoadDefaultClassDef();
            ContactPersonTestBO cp = new ContactPersonTestBO();
            string surname = cp.Surname = TestUtil.GetRandomString();
            Criteria criteria = new Criteria("Surname", Criteria.ComparisonOp.Equals, surname);

            //--------------- Execute Test ----------------------
            IBusinessObject found = boMan.FindFirst(criteria, typeof(ContactPersonTestBO));

            //--------------- Test Result -----------------------
//            Assert.AreEqual(1, found.Count);
            Assert.IsNull(found);
        }
        public void Test_RemoveObjectFromObjectManagerTwice()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();

            ContactPersonTestBO cp = CreateSavedCP();

            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Remove(cp);
            boMan.Remove(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count);
        }
        public void Test_AddedToObjectManager()
        {
            //---------------Set up test pack-------------------
            ContactPersonTestBO.LoadDefaultClassDef();

            ContactPersonTestBO cp = new ContactPersonTestBO();
            IBusinessObjectManager boMan = new BusinessObjectManagerNull();
            //---------------Assert Precondition----------------
            Assert.AreEqual(0, boMan.Count);

            //---------------Execute Test ----------------------
            boMan.Add(cp);

            //---------------Test Result -----------------------
            Assert.AreEqual(0, boMan.Count, "The Business Object should not be added to the Object Manager");
        }
 public void Test_Contains_ByObjectID_False()
 {
     //--------------- Set up test pack ------------------
     ContactPersonTestBO.LoadDefaultClassDef();
     ContactPersonTestBO cp = new ContactPersonTestBO();
     IBusinessObjectManager boMan = new BusinessObjectManagerNull();
     //--------------- Test Preconditions ----------------
     Assert.AreEqual(0, boMan.Count);
     //--------------- Execute Test ----------------------
     bool isContained = boMan.Contains(Guid.Empty);
     //--------------- Test Result -----------------------
     Assert.IsFalse(isContained);
 }