Exemplo n.º 1
0
        public void TryReinitializeParser_ReturnsTrue_IfProjectIsSupported()
        {
            // Arrange
            using (var parser = new DefaultVisualStudioRazorParser(
                       Dispatcher,
                       CreateDocumentTracker(isSupportedProject: true),
                       ProjectEngineFactory,
                       new DefaultErrorReporter(),
                       Mock.Of <VisualStudioCompletionBroker>()))
            {
                // Act
                var result = parser.TryReinitializeParser();

                // Assert
                Assert.True(result);
            }
        }
        public void TryReinitializeParser_ReturnsFalse_IfProjectIsNotSupported()
        {
            // Arrange
            using (var parser = new DefaultVisualStudioRazorParser(
                       Dispatcher,
                       CreateDocumentTracker(isSupportedProject: false),
                       Mock.Of <RazorTemplateEngineFactoryService>(),
                       new DefaultErrorReporter(),
                       Mock.Of <ICompletionBroker>()))
            {
                // Act
                var result = parser.TryReinitializeParser();

                // Assert
                Assert.False(result);
            }
        }
        public void TryReinitializeParser_ReturnsFalse_IfProjectIsNotSupported()
        {
            // Arrange
            using (var parser = new DefaultVisualStudioRazorParser(
                       JoinableTaskContext,
                       CreateDocumentTracker(isSupportedProject: false),
                       ProjectEngineFactory,
                       new DefaultErrorReporter(),
                       Mock.Of <VisualStudioCompletionBroker>(MockBehavior.Strict)))
            {
                // Act
                var result = parser.TryReinitializeParser();

                // Assert
                Assert.False(result);
            }
        }