Example #1
0
 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]);
 }
Example #2
0
 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]);
 }
Example #3
0
	public void init()
	{
	  verified = false;
	  if (!SystemInformation.UserInteractive)
	  {
		  if (isUserInteractive != null) // is named something else on Mono
		  {
			  isUserInteractive.SetValue(null, true);
		  }
	  }

	  if (UseHidden)
	  {
		testDesktop = new Desktop("NUnitForms Test Desktop", DisplayHidden);
	  }

	  modal = new ModalFormTester();

	  BaseSetup();

	  mouse = new MouseController();
	  keyboard = new KeyboardController();

	  if (CurrentForm != null)
	  {
		currentForm.Show();
	  }
	  Setup();
	}
Example #4
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);
		}