Пример #1
0
        public void ApplyTwo()
        {
            RespellUndoAction action = new RespellUndoAction(Cache, "axx", "ayyy");

            action.AddOccurrence(m_para2Occurrences[1]);
            action.AddOccurrence(m_para2Occurrences[2]);
            action.DoIt();
            VerifyDoneStateApplyTwo();
            Assert.IsTrue(m_fdoCache.CanUndo, "undo should be possible after respelling");
            UndoResult ures;

            m_fdoCache.Undo(out ures);
            VerifyStartingState();
            m_fdoCache.Redo(out ures);
            VerifyDoneStateApplyTwo();
        }
Пример #2
0
        public void ApplyAllAndKeepAnalyses()
        {
            MakeMonoAnalyses();
            MakeMultiAnalyses();
            RespellUndoAction action = new RespellUndoAction(Cache, "axx", "byy");

            AddAllOccurrences(action, m_para1Occurrences);
            AddAllOccurrences(action, m_para2Occurrences);
            action.AllChanged   = true;
            action.KeepAnalyses = true;
            action.DoIt();
            VerifyDoneStateApplyAllAndKeepAnalyses();
            Assert.IsTrue(m_fdoCache.CanUndo, "undo should be possible after respelling");
            UndoResult ures;

            m_fdoCache.Undo(out ures);
            VerifyStartingState();
            m_fdoCache.Redo(out ures);
            VerifyDoneStateApplyAllAndKeepAnalyses();
        }
Пример #3
0
        public void ApplyTwoAndCopyAnalyses()
        {
            MakeMonoAnalyses();
            MakeMultiAnalyses();
            // Makes one more analysis, which (having no human approval) should NOT get copied.
            m_wfAxx.AnalysesOC.Add(new WfiAnalysis());
            m_cAnalyses++;

            RespellUndoAction action = new RespellUndoAction(Cache, "axx", "ayyy");

            action.AddOccurrence(m_para2Occurrences[1]);
            action.AddOccurrence(m_para2Occurrences[2]);
            action.CopyAnalyses = true;
            action.DoIt();
            VerifyDoneStateApplyTwoAndCopyAnalyses();
            Assert.IsTrue(m_fdoCache.CanUndo, "undo should be possible after respelling");
            UndoResult ures;

            m_fdoCache.Undo(out ures);
            VerifyStartingState();
            m_fdoCache.Redo(out ures);
            VerifyDoneStateApplyTwoAndCopyAnalyses();
        }