Example #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Clean up for a test.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public override void TestTearDown()
 {
     m_dialog.Dispose();
     m_dialog     = null;
     m_mapping    = null;
     m_styleSheet = null;
     m_Scripture  = null;
     base.TestTearDown();
 }
Example #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Init for a test.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public override void TestSetup()
        {
            base.TestSetup();
            m_Scripture = Cache.LangProject.TranslatedScriptureOA;

            m_styleSheet = new FwStyleSheet();
            m_styleSheet.Init(Cache, m_Scripture.Hvo, ScriptureTags.kflidStyles);

            m_mapping = new ImportMappingInfo("emph{", "}", "Emphasis");
            Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
            m_dialog = new DummyCharacterMappingSettings(m_mapping, m_styleSheet, Cache);
            m_dialog.StyleListHelper.MaxStyleLevel = int.MaxValue;
        }
Example #3
0
 public void CleanUp()
 {
     // For runtime sake, do FdoCache.RestoreTestLangProj in TestFixtureTearDown unless
     // our individual tests really need a clean database.
     //			FdoCache.RestoreTestLangProj();
     m_dialog.Dispose();
     m_dialog     = null;
     m_mapping    = null;
     m_styleSheet = null;
     m_Scripture  = null;
     m_cache.Dispose();
     m_cache = null;
 }
Example #4
0
        public void Init()
        {
            m_cache     = FdoCache.Create("TestLangProj");
            m_Scripture = m_cache.LangProject.TranslatedScriptureOA;
            // Make sure we don't call InstallLanguage during tests.
            m_cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;

            m_styleSheet = new FwStyleSheet();
            m_styleSheet.Init(m_cache, m_Scripture.Hvo, (int)Scripture.ScriptureTags.kflidStyles);

            m_mapping = new ImportMappingInfo("emph{", "}", "Emphasis");
            Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
            m_dialog = new DummyCharacterMappingSettings(m_mapping, m_styleSheet, m_cache);
            m_dialog.StyleListHelper.MaxStyleLevel = int.MaxValue;
        }
		public void CleanUp()
		{
			// For runtime sake, do FdoCache.RestoreTestLangProj in TestFixtureTearDown unless
			// our individual tests really need a clean database.
			//			FdoCache.RestoreTestLangProj();
			m_dialog.Dispose();
			m_dialog = null;
			m_mapping = null;
			m_styleSheet = null;
			m_Scripture = null;
			m_cache.Dispose();
			m_cache = null;
		}
		public void Init()
		{
			m_cache = FdoCache.Create("TestLangProj");
			m_Scripture = m_cache.LangProject.TranslatedScriptureOA;
			// Make sure we don't call InstallLanguage during tests.
			m_cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;

			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(m_cache, m_Scripture.Hvo, (int)Scripture.ScriptureTags.kflidStyles);

			m_mapping = new ImportMappingInfo("emph{", "}", "Emphasis");
			Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
			m_dialog = new DummyCharacterMappingSettings(m_mapping, m_styleSheet, m_cache);
			m_dialog.StyleListHelper.MaxStyleLevel = int.MaxValue;
		}
Example #7
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates (if necessary) and shows the CharacterMappingSettings dialog.
		/// This is a public virtual so that test code can override it.
		/// </summary>
		/// <param name="mapping">Provides intial values displayed in dialog.</param>
		/// ------------------------------------------------------------------------------------
		protected override void DisplayInlineMappingDialog(ImportMappingInfo mapping)
		{
			if (m_inlineMappingDialog == null)
			{
				m_inlineMappingDialog = new DummyCharacterMappingSettings(mapping, m_StyleSheet, m_cache);
				m_fDisposeInlineMappingDialog = true;
				m_inlineMappingDialog.IsDuplicateMapping += new DummyCharacterMappingSettings.IsDuplicateMappingHandler(IsDup);
			}
			else
			{
				m_inlineMappingDialog.InitializeControls(mapping, false);
				// clear warningHappened flag here in our dummy dialog
				((DummyCharacterMappingSettings)m_inlineMappingDialog).MappingInvalidWarningHappened =
					false;
				// This is pretty dumb, but we have to set it to cancel by default for testing purposes
				// because if the test asked for the OK button to be pressed but a validation error
				// occurs, we'll still pretend to close the dialog. If we return OK (as the user
				// requested), the subsequent code will think everything was okay.
				m_inlineMappingDialog.DialogResult = DialogResult.Cancel;
			}

			DummyCharacterMappingSettings mappingDlg = (DummyCharacterMappingSettings)m_inlineMappingDialog;
			if (m_MappingDialogDummyAccept)
			{
				mappingDlg.BeginningTextBox.Text = m_MappingDialogDummyData.BeginMarker;
				mappingDlg.EndingTextBox.Text = m_MappingDialogDummyData.EndMarker;
				mappingDlg.m_MappingDialogDummyData = m_MappingDialogDummyData;

				// fake the ok button being pressed.
				m_inlineMappingDialog.btnOk_Click(null, null);
			}
			else
				m_inlineMappingDialog.DialogResult = DialogResult.Cancel;
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Clean up for a test.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestTearDown()
		{
			m_dialog.Dispose();
			m_dialog = null;
			m_mapping = null;
			m_styleSheet = null;
			m_Scripture = null;
			base.TestTearDown();
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Init for a test.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();
			m_Scripture = Cache.LangProject.TranslatedScriptureOA;

			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(Cache, m_Scripture.Hvo, ScriptureTags.kflidStyles);

			m_mapping = new ImportMappingInfo("emph{", "}", "Emphasis");
			Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
			m_dialog = new DummyCharacterMappingSettings(m_mapping, m_styleSheet, Cache);
			m_dialog.StyleListHelper.MaxStyleLevel = int.MaxValue;
		}