public void IFwTool_CloseDbAndWindows() { CheckDisposed(); // Preparations string serverName = MiscUtils.LocalServerName; DummyFwApp app = m_app as DummyFwApp; app.SetFdoCache(serverName, "TestLangProj", Cache); using (InMemoryFdoCache mockedCache = InMemoryFdoCache.CreateInMemoryFdoCache()) { app.SetFdoCache(serverName, "LelaTeli-2", mockedCache.Cache); int pidNew; m_app.NewMainWnd(serverName, "TestLangProj", 1, 0, 0, 0, 0, out pidNew); m_app.NewMainWnd(serverName, "TestLangProj", 1, 0, 0, 0, 0, out pidNew); m_app.NewMainWnd(serverName, "LelaTeli-2", 1, 0, 0, 0, 0, out pidNew); Assert.AreEqual(3, app.m_nMainWnd); app.m_mainWnd[0].Cache = Cache; app.m_mainWnd[1].Cache = Cache; app.m_mainWnd[2].Cache = mockedCache.Cache; // Here is what we want to test ((IFwTool)m_app).CloseDbAndWindows(serverName, "TestLangProj", true); Assert.IsTrue(app.m_mainWnd[0].m_fClosed); Assert.IsTrue(app.m_mainWnd[1].m_fClosed); Assert.IsFalse(app.m_mainWnd[2].m_fClosed); } }
public void MultiMessageSynchronize_DifferentCache() { CheckDisposed(); m_mainWnd.ExpectAndReturn("PreSynchronize", true, new IsAnything()); m_mainWnd.ExpectAndReturn("Synchronize", true, new IsAnything()); m_app.MainWindows.Add((IFwMainWnd)m_mainWnd.MockInstance); InMemoryFdoCache differentCache = InMemoryFdoCache.CreateInMemoryFdoCache(); try { DynamicMock otherMainWnd = new DynamicMock(typeof(IFwMainWnd)); otherMainWnd.SetupResult("Cache", differentCache.Cache); otherMainWnd.ExpectAndReturn("PreSynchronize", true, new IsAnything()); otherMainWnd.ExpectAndReturn("Synchronize", true, new IsAnything()); m_app.MainWindows.Add((IFwMainWnd)otherMainWnd.MockInstance); m_app.SuppressSynchronize(Cache); m_app.Synchronize(new SyncInfo(SyncMsg.ksyncUndoRedo, 0, 0), Cache); m_app.Synchronize(new SyncInfo(SyncMsg.ksyncUndoRedo, 0, 0), differentCache.Cache); // This should call (Pre)Synchronize once for each main window m_app.ResumeSynchronize(Cache); m_mainWnd.Verify(); otherMainWnd.Verify(); } finally { differentCache.Dispose(); } }
public void SetUp() { CheckDisposed(); m_inMemoryCache = InMemoryFdoCache.CreateInMemoryFdoCache(); m_mainWnd = new DynamicMock(typeof(IFwMainWnd)); m_mainWnd.SetupResult("Cache", Cache); m_app = new DummyFwApp(); }
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); }
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 in memory fdo cache. /// </summary> /// <param name="provider">The provider.</param> /// ------------------------------------------------------------------------------------ protected virtual InMemoryFdoCache CreateInMemoryFdoCache(IWsFactoryProvider provider) { return(InMemoryFdoCache.CreateInMemoryFdoCache(this)); }
public void Init() { m_inMemoryCache = InMemoryFdoCache.CreateInMemoryFdoCache(); m_inMemoryCache.InitializeLangProject(); }