public void PersonListView_SetPersonList_DisplaysCorrectPeople() { // Arrange FakePersonListPresenter presenter = new FakePersonListPresenter(); ClientServiceLocator.PersonListPresenter = presenter; PersonListView view = new PersonListView(); List <Person> personList = new List <Person>(); personList.Add(PersonObjectMother.GetPerson(TestPeople.Bill)); personList.Add(PersonObjectMother.GetPerson(TestPeople.Ted)); view.Show(); ListBoxTester listTester = new ListBoxTester("lbxPeople"); //Act view.SetPersonList(personList); // Assert Assert.AreEqual(2, listTester.Properties.Items.Count, "Incorretc number of people in ListBox"); Assert.Contains(personList[0], listTester.Properties.Items, "Person 0 not found in list"); Assert.Contains(personList[1], listTester.Properties.Items, "Person 1 not found in list"); // Cleanup view.Close(); }
public void ClientServiceLocator_GetPersonListPresenter_ReturnsCorrectObject() { //Arrange FakePersonListPresenter presenter = new FakePersonListPresenter(); //Act ClientServiceLocator.PersonListPresenter = presenter; //Assert Assert.AreSame(presenter, ClientServiceLocator.PersonListPresenter, "Presenter not set properly"); }
public void ClientServiceLocator_GetPersonListPresenter_ReturnsCorrectObject() { //Arrange FakePersonListPresenter presenter = new FakePersonListPresenter(); //Act ClientServiceLocator.PersonListPresenter = presenter; //Assert Assert.AreSame(presenter, ClientServiceLocator.PersonListPresenter, "Presenter not set properly"); }
public void PersonListView_SetPersonList_DisplaysCorrectPeople() { // Arrange FakePersonListPresenter presenter = new FakePersonListPresenter(); ClientServiceLocator.PersonListPresenter = presenter; PersonListView view = new PersonListView(); List<Person> personList = new List<Person>(); personList.Add(PersonObjectMother.GetPerson(TestPeople.Bill)); personList.Add(PersonObjectMother.GetPerson(TestPeople.Ted)); view.Show(); ListBoxTester listTester = new ListBoxTester("lbxPeople"); //Act view.SetPersonList(personList); // Assert Assert.AreEqual(2, listTester.Properties.Items.Count, "Incorretc number of people in ListBox"); Assert.Contains(personList[0], listTester.Properties.Items, "Person 0 not found in list"); Assert.Contains(personList[1], listTester.Properties.Items, "Person 1 not found in list"); // Cleanup view.Close(); }