Exemplo n.º 1
0
        public void SetUp()
        {
            CheckDisposed();
            if (m_mock != null)
            {
                m_mock.Dispose();
            }

            m_mock = InMemoryFdoCache.CreateInMemoryFdoCache();
            m_mock.InitializeWritingSystemEncodings();
            m_mock.InitializeLangProject();
            m_lp = m_mock.Cache.LangProject;
        }
        public void SetUp()
        {
            CheckDisposed();
            if (m_cache != null)
            {
                m_cache.Dispose();
            }

            m_cache = InMemoryFdoCache.CreateInMemoryFdoCache();
            m_cache.InitializeWritingSystemEncodings();
            ILgWritingSystemFactory lgwsf = m_cache.Cache.LanguageWritingSystemFactoryAccessor;

            m_ws = lgwsf.get_EngineOrNull(InMemoryFdoCache.s_wsHvos.En);
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        public void VernacularWsListAdd()
        {
            m_inMemoryCache.InitializeWritingSystemEncodings();
            // Setup so the order in the Analysis WS list should be: English, French,
            // English IPA and Spanish.
            SetupVernWss();

            // Disable all these buttons so we can verify that they will be enabled after
            // adding a new writing system.
            m_dlg.OkButton.Enabled             = false;
            m_dlg.VernWsDeleteButton.Enabled   = false;
            m_dlg.VernWsModifyButton.Enabled   = false;
            m_dlg.VernWsMoveUpButton.Enabled   = false;
            m_dlg.VernWsMoveDownButton.Enabled = false;

            // Add a new writing system to the cache.
            int             newWsHvo = m_inMemoryCache.SetupWs("no");
            LgWritingSystem ws       = m_inMemoryCache.CreateWritingSystem(m_inMemoryCache.Cache,
                                                                           newWsHvo, "no", new int[] { (int)InMemoryFdoCache.s_wsHvos.En }, new string[] { "new one" });

            m_dlg.SimulateVernAddingWs(ws);

            VerifyWritingSystemOrder(m_dlg.VernWsList,
                                     new string[] { "English", "French", "English IPA", "Spanish", "new one" });

            // Verify that the new writing system is the selected one.
            Assert.AreEqual(ws, (LgWritingSystem)m_dlg.VernWsList.SelectedItem,
                            "New writing system is not selected.");

            // Verify that the correct items are checked.
            VerifyCheckedWritingSystems(m_dlg.VernWsList,
                                        new string[] { "English", "French", "new one" }, true);

            // Verify that the correct items are not checked.
            VerifyCheckedWritingSystems(m_dlg.VernWsList,
                                        new string[] { "English IPA", "Spanish" }, false);

            Assert.IsTrue(m_dlg.OkButton.Enabled);
            Assert.IsTrue(m_dlg.VernWsDeleteButton.Enabled);
            Assert.IsTrue(m_dlg.VernWsModifyButton.Enabled);
            Assert.IsTrue(m_dlg.VernWsMoveUpButton.Enabled);
            Assert.IsTrue(m_dlg.VernWsMoveDownButton.Enabled);
        }