public void StaticFailure_FillDropDownWithObjects() { ComboBox oComboBox = null; var res = ComboBoxHelper.FillDropDownWithObjects(ref oComboBox, null); Assert.IsFalse(res.Success, "Call to FillDropDownWithObject with Null combobox and list should fail"); List <CallHandler> oHandlers = new List <CallHandler>(); res = ComboBoxHelper.FillDropDownWithObjects(ref oComboBox, oHandlers); Assert.IsFalse(res.Success, "Call to FillDropDownWithObject with Null combobox should fail"); oComboBox = new ComboBox(); res = ComboBoxHelper.FillDropDownWithObjects(ref oComboBox, oHandlers); Assert.IsFalse(res.Success, "Call to FillDropDownWithObject with empty list should fail"); }
public void GetComboBoxSelection_Success() { oComboBox = new ComboBox(); oComboBox.Items.Add("test"); List <CallHandler> oHandlers = new List <CallHandler>(); CallHandler oHandler = new CallHandler(_mockServer); oHandler.DisplayName = "bbb"; oHandlers.Add(oHandler); oHandler = new CallHandler(_mockServer); oHandler.DisplayName = "aaa"; oHandlers.Add(oHandler); var res = ComboBoxHelper.FillDropDownWithObjects(ref oComboBox, oHandlers); Assert.IsTrue(res.Success, "Failed to fill comboBox with handlers:" + res); ComboBoxHelper.GetCurrentComboBoxSelection(oComboBox, out oHandler); Assert.IsNotNull(oHandlers, "Null call handler returned from fetch"); //Assert.IsTrue(!string.IsNullOrEmpty(oHandler.ObjectId),"Empty call handler returned from fetch"); }