Exemple #1
0
        public void MinimizedRestoresAsNormal()
        {
            // Establish Baseline - create registry entries
            Rectangle rectOrig;

            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();
                rectOrig         = form.DesktopBounds;
                form.WindowState = FormWindowState.Minimized;
                form.Close();
            }

            // Test that Minimized Window Comes Back As Normal
            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();
                FormWindowState state  = form.WindowState;
                Rectangle       rcForm = form.DesktopBounds;
                form.Close();

                Assert.AreEqual(FormWindowState.Normal, state);
                Assert.AreEqual(rectOrig, rcForm);
            }
        }
Exemple #2
0
        public void LastWindowClosedIsPersisted()
        {
            // Open two forms with different sizes/positions
            DummyPersistedFormWinDef form1 = new DummyPersistedFormWinDef();

            form1.Show();
            form1.SetDesktopBounds(205, 106, 407, 308);

            DummyPersistedFormWinDef form2 = new DummyPersistedFormWinDef();

            form2.Show();
            form2.SetDesktopBounds(101, 52, 301, 401);
            Rectangle rectCompare = form2.DesktopBounds;

            form2.WindowState = FormWindowState.Maximized;
            form1.Close();
            form2.Close();

            // Test that restored window has size/pos of Last Window Closed
            DummyPersistedFormWinDef form = new DummyPersistedFormWinDef();

            form.Show();
            FormWindowState state = form.WindowState;

            form.WindowState = FormWindowState.Normal;
            Rectangle rcForm = form.DesktopBounds;

            form.Close();

            Assert.AreEqual(FormWindowState.Maximized, state);
            Assert.AreEqual(rectCompare, rcForm);
        }
Exemple #3
0
        public void DefaultStartPositionNormal()
        {
            // Establish baseline - make registry entries
            Rectangle rectOrig;

            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();
                form.SetDesktopBounds(40, 50, 110, 98);
                rectOrig = form.DesktopBounds;
                form.Close();
            }

            // Verify measurements in new window with registry entries
            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();

                FormWindowState state  = form.WindowState;
                Rectangle       rcForm = form.DesktopBounds;
                form.Close();

                Assert.AreEqual(FormWindowState.Normal, state);
                Assert.AreEqual(rectOrig, rcForm);
            }
        }
Exemple #4
0
        public void DefaultStartPositionMaximized()
        {
            // Establish baseline - make registry entries
            DummyPersistedFormWinDef form = new DummyPersistedFormWinDef();

            form.Show();
            form.SetDesktopBounds(48, 58, 118, 95);
            Rectangle rectOrig = form.DesktopBounds;

            form.WindowState = FormWindowState.Maximized;
            form.Close();

            // Verify measurements in new window with registry entries
            form = new DummyPersistedFormWinDef();
            form.Show();

            FormWindowState state = form.WindowState;

            // Restore to normal state, verify that we have original size
            form.WindowState = FormWindowState.Normal;
            Rectangle rcForm = form.DesktopBounds;

            form.Close();

            Assert.AreEqual(FormWindowState.Maximized, state);
            Assert.AreEqual(rectOrig, rcForm);
        }
Exemple #5
0
        public void DefaultStartPositionMaximized()
        {
            // Establish baseline - make registry entries
            Rectangle rectOrig;

            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();
                form.SetDesktopBounds(48, 58, 118, 95);
                rectOrig         = form.DesktopBounds;
                form.WindowState = FormWindowState.Maximized;
                form.Close();
            }

            // Verify measurements in new window with registry entries
            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();

                FormWindowState state = form.WindowState;

                // Restore to normal state, verify that we have original size
                form.WindowState = FormWindowState.Normal;
                Rectangle rcForm = form.DesktopBounds;
                form.Close();

                // TODO-Linux: probably fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 re-enable this when this has been fixed
                if (!Platform.IsMono)
                {
                    Assert.AreEqual(FormWindowState.Maximized, state);
                }
                Assert.AreEqual(rectOrig, rcForm);
            }
        }
Exemple #6
0
        public void MaximizedKeepsNormal()
        {
            // Create new window and change the size and location
            using (var form = new DummyPersistedFormWinDef())
            {
                form.SetDesktopBounds(47, 31, 613, 317);
                form.Show();
                Rectangle rectOrig = form.DesktopBounds;
                // maximize the window
                form.WindowState = FormWindowState.Maximized;
                Rectangle rectNew = form.PersistenceObject.NormalStateDesktopBounds;
                form.Close();

                // Test that normal desktop bounds are still saved in the persistance object
                Assert.AreEqual(rectOrig, rectNew, "Maximized keeps normal");
            }
        }
