Inheritance: WritingSystemPropertiesDialog
        /// <summary>
        /// Removes the writing systems.
        /// </summary>
        public override void TestTearDown()
        {
            m_dlg.Dispose();
            m_dlg = null;

            base.TestTearDown();

            foreach (IWritingSystem ws in Cache.ServiceLocator.WritingSystemManager.LocalWritingSystems)
            {
                if (!m_origLocalWss.Contains(ws))
                {
                    ws.MarkedForDeletion = true;
                }
            }

            foreach (IWritingSystem ws in Cache.ServiceLocator.WritingSystemManager.GlobalWritingSystems)
            {
                if (!m_origGlobalWss.Contains(ws))
                {
                    ws.MarkedForDeletion = true;
                }
            }

            Cache.ServiceLocator.WritingSystemManager.Save();
        }
Esempio n. 2
0
        /// <summary>
        /// Removes the writing systems.
        /// </summary>
        public override void TestTearDown()
        {
            m_dlg.Dispose();
            m_dlg = null;

            base.TestTearDown();
        }
Esempio n. 3
0
		public void Teardown()
		{
			if (m_dlgWsProps != null)
			{
				m_dlgWsProps.Dispose();
				m_dlgWsProps = null;
			}
			m_inMemoryCache.Dispose();
		}
Esempio n. 4
0
 public void Teardown()
 {
     if (m_dlgWsProps != null)
     {
         m_dlgWsProps.Dispose();
         m_dlgWsProps = null;
     }
     m_inMemoryCache.Dispose();
 }
Esempio n. 5
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Assert that PUACharacter match what we expect.
 /// </summary>
 /// <param name="puaCharacterExpected">The expected PUACharacter</param>
 /// <param name="message">The message to append, e.g. "using the 'new' button"</param>
 /// <param name="wsPropsDlg">The ws props DLG.</param>
 /// ------------------------------------------------------------------------------------
 private void CheckPuaCharactersMatch(
     PUACharacter puaCharacterExpected, string message,
     DummyWritingSystemPropertiesDialog wsPropsDlg)
 {
     Assert.IsTrue(wsPropsDlg.IsPuaCodepointAdded(puaCharacterExpected.CodePoint),
                   "Didn't add the PUACharacter " + puaCharacterExpected.CodePoint + " " + message);
     Assert.AreEqual(puaCharacterExpected.ToString(),
                     wsPropsDlg.GetPuaString(puaCharacterExpected),
                     "Didn't modify the PUACharacter " + message);
     Assert.IsTrue(wsPropsDlg.IsPuaAdded(puaCharacterExpected),
                   "Didn't modify the PUACharacter " + message);
 }
Esempio n. 6
0
		public void Init()
		{
			StringUtils.InitIcuDataDir();
			m_inMemoryCache = InMemoryFdoCache.CreateInMemoryFdoCache();
			m_inMemoryCache.InitializeLangProject();
			m_inMemoryCache.Cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;
			m_inMemoryCache.InitializeWritingSystemEncodings();

			m_dlgWsProps = new DummyWritingSystemPropertiesDialog(m_inMemoryCache.Cache);

			// "show" the dialog box (the actually gui will never be loaded)
			// When in test mode the dialog will not call its base ShowDialog
			m_dlgWsProps.CallShowDialog();
		}
Esempio n. 7
0
        public void Init()
        {
            StringUtils.InitIcuDataDir();
            m_inMemoryCache = InMemoryFdoCache.CreateInMemoryFdoCache();
            m_inMemoryCache.InitializeLangProject();
            m_inMemoryCache.Cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;
            m_inMemoryCache.InitializeWritingSystemEncodings();

            m_dlgWsProps = new DummyWritingSystemPropertiesDialog(m_inMemoryCache.Cache);

            // "show" the dialog box (the actually gui will never be loaded)
            // When in test mode the dialog will not call its base ShowDialog
            m_dlgWsProps.CallShowDialog();
        }
        /// <summary>
        /// Creates the writing systems.
        /// </summary>
        public override void TestSetup()
        {
            base.TestSetup();
            m_wsKalabaIpa = CreateWritingSystem("qaa-fonipa-x-kal", "Kalaba", true);
            m_wsKalaba    = CreateWritingSystem("qaa-x-kal", "Kalaba", true);
            CreateWritingSystem("qaa-x-wsd", "WSDialog", true);
            CreateWritingSystem("qaa-fonipa-x-wsd", "WSDialog", true);
            IWritingSystem wsTest = CreateWritingSystem("qaa-x-tst", "TestOnly", false);

            m_wsTestIpa = CreateWritingSystem("qaa-fonipa-x-tst", "TestOnly", true);
            Cache.ServiceLocator.WritingSystemManager.Save();
            // this will remove it from the local store, but not from the global store
            wsTest.MarkedForDeletion = true;
            Cache.ServiceLocator.WritingSystemManager.Save();
            m_dlg = new DummyWritingSystemPropertiesDialog(Cache);
        }
