public void PersonListView_GetSelectedListItems_ReturnsCorrectPerson()
        {
            // Arrange
            PersonListView view = new PersonListView();

            List<Person> personList = new List<Person>();
            personList.Add(PersonObjectMother.GetPerson(TestPeople.Bill));
            personList.Add(PersonObjectMother.GetPerson(TestPeople.Ted));
            personList.Add(PersonObjectMother.GetPerson(TestPeople.Sue));

            ListBoxTester listTester = new ListBoxTester("lbxPeople");

            //Act
            view.SetPersonList(personList);
            view.Show();

            // select second person in listbox
            listTester.SetSelected(1, true);

            // Assert
            Assert.AreEqual(personList[1], view.GetSelectedListItem(), "Correct person not returned");

            // Cleanup
            view.Close();
        }
        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();
        }