A ControlTester for testing List Views.
It includes helper methods for selecting items from the list and for clearing those selections.
Inheritance: NUnit.Extensions.Forms.ControlTester
コード例 #1
0
 public void SelectingThemePageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Theme");
     ButtonTester buttonTester = new ButtonTester("btnThemeNew", _optionsForm);
     Assert.That(buttonTester.Text, Does.Match("New"));
 }
コード例 #2
0
 public void SelectingStartupExitPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Startup/Exit");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkSaveConsOnExit", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Save connections"));
 }
コード例 #3
0
 public void SelectingAdvancedPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Advanced");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkWriteLogFile", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Write log file"));
 }
コード例 #4
0
 public void SelectingUpdatesPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Updates");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkCheckForUpdatesOnStartup", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Check for updates"));
 }
コード例 #5
0
 public void SelectingSQLPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("SQL Server");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkUseSQLServer", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Use SQL"));
 }
コード例 #6
0
 public void SelectingTabsPanelPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Tabs & Panels");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkAlwaysShowPanelTabs", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Always show panel tabs"));
 }
コード例 #7
0
 public void SelectingConnectionsPageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Connections");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkSingleClickOnConnectionOpensIt", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("Single click on connection"));
 }
コード例 #8
0
 public void SelectingAppearancePageLoadsSettings()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     listViewTester.Select("Appearance");
     CheckBoxTester checkboxTester = new CheckBoxTester("chkShowSystemTrayIcon", _optionsForm);
     Assert.That(checkboxTester.Text, Does.Match("show notification area icon"));
 }
コード例 #9
0
ファイル: WeSayListViewTests.cs プロジェクト: bbriggs/wesay
 public void DoubleClickOnWhiteSpaceToRightOfEntry_EntryAlreadySelected_EntryStaysSelected()
 {
     ListViewTester l = new ListViewTester("_listView", _window);
     using (MouseController mc = new MouseController(l))
     {
         Rectangle r = l.Properties.GetItemRect(0);
         mc.Click(r.Right + 1, r.Top + 1);
         // move enough to not confuse click with double-click
         mc.DoubleClick(r.Right + SystemInformation.DoubleClickSize.Width + 2, r.Top + 1);
     }
     Assert.AreEqual(1, l.Properties.SelectedIndices.Count);
     Assert.AreEqual(0, l.Properties.SelectedIndices[0]);
 }
コード例 #10
0
ファイル: WeSayListViewTests.cs プロジェクト: bbriggs/wesay
 public void ClickOnWhiteSpaceToRightOfEntry_ThenKeyboardNavigate_CorrectEntrySelected()
 {
     ListViewTester l = new ListViewTester("_listView", _window);
     using (MouseController mc = new MouseController(l))
     {
         using (KeyboardController kc = new KeyboardController(l))
         {
             l.Select(0);
             Rectangle r = l.Properties.GetItemRect(1);
             mc.Click(r.Right + 1, r.Top + 1);
             kc.Press("{DOWN}");
             kc.Release("{DOWN}");
         }
     }
     Assert.AreEqual(2, l.Properties.SelectedIndices[0]);
 }
コード例 #11
0
 public void ThemeIconShownInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[6].ImageList, Is.Not.Null);
 }
コード例 #12
0
		public void ClickOnWhiteSpaceToRightOfEntry_EntryAlreadySelected_DeleteButtonStaysEnabled()
		{
			ListViewTester l = new ListViewTester("_recordsListBox", _window);
			ButtonTester b = new ButtonTester("_btnDeleteWord", _window);
			using (MouseController mc = new MouseController(l))
			{
				Rectangle r = l.Properties.GetItemRect(0);
				mc.Click(r.Right + 1, r.Top + 1);
				// move enough to not count as a double-click
				mc.Click(r.Right + SystemInformation.DoubleClickSize.Width + 2, r.Top + 1);
			}
			Assert.IsTrue(b.Properties.Enabled);
		}
コード例 #13
0
 public void TabsPanelPageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[2].Text, Does.Match("Tabs & Panels"));
 }
コード例 #14
0
		private void GoToLexicalEntryUseFind(string lexemeForm)
		{
			TextBoxTester t = new TextBoxTester("_findText", _window);
			t.Enter(lexemeForm);
			t.FireEvent("KeyDown", new KeyEventArgs(Keys.Enter));
			ListViewTester l = new ListViewTester("_recordsListBox", _window);
			string label = GetSelectedLabel((WeSayListView) l.Properties);
			Assert.AreEqual(lexemeForm, label);
		}
コード例 #15
0
 public void SQLPageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[4].Text, Does.Match("SQL Server"));
 }
コード例 #16
0
 public void AdvancedPageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[7].Text, Does.Match("Advanced"));
 }
コード例 #17
0
		private void AssertExistenceOfEntryInList(string form, bool shouldExist)
		{
			ListViewTester l = new ListViewTester("_recordsListBox", _window);
			bool found = false;

			for (int i = 0;i < l.Properties.Items.Count;++i)
			{
				if (l.Properties.Items[i].ToString() == form)
				{
					found = true;
					break;
				}
			}
			Assert.AreEqual(shouldExist, found);
		}
