A dialog window for testing ToolsOptions dialog.
Inheritance: SIL.FieldWorks.TE.ToolsOptionsDialog
Ejemplo n.º 1
0
        public void StyleOptionsTest()
        {
            // Make sure all of the settings are the default values in the registry
            Options.ShowTheseStylesSetting       = Options.ShowTheseStyles.All;
            Options.ShowStyleLevelSetting        = Options.StyleLevel.Basic;
            Options.ShowUserDefinedStylesSetting = true;

            using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
            {
                // Make sure that all of the settings were initialized correctly.
                Assert.IsTrue(dlg.RadioAll.Checked, "All radio button should be checked");
                Assert.AreEqual(0, dlg.ComboStyleLevel.SelectedIndex);
                Assert.IsTrue(dlg.CheckUserDefined.Checked,
                              "Show user defined styles checkbox should be checked");

                // Now, set a different set of values to the registry and see if the dialog gets them correctly
                Options.ShowTheseStylesSetting       = Options.ShowTheseStyles.Basic;
                Options.ShowStyleLevelSetting        = Options.StyleLevel.Expert;
                Options.ShowUserDefinedStylesSetting = false;
            }

            using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
            {
                // Make sure that all of the settings were initialized correctly.
                Assert.IsTrue(dlg.RadioBasic.Checked, "Basic radio button should be checked");
                Assert.AreEqual(3, dlg.ComboStyleLevel.SelectedIndex);
                Assert.IsFalse(dlg.CheckUserDefined.Checked,
                               "Show user defined styles checkbox should NOT be checked");

                // change the values in the window and then make sure they get saved correctly.
                dlg.RadioCustom.Checked           = true;
                dlg.ComboStyleLevel.SelectedIndex = 2;
                dlg.CheckUserDefined.Checked      = true;
                dlg.ClickOK();

                // check the registry values to make sure they got set correctly.
                Assert.AreEqual(Options.ShowTheseStyles.Custom, Options.ShowTheseStylesSetting);
                Assert.AreEqual(Options.StyleLevel.Advanced, Options.ShowStyleLevelSetting);
                Assert.IsTrue(Options.ShowUserDefinedStylesSetting,
                              "Show User defined styles checkbox was not saved to the registry correctly");
            }
        }
Ejemplo n.º 2
0
        public void DraftViewOptionsTest()
        {
            // set the registry settings before creating the dialog
            Options.ShowMarkerlessIconsSetting          = true;
            Options.FootnoteSynchronousScrollingSetting = false;
            Options.ShowEmptyParagraphPromptsSetting    = true;

            // create a dialog and make sure that the dialog is initialized properly
            using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
            {
                Assert.IsTrue(dlg.CheckMarkerlessFootnoteIcons.Checked);
                Assert.IsFalse(dlg.CheckSynchFootnoteScroll.Checked);
                Assert.IsTrue(dlg.CheckPromptEmptyParas.Checked);
                //Assert.IsFalse(dlg.CheckShowStyles.Checked);

                // set the registry settings before creating the dialog again
                Options.ShowMarkerlessIconsSetting          = false;
                Options.FootnoteSynchronousScrollingSetting = true;
                Options.ShowEmptyParagraphPromptsSetting    = false;
            }

            // check the new dialog values
            using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
            {
                Assert.IsFalse(dlg.CheckMarkerlessFootnoteIcons.Checked);
                Assert.IsTrue(dlg.CheckSynchFootnoteScroll.Checked);
                Assert.IsFalse(dlg.CheckPromptEmptyParas.Checked);
                //Assert.IsTrue(dlg.CheckShowStyles.Checked);

                // set the items in the dialog and then click OK to make sure they get saved correctly
                dlg.CheckMarkerlessFootnoteIcons.Checked = true;
                dlg.CheckSynchFootnoteScroll.Checked     = true;
                dlg.CheckPromptEmptyParas.Checked        = false;
                //dlg.CheckShowStyles.Checked = false;
                dlg.ClickOK();

                Assert.IsTrue(Options.ShowMarkerlessIconsSetting);
                Assert.IsTrue(Options.FootnoteSynchronousScrollingSetting);
                Assert.IsFalse(Options.ShowEmptyParagraphPromptsSetting);
            }
        }
