Example #1
0
        public void UpdateFolds_FakeFoldingManagerUsed_FoldsPassedToFakeFoldingManager()
        {
            CreateXmlFoldingManager();
            List <NewFolding> folds = NewFoldingHelper.CreateFoldListWithOneFold();

            xmlFoldingManager.UpdateFolds(folds);

            NewFoldingHelper.AssertAreEqual(folds, fakeFoldingManager.NewFoldsPassedToUpdateFoldings);
        }
Example #2
0
 void XmlEditor_DocumentChanged(object sender, EventArgs e)
 {
     _foldingManager?.Dispose();
     if (Document != null)
     {
         Indent();
         _foldingManager = new XmlFoldingManager(this);
         _foldingManager.UpdateFolds();
         _foldingManager.Start();
     }
 }
        public void UpdateFolds_NoParameterPassedToMethod_FakeXmlFoldParserFoldsUsedToUpdateFakeFoldingManager()
        {
            CreateXmlFoldingManager();
            AddDocumentPositionToOffsetReturnValue(5);
            AddDocumentPositionToOffsetReturnValue(10);

            MockDocument expectedSnapshot = new MockDocument();

            fakeTextEditor.MockDocument.SetSnapshot(expectedSnapshot);

            FoldingRegion fold = CreateTestFoldingRegion();

            fakeXmlFoldParser.Folds.Add(fold);

            xmlFoldingManager.UpdateFolds();

            IList <NewFolding> newFolds = fakeFoldingManager.NewFoldsPassedToUpdateFoldings;

            List <NewFolding> expectedFolds = CreateTestNewFoldingList();

            NewFoldingHelper.AssertAreEqual(expectedFolds, newFolds);
        }