public void Init() { CheckDisposed(); Debug.Assert(m_inMemoryCache == null, "m_inMemoryCache is not null."); //if (m_inMemoryCache != null) // m_inMemoryCache.Dispose(); m_inMemoryCache = ScrInMemoryFdoCache.Create(); m_inMemoryCache.InitializeLangProject(); m_inMemoryCache.InitializeScripture(); m_scripture = m_inMemoryCache.Cache.LangProject.TranslatedScriptureOA; m_inMemoryCache.InitializeActionHandler(); m_styleSheet = new DynamicMock(typeof(FwStyleSheet)); m_styleSheet.Strict = true; BTInsertVerseAndFootnoteTests.InitializeVwSelection(m_selHelper); Debug.Assert(m_btView == null, "m_btView is not null."); //if (m_btView != null) // m_btView.Dispose(); m_btView = new DummyDraftView(m_inMemoryCache.Cache, true, 0); m_btView.RootBox = SetupRootBox(); m_btView.Graphics = SetupGraphics(); m_btView.MakeRoot(); m_btView.StyleSheet = (FwStyleSheet)m_styleSheet.MockInstance; m_btView.ActivateView(); m_btView.TeEditingHelper.InTestMode = true; m_rootBox.Strict = true; }
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); }