Esempio n. 9
0
        public void NoCache_DoesNotThrow()
        {
            var wsManager = new WritingSystemManager();
            CoreWritingSystemDefinition ws = wsManager.Set("qaa-x-kal");

            ws.Language = new LanguageSubtag(ws.Language, "Kalaba");
            IWritingSystemContainer wsContainer = new MemoryWritingSystemContainer(wsManager.WritingSystems, wsManager.WritingSystems,
                                                                                   Enumerable.Empty <CoreWritingSystemDefinition>(), Enumerable.Empty <CoreWritingSystemDefinition>(), Enumerable.Empty <CoreWritingSystemDefinition>());

            using (var dlg = new DummyWritingSystemPropertiesDialog(wsManager, wsContainer))
            {
                dlg.ShowDialog(ws);
                dlg.LanguageNameTextBox.Text = "Kalab";
                Assert.DoesNotThrow(() => dlg.PressOk());
                Assert.That(ws.DisplayLabel, Is.EqualTo("Kalab"));
            }
        }
Esempio n. 10
0
 /// <summary>
 /// Creates the writing systems.
 /// </summary>
 public override void TestSetup()
 {
     base.TestSetup();
     NonUndoableUnitOfWorkHelper.Do(Cache.ActionHandlerAccessor, () =>
     {
         m_wsKalabaIpa = CreateWritingSystem("qaa-fonipa-x-kal", "Kalaba", true);
         m_wsKalaba    = CreateWritingSystem("qaa-x-kal", "Kalaba", true);
         CreateWritingSystem("qaa-x-wsd", "WSDialog", true);
         CreateWritingSystem("qaa-fonipa-x-wsd", "WSDialog", true);
         CoreWritingSystemDefinition wsTest = CreateWritingSystem("qaa-x-tst", "TestOnly", false);
         m_wsTestIpa = CreateWritingSystem("qaa-fonipa-x-tst", "TestOnly", true);
         Cache.ServiceLocator.WritingSystemManager.Save();
         // this will remove it from the local store, but not from the global store
         wsTest.MarkedForDeletion = true;
         Cache.ServiceLocator.WritingSystemManager.Save();
     });
     m_dlg = new DummyWritingSystemPropertiesDialog(Cache);
 }
		internal void SelectEthnologueCodeDlg(string languageName, string ethnologueCode, string country,
			DialogResult ethnologueDlgResultToEnforce,
			DummyWritingSystemPropertiesDialog.ShowMsgBoxStatus[] expectedMsgBoxes,
			string[] expectedOrigIcuLocales,
			DialogResult[] resultsToEnforce)
		{
			m_selectedLanguageName = languageName;
			m_selectedEthnologueCode = ethnologueCode;
			m_ethnologueDlgResultToEnforce = ethnologueDlgResultToEnforce;

			m_expectedMsgBoxes = new List<ShowMsgBoxStatus>(expectedMsgBoxes);
			if (expectedOrigIcuLocales != null)
				m_expectedOrigIcuLocales = new List<string>(expectedOrigIcuLocales);
			m_resultsToEnforce = new List<DialogResult>(resultsToEnforce);
			try
			{
				btnModifyEthnologueInfo_Click(this, null);
				Assert.AreEqual(0, m_expectedMsgBoxes.Count);
				Assert.AreEqual(0, m_expectedOrigIcuLocales.Count);
				Assert.AreEqual(0, m_resultsToEnforce.Count);
			}
			finally
			{
				m_expectedMsgBoxes.Clear();
				m_resultsToEnforce.Clear();
				m_expectedOrigIcuLocales.Clear();

				m_selectedLanguageName = null;
				m_selectedEthnologueCode = null;
				m_ethnologueDlgResultToEnforce = DialogResult.None;
			}
		}
		public void Teardown()
		{
			if (m_dlg != null)
			{
				m_dlg.Dispose();
				m_dlg = null;
			}
			else
			{
				DummyWritingSystemPropertiesDialog.CleanupTempLangDefFiles();
			}
			m_inMemoryCache.Dispose();
			ILgWritingSystemFactory wsf = LgWritingSystemFactoryClass.Create();
			wsf.Shutdown();
		}
		public void Init()
		{
			m_inMemoryCache = InMemoryFdoCache.CreateInMemoryFdoCache();
			m_inMemoryCache.InitializeLangProject();
			m_inMemoryCache.Cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;
			m_inMemoryCache.InitializeWritingSystemEncodings();
			int hvoWsNew = SimulateInstallLanguage("xkal__IPA", "Kalaba (IPA)",
				"Arial", "Times New Roman", "Charis SIL");
			m_hvoWsKalabaIpa = hvoWsNew;
			CreateTempLanguageDefinitionFileFromWs(InMemoryFdoCache.s_wsHvos.XKal);
			CreateTempLanguageDefinitionFileFromWs(m_hvoWsKalabaIpa);
			CreateTempLanguageDefinitionFileFromNewWs("xwsd", "WSDialog",
				"Arial", "Courier New", "Charis SIL");
			CreateTempLanguageDefinitionFileFromNewWs("xwsd__IPA", "WSDialog (IPA)",
				"Doulos SIL", "Doulos SIL", "Doulos SIL");
			DummyWritingSystemPropertiesDialog.CopyLangDefToTempLanguageDir("xtst",
				Path.Combine(DirectoryFinder.FwSourceDirectory, @"FwCoreDlgs\FwCoreDlgsTests\xtst.xml"));
			m_dlg = new DummyWritingSystemPropertiesDialog(m_inMemoryCache.Cache);
		}
