private IControlMapper AddControlMapper(Type controlMapperType, IControlHabanero controlHabanero,
                                                string propName)
        {
            var controlMapper = ControlMapper.Create(controlMapperType, controlHabanero, propName, false,
                                                     GlobalUIRegistry.ControlFactory);

            return(AddMapper(controlMapper));
        }
Beispiel #2
0
        public void Test_AutoLoadingMapper_WhenCreateFromControlMapper_ShouldSetupCollection()
        {
            //---------------Set up test pack-------------------
            var cmbox         = _controlFactory.CreateComboBox();
            var controlMapper = ControlMapper.Create
                                    ("AutoLoadingRelationshipComboBoxMapper", "Habanero.Faces.Base", cmbox, "ContactPersonTestBO", false,
                                    GetControlFactory());

            var person1 = ContactPersonTestBO.CreateSavedContactPerson();
            var person2 = ContactPersonTestBO.CreateSavedContactPerson();

            var addressTestBo = new AddressTestBO();

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

            //---------------Execute Test ----------------------
            controlMapper.BusinessObject = addressTestBo;
            //---------------Test Result -----------------------
            Assert.AreEqual(3, cmbox.Items.Count);
            Assert.IsTrue(cmbox.Items.Contains(person1));
            Assert.IsTrue(cmbox.Items.Contains(person2));
        }
 private static IControlMapper CreateMapper(IControlHabanero checkBoxControl, string propName)
 {
     return(ControlMapper.Create(checkBoxControl, propName));
 }