Ejemplo n.º 3
0
		public void StyleOptionsTest()
		{
			// Make sure all of the settings are the default values in the registry
			Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
			Options.ShowStyleLevelSetting = Options.StyleLevel.Basic;
			Options.ShowUserDefinedStylesSetting = true;

			using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
			{
				// Make sure that all of the settings were initialized correctly.
				Assert.IsTrue(dlg.RadioAll.Checked, "All radio button should be checked");
				Assert.AreEqual(0, dlg.ComboStyleLevel.SelectedIndex);
				Assert.IsTrue(dlg.CheckUserDefined.Checked,
					"Show user defined styles checkbox should be checked");

				// Now, set a different set of values to the registry and see if the dialog gets them correctly
				Options.ShowTheseStylesSetting = Options.ShowTheseStyles.Basic;
				Options.ShowStyleLevelSetting = Options.StyleLevel.Expert;
				Options.ShowUserDefinedStylesSetting = false;
			}

			using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
			{
				// Make sure that all of the settings were initialized correctly.
				Assert.IsTrue(dlg.RadioBasic.Checked, "Basic radio button should be checked");
				Assert.AreEqual(3, dlg.ComboStyleLevel.SelectedIndex);
				Assert.IsFalse(dlg.CheckUserDefined.Checked,
					"Show user defined styles checkbox should NOT be checked");

				// change the values in the window and then make sure they get saved correctly.
				dlg.RadioCustom.Checked = true;
				dlg.ComboStyleLevel.SelectedIndex = 2;
				dlg.CheckUserDefined.Checked = true;
				dlg.ClickOK();

				// check the registry values to make sure they got set correctly.
				Assert.AreEqual(Options.ShowTheseStyles.Custom, Options.ShowTheseStylesSetting);
				Assert.AreEqual(Options.StyleLevel.Advanced, Options.ShowStyleLevelSetting);
				Assert.IsTrue(Options.ShowUserDefinedStylesSetting,
					"Show User defined styles checkbox was not saved to the registry correctly");
			}
		}
Ejemplo n.º 4
0
		public void DraftViewOptionsTest()
		{
			// set the registry settings before creating the dialog
			Options.ShowMarkerlessIconsSetting = true;
			Options.FootnoteSynchronousScrollingSetting = false;
			Options.ShowEmptyParagraphPromptsSetting = true;

			// create a dialog and make sure that the dialog is initialized properly
			using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
			{
				Assert.IsTrue(dlg.CheckMarkerlessFootnoteIcons.Checked);
				Assert.IsFalse(dlg.CheckSynchFootnoteScroll.Checked);
				Assert.IsTrue(dlg.CheckPromptEmptyParas.Checked);
				//Assert.IsFalse(dlg.CheckShowStyles.Checked);

				// set the registry settings before creating the dialog again
				Options.ShowMarkerlessIconsSetting = false;
				Options.FootnoteSynchronousScrollingSetting = true;
				Options.ShowEmptyParagraphPromptsSetting = false;
			}

			// check the new dialog values
			using (ToolsOptionsDlgDummy dlg = new ToolsOptionsDlgDummy(m_app, m_app, m_wsManager))
			{
				Assert.IsFalse(dlg.CheckMarkerlessFootnoteIcons.Checked);
				Assert.IsTrue(dlg.CheckSynchFootnoteScroll.Checked);
				Assert.IsFalse(dlg.CheckPromptEmptyParas.Checked);
				//Assert.IsTrue(dlg.CheckShowStyles.Checked);

				// set the items in the dialog and then click OK to make sure they get saved correctly
				dlg.CheckMarkerlessFootnoteIcons.Checked = true;
				dlg.CheckSynchFootnoteScroll.Checked = true;
				dlg.CheckPromptEmptyParas.Checked = false;
				//dlg.CheckShowStyles.Checked = false;
				dlg.ClickOK();

				Assert.IsTrue(Options.ShowMarkerlessIconsSetting);
				Assert.IsTrue(Options.FootnoteSynchronousScrollingSetting);
				Assert.IsFalse(Options.ShowEmptyParagraphPromptsSetting);
			}
		}