Exemple #7
0
        public void LastWindowClosedIsPersisted()
        {
            // Open two forms with different sizes/positions
            Rectangle rectCompare;

            using (var form1 = new DummyPersistedFormWinDef())
            {
                form1.Show();
                form1.SetDesktopBounds(205, 106, 407, 308);

                using (var form2 = new DummyPersistedFormWinDef())
                {
                    form2.Show();
                    form2.SetDesktopBounds(101, 52, 301, 401);
                    rectCompare       = form2.DesktopBounds;
                    form2.WindowState = FormWindowState.Maximized;
                    form1.Close();
                    form2.Close();
                }
            }

            // Test that restored window has size/pos of Last Window Closed
            using (var form = new DummyPersistedFormWinDef())
            {
                form.Show();
#if !__MonoCS__
                FormWindowState state = form.WindowState;
#endif
                form.WindowState = FormWindowState.Normal;
                Rectangle rcForm = form.DesktopBounds;
                form.Close();
#if !__MonoCS__
                Assert.AreEqual(FormWindowState.Maximized, state);
#else
                // TODO-Linux: proberbly fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 renable this when this has been fixed
#endif
                Assert.AreEqual(rectCompare, rcForm);
            }
        }
		public void MaximizedKeepsNormal()
		{
			// Create new window and change the size and location
			using (var form = new DummyPersistedFormWinDef())
			{
				form.SetDesktopBounds(47, 31, 613, 317);
				form.Show();
				Rectangle rectOrig = form.DesktopBounds;
				// maximize the window
				form.WindowState = FormWindowState.Maximized;
				Rectangle rectNew = form.PersistenceObject.NormalStateDesktopBounds;
				form.Close();

				// Test that normal desktop bounds are still saved in the persistance object
				Assert.AreEqual(rectOrig, rectNew, "Maximized keeps normal");
			}
		}
		public void LastWindowClosedIsPersisted()
		{
			// Open two forms with different sizes/positions
			Rectangle rectCompare;
			using (var form1 = new DummyPersistedFormWinDef())
			{
				form1.Show();
				form1.SetDesktopBounds(205, 106, 407, 308);

				using (var form2 = new DummyPersistedFormWinDef())
				{
					form2.Show();
					form2.SetDesktopBounds(101, 52, 301, 401);
					rectCompare = form2.DesktopBounds;
					form2.WindowState = FormWindowState.Maximized;
					form1.Close();
					form2.Close();
				}
			}

			// Test that restored window has size/pos of Last Window Closed
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();
#if !__MonoCS__
				FormWindowState state = form.WindowState;
#endif
				form.WindowState = FormWindowState.Normal;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();
#if !__MonoCS__
				Assert.AreEqual(FormWindowState.Maximized, state);
#else
				// TODO-Linux: proberbly fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 renable this when this has been fixed
#endif
				Assert.AreEqual(rectCompare, rcForm);
			}
		}
Exemple #10
0
		public void MinimizedRestoresAsNormal()
		{
			// Establish Baseline - create registry entries
			Rectangle rectOrig;
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();
				rectOrig = form.DesktopBounds;
				form.WindowState = FormWindowState.Minimized;
				form.Close();
			}

			// Test that Minimized Window Comes Back As Normal
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();
				FormWindowState state = form.WindowState;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();

				Assert.AreEqual(FormWindowState.Normal, state);
				Assert.AreEqual(rectOrig, rcForm);
			}
		}
Exemple #11
0
		public void DefaultStartPositionMaximized()
		{
			// Establish baseline - make registry entries
			Rectangle rectOrig;
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();
				form.SetDesktopBounds(48, 58, 118, 95);
				rectOrig = form.DesktopBounds;
				form.WindowState = FormWindowState.Maximized;
				form.Close();
			}

			// Verify measurements in new window with registry entries
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();

#if !__MonoCS__
				FormWindowState state = form.WindowState;
#endif

				// Restore to normal state, verify that we have original size
				form.WindowState = FormWindowState.Normal;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();

#if !__MonoCS__
				Assert.AreEqual(FormWindowState.Maximized, state);
#else
				// TODO-Linux: proberbly fails because of this bug https://bugzilla.novell.com/show_bug.cgi?id=495562 renable this when this has been fixed
#endif
				Assert.AreEqual(rectOrig, rcForm);
			}
		}
Exemple #12
0
		public void DefaultStartPositionNormal()
		{
			// Establish baseline - make registry entries
			Rectangle rectOrig;
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();
				form.SetDesktopBounds(40, 50, 110, 98);
				rectOrig = form.DesktopBounds;
				form.Close();
			}

			// Verify measurements in new window with registry entries
			using (var form = new DummyPersistedFormWinDef())
			{
				form.Show();

				FormWindowState state = form.WindowState;
				Rectangle rcForm = form.DesktopBounds;
				form.Close();

				Assert.AreEqual(FormWindowState.Normal, state);
				Assert.AreEqual(rectOrig, rcForm);
			}
		}
Exemple #13
0
		public void LastWindowClosedIsPersisted()
		{
			// Open two forms with different sizes/positions
			DummyPersistedFormWinDef form1 = new DummyPersistedFormWinDef();
			form1.Show();
			form1.SetDesktopBounds(205, 106, 407, 308);

			DummyPersistedFormWinDef form2 = new DummyPersistedFormWinDef();
			form2.Show();
			form2.SetDesktopBounds(101, 52, 301, 401);
			Rectangle rectCompare = form2.DesktopBounds;
			form2.WindowState = FormWindowState.Maximized;
			form1.Close();
			form2.Close();

			// Test that restored window has size/pos of Last Window Closed
			DummyPersistedFormWinDef form = new DummyPersistedFormWinDef();
			form.Show();
			FormWindowState state = form.WindowState;
			form.WindowState = FormWindowState.Normal;
			Rectangle rcForm = form.DesktopBounds;
			form.Close();

			Assert.AreEqual(FormWindowState.Maximized, state);
			Assert.AreEqual(rectCompare, rcForm);
		}
Exemple #14
0
		public void DefaultStartPositionMaximized()
		{
			// Establish baseline - make registry entries
			DummyPersistedFormWinDef form = new DummyPersistedFormWinDef();
			form.Show();
			form.SetDesktopBounds(48, 58, 118, 95);
			Rectangle rectOrig = form.DesktopBounds;
			form.WindowState = FormWindowState.Maximized;
			form.Close();

			// Verify measurements in new window with registry entries
			form = new DummyPersistedFormWinDef();
			form.Show();

			FormWindowState state = form.WindowState;

			// Restore to normal state, verify that we have original size
			form.WindowState = FormWindowState.Normal;
			Rectangle rcForm = form.DesktopBounds;
			form.Close();

			Assert.AreEqual(FormWindowState.Maximized, state);
			Assert.AreEqual(rectOrig, rcForm);
		}