Exemplo n.º 1
0
        public void StopParser_DetachesFromTextBufferChangeLoop()
        {
            // Arrange
            var documentTracker = CreateDocumentTracker();
            var textBuffer      = (TestTextBuffer)documentTracker.TextBuffer;

            using (var parser = new DefaultVisualStudioRazorParser(
                       Dispatcher,
                       CreateDocumentTracker(),
                       ProjectEngineFactory,
                       new DefaultErrorReporter(),
                       Mock.Of <VisualStudioCompletionBroker>()))
            {
                parser.StartParser();

                // Act
                parser.StopParser();

                // Assert
                Assert.Empty(textBuffer.AttachedChangedEvents);
                Assert.Null(parser._parser);
            }
        }