public override void Exit() { m_chart = null; m_mockRibbon = null; m_logic = null; base.Exit(); }
protected override void CreateTestData() { base.CreateTestData(); m_logic = new TestCCLogic(Cache, m_chart, m_stText); m_helper.Logic = m_logic; m_logic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo); m_helper.MakeTemplate(out m_allColumns); // Note: do this AFTER creating the template, which may also create the DiscourseData object. m_chart = m_helper.SetupAChart(); }
public override void Exit() { m_chart = null; m_template = null; m_allColumns = null; m_mockRibbon = null; m_logic = null; m_firstParaWfics = null; base.Exit(); }
protected override void CreateTestData() { base.CreateTestData(); m_firstParaWfics = m_helper.MakeAnnotations(m_firstPara); m_logic = new TestCCLogic(Cache, m_chart, m_stText.Hvo); m_helper.Logic = m_logic; m_logic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo); m_template = m_helper.MakeTemplate(out m_allColumns); // Note: do this AFTER creating the template, which may also create the DiscourseData object. m_chart = new DsConstChart(); Cache.LangProject.DiscourseDataOA.ChartsOC.Add(m_chart); m_chart.TemplateRA = m_template; m_logic.Chart = m_chart; m_helper.MakeDefaultChartMarkers(); m_helper.Chart = m_chart; }
/// <summary> /// Verifies that the specified number of AnalysisOccurrences have been removed from /// the start of the original list. /// </summary> /// <param name="mrib"></param> /// <param name="allParaOccurrences"></param> /// <param name="removedAnalyses"></param> /// <returns></returns> internal void AssertUsedAnalyses(MockRibbon mrib, AnalysisOccurrence[] allParaOccurrences, int removedAnalyses) { var allWords = allParaOccurrences.Where(point => point.HasWordform).ToList(); var remainderAnalyses = SubArray(allWords.ToArray(), removedAnalyses, allWords.Count - removedAnalyses); var dummyHvoVec = mrib.Decorator.VecProp(m_stText.Hvo, mrib.OccurenceListId); var cdummyHvos = dummyHvoVec.Length; Assert.AreEqual(remainderAnalyses.Length, cdummyHvos); var ribbonAnalyses = LoadRibbonAnalyses(mrib, dummyHvoVec); for (var i = 0; i < cdummyHvos; i++) { Assert.AreEqual(remainderAnalyses[i].Analysis.Hvo, ribbonAnalyses[i].Hvo); } }
protected void CreateTestData() { using (new UndoRedoTaskHelper(Cache, "Undo LogicTest - CreateTestData", "Redo LogicTest - CreateTestData")) { m_helper = new DiscourseTestHelper(Cache); m_firstPara = m_helper.FirstPara; m_stText = m_firstPara.Owner as StText; m_firstParaWfics = m_helper.MakeAnnotations(m_firstPara); m_logic = new TestCCLogic(Cache, m_chart, m_stText.Hvo); m_helper.Logic = m_logic; m_logic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo); m_template = m_helper.MakeTemplate(out m_allColumns); // Note: do this AFTER creating the template, which may also create the DiscourseData object. m_chart = new DsConstChart(); Cache.LangProject.DiscourseDataOA.ChartsOC.Add(m_chart); m_chart.TemplateRA = m_template; m_logic.Chart = m_chart; m_helper.Chart = m_chart; } }
protected override void CreateTestData() { base.CreateTestData(); m_cclogic = new TestCCLogic(Cache, m_chart, m_stText); m_cclogic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo); m_helper.Logic = m_cclogic; m_template = m_helper.MakeTemplate(out m_allColumns); // Note: do this AFTER creating the template, which may also create the DiscourseData object. m_chart = m_helper.SetupAChart(); m_origCell = null; // Test must fill in the ClickedCell in the CChartSentenceElements object m_eligCols = m_allColumns.ToArray(); // CChartSentenceElements always starts with all columns m_eligRows = null; // Test must fill in EligibleRows in the CChartSentenceElements object m_sentElem = new CChartSentenceElements(m_origCell, m_eligRows, m_eligCols); m_dlgLogicPrepose = new AdvancedMTDialogLogic(Cache, true, m_sentElem); m_dlgLogicPostpose = new AdvancedMTDialogLogic(Cache, false, m_sentElem); // create one each direction; test both }
protected override void CreateTestData() { base.CreateTestData(); m_firstParaWfics = m_helper.MakeAnnotations(m_firstPara); m_logic = new TestCCLogic(Cache, m_chart, m_stText.Hvo); // m_chart is still null! m_helper.Logic = m_logic; m_logic.Ribbon = m_mockRibbon = new MockRibbon(Cache, m_stText.Hvo); m_template = m_helper.MakeTemplate(out m_allColumns); // Note: do this AFTER creating the template, which may also create the DiscourseData object. m_chart = new DsConstChart(); Cache.LangProject.DiscourseDataOA.ChartsOC.Add(m_chart); m_chart.TemplateRA = m_template; m_logic.Chart = m_chart; m_helper.MakeDefaultChartMarkers(); m_helper.Chart = m_chart; m_constChart = new ConstituentChart(Cache, m_logic); m_constChart.Init(null, null); m_chartBody = m_constChart.Body; m_chartBody.Cache = Cache; // don't know why constructor doesn't do this, but it doesn't. m_chartBody.SetRoot(m_chart.Hvo, m_allColumns.ToArray()); }