Пример #1
0
		public void Basic_Null()
		{
			using (var dialog = new NavPaneOptionsDlg(null))
			{
				dialog.Show();
				Assert.IsNotNull(dialog);
			}
		}
Пример #2
0
 public void Basic_Null()
 {
     using (var dialog = new NavPaneOptionsDlg(null))
     {
         dialog.Show();
         Assert.IsNotNull(dialog);
     }
 }
Пример #3
0
 public void CannotMoveTabBeyondLimit_Down()
 {
     using (var dialog = new NavPaneOptionsDlg(_tabs))
     {
         dialog.Show();
         dialog.tabListBox.SetSelected(2, true);                 // select bottom-most tab
         Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled");
     }
 }
Пример #4
0
 /// <summary></summary>
 private void NavigationPaneOptions(object sender, System.EventArgs e)
 {
     m_rightClickedButton = null;
     m_hoveringButton     = null;
     Invalidate();
     using (NavPaneOptionsDlg frm = new NavPaneOptionsDlg(Buttons))
         frm.ShowDialog();
     Invalidate();
 }
Пример #5
0
 public void LoadingDialogDoesNotStartWithUpDownButtonsEnabled()
 {
     using (var dialog = new NavPaneOptionsDlg(_tabs))
     {
         dialog.Show();
         Assert.IsNull(dialog.tabListBox.SelectedItem, "This test doesn't make sense if a tab is selected");
         Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled when no tab is selected");
         Assert.False(dialog.btn_Up.Enabled, "Up button should be disabled when no tab is selected");
     }
 }
Пример #6
0
        public void HideATabHasNoEffectIfCancel()
        {
            Assert.IsTrue(_tab1.Visible, "tab1 should be visible before hiding");

            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();
                dialog.tabListBox.SetItemChecked(0, false);
                dialog.btn_Cancel.PerformClick();

                Assert.IsTrue(_tab1.Visible, "tab1 should still be visible since we clicked Cancel");
            }
        }
Пример #7
0
        public void CanHideATab()
        {
            Assert.IsTrue(_tab1.Visible, "tab1 should be visible before hiding");

            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();
                dialog.tabListBox.SetItemChecked(0, false);
                dialog.btn_OK.PerformClick();

                Assert.IsFalse(_tab1.Visible, "tab1 should have been hidden");
            }
        }
Пример #8
0
		public void JustCancelingDoesNotChangeTabs()
		{
			var tabsBeforeDialog = new object[10];
			var tabsAfterDialog = new object[10];
			(_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);
			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				dialog.btn_Cancel.PerformClick();
				(_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
				Assert.AreEqual(tabsBeforeDialog, tabsAfterDialog, "Opening and Canceling dialog should not have changed the tabs");
			}
		}
Пример #9
0
        public void JustCancelingDoesNotChangeTabs()
        {
            var tabsBeforeDialog = new object[10];
            var tabsAfterDialog  = new object[10];

            (_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);
            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();
                dialog.btn_Cancel.PerformClick();
                (_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
                Assert.AreEqual(tabsBeforeDialog, tabsAfterDialog, "Opening and Canceling dialog should not have changed the tabs");
            }
        }
Пример #10
0
 public void ResetButton_disablesUpDownButtons()
 {
     using (var dialog = new NavPaneOptionsDlg(_tabs))
     {
         dialog.Show();
         // Select a tab that enables Up and Down buttons
         dialog.tabListBox.SetSelected(1, true);
         // Click Reset
         dialog.btn_Reset.PerformClick();
         Assert.IsNull(dialog.tabListBox.SelectedItem, "This test doesn't make sense if a tab is selected");
         Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled when no tab is selected");
         Assert.False(dialog.btn_Up.Enabled, "Up button should be disabled when no tab is selected");
     }
 }
Пример #11
0
        public void CanReorderTabs_Up()
        {
            var tabsBeforeDialog = new object[3];
            var tabsAfterDialog  = new object[3];

            (_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);
            var tabsAfterDialog_expected = new object[3] {
                _tab1, _tab3, _tab2
            };

            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();
                dialog.tabListBox.SetSelected(2, true);
                dialog.btn_Up.PerformClick();

                (_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
                Assert.AreEqual(tabsAfterDialog_expected, tabsAfterDialog, "Reordering a tab up did not work");
            }
        }
Пример #12
0
        public void ResetButton()
        {
            var tabsBeforeDialog = new object[10];
            var tabsAfterDialog  = new object[10];

            (_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);

            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();
                // Uncheck a tab
                dialog.tabListBox.SetItemChecked(2, false);
                // Move a tab down
                dialog.tabListBox.SetSelected(0, true);
                dialog.btn_Down.PerformClick();
                dialog.btn_Reset.PerformClick();                 // Reset should restore things

                Assert.IsTrue(dialog.tabListBox.GetItemChecked(2), "tab should be checked again after Reset");
                (_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
                Assert.AreEqual(tabsBeforeDialog, tabsAfterDialog, "tab order should be restored by Reset");
            }
        }
