Exemplo n.º 1
0
		public void CanFindOutTheExecutableNameOfAProcess()
		{
			using (var app = new GivenAnApp("GoToWindow.CanFindOutTheExecutableNameOfAProcess"))
			{
				Assert.AreEqual(app.Process.GetExecutablePath(), app.Executable);
			}
		}
		public void CanGetAListOfActiveWindows_VerifyTestProcess()
		{
			using (var app = new GivenAnApp("GoToWindow.CanGetAListOfActiveWindows_VerifyTestProcess"))
			{
				var windowsList = WindowsListFactory.Load();
				var windows = windowsList.Windows;

				AssertExists(windows, app.ExpectedWindow);
			}
		}
Exemplo n.º 3
0
        public void CanGetAListOfActiveWindows_VerifyTestProcess()
        {
            using (var app = new GivenAnApp("GoToWindow.CanGetAListOfActiveWindows_VerifyTestProcess"))
            {
                var windowsList = WindowsListFactory.Load();
                var windows     = windowsList.Windows;

                AssertExists(windows, app.ExpectedWindow);
            }
        }
Exemplo n.º 4
0
        public void GetGetWindowEntry_FromTestWindow()
        {
            using (var app = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow"))
            {
                var expectedWindowHandle = app.Process.MainWindowHandle;
                var window = WindowEntryFactory.Create(expectedWindowHandle);

                Assert.AreEqual(expectedWindowHandle, window.HWnd);
                Assert.AreEqual((uint)app.Process.Id, window.ProcessId);
                Assert.AreEqual(app.ExpectedWindow.Title, window.Title);
                Assert.AreNotEqual(IntPtr.Zero, window.IconHandle);
                Assert.IsNull(window.ProcessName);
            }
        }
		public void GetGetWindowEntry_FromTestWindow()
		{
			using (var app = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow"))
			{
				var expectedWindowHandle = app.Process.MainWindowHandle;
				var window = WindowEntryFactory.Create(expectedWindowHandle);

				Assert.AreEqual(expectedWindowHandle, window.HWnd);
				Assert.AreEqual((uint)app.Process.Id, window.ProcessId);
				Assert.AreEqual(app.ExpectedWindow.Title, window.Title);
				Assert.AreNotEqual(IntPtr.Zero, window.IconHandle);
				Assert.IsNull(window.ProcessName);
			}
		}
Exemplo n.º 6
0
        public void CanGiveFocusToAWindow()
        {
            using (var app1 = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow1"))
            {
                var window1 = WindowEntryFactory.Create(app1.Process.MainWindowHandle);

                using (var app2 = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow2"))
                {
                    var window2 = WindowEntryFactory.Create(app2.Process.MainWindowHandle);

                    Assert.IsFalse(window1.IsForeground());
                    Assert.IsTrue(window2.IsForeground());

                    window1.Focus();

                    Assert.IsTrue(window1.IsForeground());
                }
            }

            Assert.IsTrue(true, "This test just ensures the code doesn't crash");
        }
		public void CanGiveFocusToAWindow()
		{
			using (var app1 = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow1"))
			{
				var window1 = WindowEntryFactory.Create(app1.Process.MainWindowHandle);

				using (var app2 = new GivenAnApp("GoToWindow.GetGetWindowEntry_FromTestWindow2"))
				{
					var window2 = WindowEntryFactory.Create(app2.Process.MainWindowHandle);

					Assert.IsFalse(window1.IsForeground());
					Assert.IsTrue(window2.IsForeground());

					window1.Focus();

					Assert.IsTrue(window1.IsForeground());
				}
				
			}

			Assert.IsTrue(true, "This test just ensures the code doesn't crash");
		}