Beispiel #1
0
        public void Test_SetDisplayPropertyValue_WhenLookupList_ShouldSetUnderlyingValue()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            const string propertyName = "TestProp2";
            const string expectedLookupDisplayValue = "s1";
            Guid         expectedLookupValue;

            StringUtilities.GuidTryParse("{E6E8DC44-59EA-4e24-8D53-4A43DC2F25E7}", out expectedLookupValue);
            _itsClassDef = MyBO.LoadClassDefWithLookup();
            MyBO     bo1      = (MyBO)_itsClassDef.CreateNewBusinessObject();
            BOMapper boMapper = new BOMapper(bo1);

            //---------------Assert Precondition----------------
            Assert.IsNullOrEmpty(bo1.TestProp2);
            //---------------Execute Test ----------------------
            boMapper.SetDisplayPropertyValue(propertyName, expectedLookupDisplayValue);
            //---------------Test Result -----------------------
            Assert.AreEqual(expectedLookupValue, bo1.GetPropertyValue(propertyName));
            Assert.AreEqual(expectedLookupDisplayValue, bo1.GetPropertyValueToDisplay(propertyName));
        }