protected void Page_Load(object sender, EventArgs e) { _presenter = new VitalsPresenter(this, Data); if (!Page.IsPostBack) { _presenter.Initialize(); } }
public void DropDownList_Value_Is_Not_Valid() { var view = new MockVitalsView(); var presenter = new VitalsPresenter(view); view.EmployeeId = ""; Assert.IsFalse(presenter.IsValidEmployeeId()); }
public void EmployeeGridList_Has_Data() { IVitalsView view = new MockVitalsView(); IEmployeeData data = new MockEmployeeData(); var presenter = new VitalsPresenter(view, data); Assert.IsTrue(presenter.GetEmployeeGridList().Count > 0); }
public void Display_Message_When_No_User_Is_Selected_In_Dropdown() { var view = new MockVitalsView(); var presenter = new VitalsPresenter(view); view.EmployeeId = string.Empty; presenter.RefreshGridView(); Assert.AreEqual(view.ErrorMessage, VitalsPresenter.ERROR_MESSAGE_BAD_EMPLOYEE_ID); }
public void Name_And_SSN_Data_Are_Valid() { var view = new MockVitalsView(); var presenter = new VitalsPresenter(view); view.Name = "John Doe"; view.SSN = "123-45-6789"; Assert.IsTrue(presenter.OnOk()); }
public void Initialize_View() { var view = new MockVitalsView(); IEmployeeData data = new MockEmployeeData(); var presenter = new VitalsPresenter(view, data); presenter.Initialize(); Assert.Greater(presenter.GetEmployeeGridList().Count, 1); }
public void Display_No_Message_When_User_Is_Selected_In_Dropdown() { var view = new MockVitalsView(); IEmployeeData data = new MockEmployeeData(); var presenter = new VitalsPresenter(view, data); view.EmployeeId = "1"; presenter.RefreshGridView(); Assert.AreEqual(view.ErrorMessage, string.Empty); }
public void Search_EmployeeList_By_Id_Returns_Charles_Smith() { IVitalsView view = new MockVitalsView(); IEmployeeData data = new MockEmployeeData(); var presenter = new VitalsPresenter(view, data); List <Employee> emp = presenter.GetEmployeeGridListById(2); string fullName = string.Empty; foreach (var item in emp) { fullName = item.FullName; } Assert.AreEqual("Smith, Charles", fullName); }