Пример #13
0
        public void ReorderingShouldNotCheck()
        {
            using (var dialog = new NavPaneOptionsDlg(_tabs))
            {
                dialog.Show();

                // Uncheck all tabs
                for (int i = 0; i < _tabs.Count; i++)
                {
                    dialog.tabListBox.SetItemChecked(i, false);
                }

                // Move a tab down
                dialog.tabListBox.SetSelected(0, true);
                dialog.btn_Down.PerformClick();

                for (int i = 0; i < _tabs.Count; i++)
                {
                    Assert.IsFalse(dialog.tabListBox.GetItemChecked(i),
                                   "tab at index {0} should have remained unchecked when tabs are reordered", i);
                }
            }
        }
Пример #14
0
		public void HideATabHasNoEffectIfCancel()
		{
			Assert.IsTrue(_tab1.Visible, "tab1 should be visible before hiding");

			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				dialog.tabListBox.SetItemChecked(0, false);
				dialog.btn_Cancel.PerformClick();

				Assert.IsTrue(_tab1.Visible, "tab1 should still be visible since we clicked Cancel");
			}
		}
Пример #15
0
		public void CannotMoveTabBeyondLimit_Down()
		{
			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				dialog.tabListBox.SetSelected(2, true); // select bottom-most tab
				Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled");
			}
		}
Пример #16
0
		public void LoadingDialogDoesNotStartWithUpDownButtonsEnabled()
		{
			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				Assert.IsNull(dialog.tabListBox.SelectedItem, "This test doesn't make sense if a tab is selected");
				Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled when no tab is selected");
				Assert.False(dialog.btn_Up.Enabled, "Up button should be disabled when no tab is selected");
			}
		}
Пример #17
0
		public void ResetButton()
		{
			var tabsBeforeDialog = new object[10];
			var tabsAfterDialog = new object[10];
			(_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);

			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				// Uncheck a tab
				dialog.tabListBox.SetItemChecked(2, false);
				// Move a tab down
				dialog.tabListBox.SetSelected(0, true);
				dialog.btn_Down.PerformClick();
				dialog.btn_Reset.PerformClick(); // Reset should restore things

				Assert.IsTrue(dialog.tabListBox.GetItemChecked(2), "tab should be checked again after Reset");
				(_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
				Assert.AreEqual(tabsBeforeDialog, tabsAfterDialog, "tab order should be restored by Reset");
			}
		}
Пример #18
0
		public void CanReorderTabs_Up()
		{
			var tabsBeforeDialog = new object[3];
			var tabsAfterDialog = new object[3];
			(_tabs as ICollection).CopyTo(tabsBeforeDialog, 0);
			var tabsAfterDialog_expected = new object[3] { _tab1, _tab3, _tab2 };

			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				dialog.tabListBox.SetSelected(2, true);
				dialog.btn_Up.PerformClick();

				(_tabs as ICollection).CopyTo(tabsAfterDialog, 0);
				Assert.AreEqual(tabsAfterDialog_expected, tabsAfterDialog, "Reordering a tab up did not work");
			}
		}
Пример #19
0
		public void CanHideATab()
		{
			Assert.IsTrue(_tab1.Visible, "tab1 should be visible before hiding");

			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				dialog.tabListBox.SetItemChecked(0, false);
				dialog.btn_OK.PerformClick();

				Assert.IsFalse(_tab1.Visible, "tab1 should have been hidden");
			}
		}
Пример #20
0
		public void ResetButton_disablesUpDownButtons()
		{
			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();
				// Select a tab that enables Up and Down buttons
				dialog.tabListBox.SetSelected(1, true);
				// Click Reset
				dialog.btn_Reset.PerformClick();
				Assert.IsNull(dialog.tabListBox.SelectedItem, "This test doesn't make sense if a tab is selected");
				Assert.False(dialog.btn_Down.Enabled, "Down button should be disabled when no tab is selected");
				Assert.False(dialog.btn_Up.Enabled, "Up button should be disabled when no tab is selected");
			}
		}
Пример #21
0
		public void ReorderingShouldNotCheck()
		{
			using (var dialog = new NavPaneOptionsDlg(_tabs))
			{
				dialog.Show();

				// Uncheck all tabs
				for (int i = 0; i < _tabs.Count; i++)
					dialog.tabListBox.SetItemChecked(i, false);

				// Move a tab down
				dialog.tabListBox.SetSelected(0, true);
				dialog.btn_Down.PerformClick();

				for (int i = 0; i < _tabs.Count; i++)
					Assert.IsFalse(dialog.tabListBox.GetItemChecked(i),
						"tab at index {0} should have remained unchecked when tabs are reordered", i);
			}
		}