Beispiel #1
0
        public override void Setup() {
            base.Setup();

            m_usernameTextbox = new TextBoxTester("m_usernameTextbox");
	    m_connectButton = new ButtonTester("m_connectButton");
	    m_disconnectbutton = new ButtonTester("m_disconnectbutton");
	    m_sendMsgButton = new ButtonTester("m_sendMsgButton");
	    m_sendMsgAsyncButton = new ButtonTester("m_sendMsgAsyncButton");
            m_connectedLabel = new LabelTester("m_constatus");
            m_messageTextbox = new TextBoxTester("m_messageTextbox");
            m_messagesTester = new ListBoxTester("m_messages");
            m_client = new Client("localhost", 8087, 0);
            m_chatform = m_client.CreateChatForm();
            m_chatform.Show();
            m_usernameTextbox.Enter("test");
	    m_connectButton.Click();
        }
        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 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();
        }
Beispiel #4
0
		public void NewProjectShowsMultipleWritingSystems()
		{
			_window.CreateAndOpenProject(_projectFolder);

			ClickToolStripButton("_writingSystemButton");
			//GotoProjectTab("_writingSystemPage");
			ListBoxTester c = new ListBoxTester("_wsListBox", _window);
			Assert.Greater(c.Properties.Items.Count, 2);
		}