コード例 #18
0
		public void DeletingLastWordSelectsPreviousWordInList()
		{
			ListViewTester t = new ListViewTester("_recordsListBox", _window);
			((WeSayListView) t.Properties).SelectedIndex = 2;
			Assert.AreEqual("Tertiary", LexemeFormOfSelectedEntry);
			ClickDeleteWord();
			Assert.AreEqual("Secondary", LexemeFormOfSelectedEntry);
		}
コード例 #19
0
 public void UpdatesPageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[5].Text, Does.Match("Updates"));
 }
コード例 #20
0
 public void ConnectionsPageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[3].Text, Does.Match("Connections"));
 }
コード例 #21
0
		private void PutCursorInMeaningFieldOfSecondEntry()
		{
			//skip to second word (first has extra stuff in the sense)
			ListViewTester t = new ListViewTester("_recordsListBox", _window);
			t.Properties.Focus();
			((WeSayListView) t.Properties).SelectedIndex = 1;
			Assert.AreEqual("Secondary", LexemeFormOfSelectedEntry);
			Assert.AreEqual(1,
							GetCurrentEntry().Senses.Count,
							"this test assumes an entry with 1 sense");
			Assert.AreEqual(0,
							GetCurrentEntry().Senses[0].ExampleSentences.Count,
							"this test assumes a sense w/ no example");
			MultiTextControl editControl = GetEditControl("Meaning 1");
			editControl.TextBoxes[0].Focus();
		}
コード例 #22
0
		public void EmptyDictionary_AddWords_NewWordSelectedInListBox()
		{
			DeleteAllEntries();
			ClickAddWord();
			ListViewTester t = new ListViewTester("_recordsListBox", _window);
			Assert.AreEqual(0, ((WeSayListView) t.Properties).SelectedIndex);
			string label = GetSelectedLabel((WeSayListView) t.Properties);
			Assert.AreEqual("(Empty)", label);
		}
コード例 #23
0
		public void FindText_EnterTextThenPressFindButton_Finds()
		{
			TextBoxTester t = new TextBoxTester("_findText", _window);
			t.Enter("Secondary");
			ClickFindButton();
			ListViewTester l = new ListViewTester("_recordsListBox", _window);

			string label = GetSelectedLabel((WeSayListView) l.Properties);
			Assert.AreEqual("Secondary", label);
			RichTextBoxTester r = new RichTextBoxTester("_lexicalEntryPreview", _window);
			Assert.IsTrue(r.Text.Contains("secondarymeaning"));
		}
コード例 #24
0
		public void EmptyDictionary_EnterText_PressFindButton_NoCrash()
		{
			StartWithEmpty();
			TextBoxTester t = new TextBoxTester("_findText", _window);
			t.Enter("blah");
			ButtonTester b = new ButtonTester("_btnFind", _window);
			b.Click();
			ListViewTester l = new ListViewTester("_recordsListBox", _window);

			Assert.AreEqual(-1, ((WeSayListView) l.Properties).SelectedIndex);
		}
コード例 #25
0
		public void NewWord_DictionaryContainsWordEmpty_ContainsBlankAndEmpty()
		{
			//review: I (jh) find this test confusing.  if "empty" is a special word, can
			//someone add a comment explaining it?  Else, why not just use, like, "hello"?

			Application.DoEvents();
			StartWithEmpty();
			ClickAddWord();
			Application.DoEvents();
			var form = "hello";// "(Empty)";
			TypeInLexicalForm(form);
			Application.DoEvents();
			ClickAddWord();
			Application.DoEvents();
			Assert.AreEqual(2, _lexEntryRepository.CountAllItems());
			LexicalFormMustMatch(string.Empty);
			ListViewTester l = new ListViewTester("_recordsListBox", _window);
			// select other entry
			l.Select((l.Properties.SelectedIndices[0] + 1) % 2);
			LexicalFormMustMatch(form);
		}
コード例 #26
0
		public void EmptyDictionary_AddWordsTwice_OneWordExists()
		{
			ListViewTester l = new ListViewTester("_recordsListBox", _window);
			StartWithEmpty();
			ClickAddWord();
			Assert.AreEqual(1, l.Properties.Items.Count);
			ClickAddWord();
			Assert.AreEqual(1, l.Properties.Items.Count);
		}
コード例 #27
0
		public void FindText_Enter_Finds()
		{
			TextBoxTester t = new TextBoxTester("_findText", _window);
			t.Enter("Secondary");
			t.FireEvent("KeyDown", new KeyEventArgs(Keys.Enter));
			ListViewTester l = new ListViewTester("_recordsListBox", _window);

			string label = GetSelectedLabel((WeSayListView) l.Properties);
			Assert.AreEqual("Secondary", label);
		}
コード例 #28
0
 public void ListViewContainsOptionsPages()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items.Count, Is.EqualTo(8));
 }
コード例 #29
0
 public void ThemePageLinkExistsInListView()
 {
     ListViewTester listViewTester = new ListViewTester("PageListView", _optionsForm);
     Assert.That(listViewTester.Items[6].Text, Does.Match("Theme"));
 }
コード例 #30
0
		private void VerifySelectedWordIs(string word)
		{
			ListViewTester l = new ListViewTester("_recordsListBox", this._window);

			string label = GetSelectedLabel((WeSayListView) l.Properties);
			Assert.AreEqual(word, label);
		}