public void TestGetBo() { //---------------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(testBo); myBoCol.Add(new MyBO()); colTabCtlMapper.BusinessObjectCollection = myBoCol; //---------------Test Result ----------------------- Assert.AreSame(testBo, colTabCtlMapper.GetBo(colTabCtlMapper.TabControl.TabPages[1])); //---------------Tear down ------------------------- }
/// <summary> /// Returns the business object represented in the specified tab page /// </summary> /// <param name="tabPage">The tab page</param> /// <returns>Returns the business object, or null if not available /// </returns> public IBusinessObject GetBo(ITabPage tabPage) { return(BOColTabControlManager.GetBo(tabPage)); }