Esempio n. 14
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Assert that PUACharacter match what we expect.
		/// </summary>
		/// <param name="puaCharacterExpected">The expected PUACharacter</param>
		/// <param name="message">The message to append, e.g. "using the 'new' button"</param>
		/// <param name="wsPropsDlg">The ws props DLG.</param>
		/// ------------------------------------------------------------------------------------
		private void CheckPuaCharactersMatch(
			PUACharacter puaCharacterExpected, string message,
			DummyWritingSystemPropertiesDialog wsPropsDlg)
		{
			Assert.IsTrue(wsPropsDlg.IsPuaCodepointAdded(puaCharacterExpected.CodePoint),
				"Didn't add the PUACharacter " + puaCharacterExpected.CodePoint + " " + message);
			Assert.AreEqual(puaCharacterExpected.ToString(),
				wsPropsDlg.GetPuaString(puaCharacterExpected),
				"Didn't modify the PUACharacter " + message);
			Assert.IsTrue(wsPropsDlg.IsPuaAdded(puaCharacterExpected),
				"Didn't modify the PUACharacter " + message);
		}
		/// <summary>
		/// Removes the writing systems.
		/// </summary>
		public override void TestTearDown()
		{
			m_dlg.Dispose();
			m_dlg = null;

			base.TestTearDown();

			foreach (IWritingSystem ws in Cache.ServiceLocator.WritingSystemManager.LocalWritingSystems)
			{
				if (!m_origLocalWss.Contains(ws))
					ws.MarkedForDeletion = true;
			}

			foreach (IWritingSystem ws in Cache.ServiceLocator.WritingSystemManager.GlobalWritingSystems)
			{
				if (!m_origGlobalWss.Contains(ws))
					ws.MarkedForDeletion = true;
			}

			Cache.ServiceLocator.WritingSystemManager.Save();
		}
		/// <summary>
		/// Creates the writing systems.
		/// </summary>
		public override void TestSetup()
		{
			base.TestSetup();
			m_wsKalabaIpa = CreateWritingSystem("qaa-fonipa-x-kal", "Kalaba", true);
			m_wsKalaba = CreateWritingSystem("qaa-x-kal", "Kalaba", true);
			CreateWritingSystem("qaa-x-wsd", "WSDialog", true);
			CreateWritingSystem("qaa-fonipa-x-wsd", "WSDialog", true);
			IWritingSystem wsTest = CreateWritingSystem("qaa-x-tst", "TestOnly", false);
			m_wsTestIpa = CreateWritingSystem("qaa-fonipa-x-tst", "TestOnly", true);
			Cache.ServiceLocator.WritingSystemManager.Save();
			// this will remove it from the local store, but not from the global store
			wsTest.MarkedForDeletion = true;
			Cache.ServiceLocator.WritingSystemManager.Save();
			m_dlg = new DummyWritingSystemPropertiesDialog(Cache);
		}