public void SetUp() { CheckDisposed(); if (m_emptyTsString != null) { Marshal.ReleaseComObject(m_emptyTsString); } // Create an empty TsString ITsStrBldr bldr = TsStrBldrClass.Create(); bldr.Replace(0, 0, string.Empty, null); m_emptyTsString = bldr.GetString(); // Set up the FDO mock and populate it with some values m_inMemoryCache = ScrInMemoryFdoCache.Create(); m_inMemoryCache.InitializeLangProject(); m_inMemoryCache.InitializeScripture(); m_book = m_inMemoryCache.AddBookToMockedScripture(57, "Philemon"); // Set up IVwEnv object m_vwenvMock = new DynamicMock(typeof(IVwEnv)); m_vwenvMock.SetupResult("DataAccess", m_inMemoryCache.CacheAccessor); // save settings m_oldPromptSetting = Options.ShowEmptyParagraphPromptsSetting; }
public void Init() { m_inMemoryCache = ScrInMemoryFdoCache.Create(this); m_inMemoryCache.InitializeLangProject(); m_inMemoryCache.InitializeScripture(); m_inMemoryCache.AddBookToMockedScripture(1, "Genesis"); m_inMemoryCache.AddBookToMockedScripture(2, "Exodus"); m_inMemoryCache.AddBookToMockedScripture(5, "Deuteronomy"); m_James = m_inMemoryCache.AddBookToMockedScripture(59, "James"); m_inMemoryCache.AddBookToMockedScripture(66, "Revelation"); m_fdoCache = m_inMemoryCache.Cache; m_scr = (Scripture)m_fdoCache.LangProject.TranslatedScriptureOA; m_ctrlOwner = new Form(); ILgWritingSystemFactory wsf = m_fdoCache.LanguageWritingSystemFactoryAccessor; m_scp = new DummyScrPassageControl(null, m_scr, false); m_dbScp = new DummyScrPassageControl(null, m_scr, true); m_ctrlOwner.Controls.Add(m_scp); m_ctrlOwner.Controls.Add(m_dbScp); m_ctrlOwner.CreateControl(); if (m_scp.DropDownWindow != null) { m_scp.DropDownWindow.Close(); } if (m_dbScp.DropDownWindow != null) { m_dbScp.DropDownWindow.Close(); } // Forcing the reference to this should reset the ScrReference object for us // which, we hope will cause some strange errors to occur when running in // console mode. The tests seem to always work in gui mode but not console mode. m_scp.ScReference = new ScrReference(01001001, m_scr.Versification); m_dbScp.ScReference = new ScrReference(01001001, m_scr.Versification); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Allows subclasses to do other stuff to initialize the cache before it gets used /// </summary> /// ------------------------------------------------------------------------------------ protected override void InitializeCache() { m_scrInMemoryCache.InitializeScripture(); m_scr = Cache.LangProject.TranslatedScriptureOA as Scripture; base.InitializeCache(); }