Пример #1
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();
        }
Пример #2
0
        /// <summary>
        /// This is the base classes setup method.  It will be called by NUnit before each test.
        /// You should not have anything to do with it.
        /// </summary>
        public void SetUp()
        {
            verified = false;
            if (!SystemInformation.UserInteractive)
            {
                isUserInteractive.SetValue(null, true);
            }

            modal = new ModalFormTester();
        }
Пример #3
0
        public void init()
        {
            verified = false;

            if (!SystemInformation.UserInteractive)
            {
                isUserInteractive.SetValue(null, true);
            }

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

            modal    = new ModalFormTester();
            mouse    = new MouseController();
            keyboard = new KeyboardController(new OldSendKeysFactory());

            Setup();
        }
Пример #4
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();
	}
        public void PersonListView_ShowWarning_ShowsMessageBoxWithCorrectTitleAndMessage()
        {
            // Arrange
            string title = string.Empty;
            string message = string.Empty;
            ClientServiceLocator.PersonListPresenter = new FakePersonListPresenter();
            PersonListView view = new PersonListView();

            MessageBoxTester messageTester = null;

            ModalFormTester messageBoxTester = new ModalFormTester();
            messageBoxTester.ExpectModal("Test Title", new ModalFormActivated(delegate { messageTester = new MessageBoxTester("Test Title");
                                                                                            title = messageTester.Title;
                                                                                            message = messageTester.Text;
                                                                                            messageTester.ClickOk();
                                                                                            }));
            // Act
            view.ShowWarning("Test Title", "Test Message");

            // Assert
            Assert.IsTrue(messageBoxTester.Verify(), "MessageBox not shown");
            Assert.AreEqual("Test Title", title, "Title not correct");
            Assert.AreEqual("Test Message", message, "Message not correct");
        }
        private static void AbreArchivo(string elArchivo)
        {
            // Crea el camino absoluto al archivo.
              string archivoParaAbrir = Path.Combine(miDirectorioDeData, elArchivo);
              archivoParaAbrir = Path.GetFullPath(archivoParaAbrir);

              // Instala un manejador que espere por la ventana de abrir archivo.
              using (ModalFormTester probadorDeForma = new ModalFormTester())
              {
            probadorDeForma.ExpectModal("Open", delegate
              {
            OpenFileDialogTester formaAbrirArchivo = new OpenFileDialogTester("Open");

            // Manda a abrir el arhivo.
            // Por alguna razón desconocida, la llamada a OpenFile a veces no
            // funciona. Llamamos la misma función 10 veces para
            // asegurarnos que funciona.
            for (int i = 0; i < 10; ++i)
            {
              formaAbrirArchivo.OpenFile(archivoParaAbrir);
              Thread.Sleep(100);
            }
              }
            );

            // Selecciona el menú de abrir archivo.
            ToolStripMenuItemTester menuAbrirArchivo = new ToolStripMenuItemTester("miMenuAbrirArchivo");
            menuAbrirArchivo.Click();
              }
        }
Пример #7
0
		/// <summary>
		/// This is the base classes setup method.  It will be called by NUnit before each test.
		/// You should not have anything to do with it.
		/// </summary>
		public void SetUp()
		{
			verified = false;
			if (!SystemInformation.UserInteractive)
			{
				isUserInteractive.SetValue(null, true);
			}

			modal = new ModalFormTester();
		}