コード例 #1
0
        public async Task ViewGenerator_WithSolutionWithCompileError_DoesntReturnValidView()
        {
            var generator = new ViewGenerator();

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

            Assert.IsFalse(IsValidView(view));
        }
コード例 #2
0
        public async Task ViewGenerator_WithSolutionWithCompileError_ReturnsEmitError()
        {
            var generator = new ViewGenerator();

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

            Assert.IsTrue(view.Contains("error CS1002"));
        }
コード例 #3
0
        public async Task ViewGenerator_WithInvalidSolutionPath_DoesntReturnView()
        {
            var generator = new ViewGenerator();

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

            Assert.IsFalse(IsValidView(view));
        }
コード例 #4
0
        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));
        }