Example #1
0
        public void TestGetTabPage()
        {
            //---------------Set up test pack-------------------

            MyBO.LoadDefaultClassDef();
            ITabControl            tabControl      = GetControlFactory().CreateTabControl();
            BOColTabControlManager colTabCtlMapper = new BOColTabControlManager(tabControl, GetControlFactory());
            IBusinessObjectControl busControl      = this.CreateBusinessObjectControl();

            colTabCtlMapper.BusinessObjectControl = busControl;
            //---------------Execute Test ----------------------
            BusinessObjectCollection <MyBO> myBoCol = new BusinessObjectCollection <MyBO>();
            MyBO testBo = new MyBO();

            myBoCol.Add(new MyBO());
            myBoCol.Add(new MyBO());
            myBoCol.Add(testBo);
            colTabCtlMapper.BusinessObjectCollection = myBoCol;
            //---------------Test Result -----------------------
            Assert.AreSame(colTabCtlMapper.TabControl.TabPages[2], colTabCtlMapper.GetTabPage(testBo));
            //---------------Tear down -------------------------
        }
 /// <summary>
 /// Returns the TabPage object that is representing the given
 /// business object
 /// </summary>
 /// <param name="bo">The business object being represented</param>
 /// <returns>Returns the TabPage object, or null if not found</returns>
 public ITabPage GetTabPage(IBusinessObject bo)
 {
     return(BOColTabControlManager.GetTabPage(bo));
 }