public void SetupTest()
 {
     ClassDef.ClassDefs.Clear();
     SetupDataAccessor();
     DeleteAllContactPeople();
     FixtureEnvironment.ClearBusinessObjectManager();
     ContactPersonTestBO.CreateSampleData();
     ContactPersonTestBO.LoadDefaultClassDef();
     FixtureEnvironment.ClearBusinessObjectManager();
     TestUtil.WaitForGC();
     SuperClass.LoadClassDef();
     SubClass.LoadClassDef();
 }
예제 #2
0
        public void Test_GetPropertyValueToDisplay_BusinessObjectLookupList_NotInList()
        {
            ContactPersonTestBO.DeleteAllContactPeople();
            ContactPersonTestBO.CreateSampleData();
            ClassDef.ClassDefs.Clear();
            IClassDef classDef = MyBO.LoadClassDefWithBOLookup("Surname <> abc");

            ContactPersonTestBO.LoadDefaultClassDef();

            Criteria            criteria = new Criteria("Surname", Criteria.ComparisonOp.Equals, "abc");
            ContactPersonTestBO cp       = BORegistry.DataAccessor.BusinessObjectLoader.GetBusinessObject <ContactPersonTestBO>(criteria);
            BusinessObject      bo       = (BusinessObject)classDef.CreateNewBusinessObject();

            bo.SetPropertyValue("TestProp2", cp);
            Assert.AreEqual(cp.ContactPersonID, bo.GetPropertyValue("TestProp2"));
            Assert.IsNotNull(bo.GetPropertyValueToDisplay("TestProp2"));
            Assert.AreEqual("abc", bo.GetPropertyValueToDisplay("TestProp2").ToString());
        }