public async Task ViewGenerator_WithSolutionWithCompileError_ReturnsEmitError()
        {
            var generator = new ViewGenerator();

            var view = await generator.GenerateViewAsync(
                solutionPath: SolutionWithCompileErrorPath());

            Assert.IsTrue(view.Contains("error CS1002"));
        }
        public async Task ViewGenerator_WithInvalidSolutionPath_DoesntReturnView()
        {
            var generator = new ViewGenerator();

            var view = await generator.GenerateViewAsync(
                solutionPath: InvalidSolutionPath());

            Assert.IsFalse(IsValidView(view));
        }
        public async Task ViewGenerator_WithSolutionWithCompileError_DoesntReturnValidView()
        {
            var generator = new ViewGenerator();

            var view = await generator.GenerateViewAsync(
                solutionPath: SolutionWithCompileErrorPath());

            Assert.IsFalse(IsValidView(view));
        }
        public async Task ViewGenerator_OfReturnExpression_ReturnsView()
        {
            var generator = new ViewGenerator();

            var view = await generator.GenerateViewAsync(
                solutionPath: ClassLibrarySolutionPath(),
                activeDocument: DefaultDocument(),
                cursorPosition: ReturnExpressionPosition());

            Assert.IsTrue(IsValidView(view));
        }
 /// <summary>
 /// Needs to be called everytime the control is made visible
 /// </summary>
 private void Setup(IServiceProvider serviceProvider, ExpressionViewerControl view)
 {
     var sourceMonitor = new SourceMonitor(serviceProvider);
     var viewController = new ExpressionViewController(view);
     var viewGenerator = new ViewGenerator();
     Runner = new Runner(sourceMonitor, viewController, viewGenerator);
 }