public void ShouldProvideCompletions_ReturnsTrueForSimpleImplicitExpressions_WhenInvoked()
        {
            // Arrange
            var syntaxTree = CreateSyntaxTree("@mod");
            var location   = new SourceSpan(2, 0);
            var context    = CreateRazorCompletionContext(syntaxTree);

            // Act
            var result = DirectiveCompletionItemProvider.ShouldProvideCompletions(context, location);

            // Assert
            Assert.True(result);
        }
        public void ShouldProvideCompletions_ReturnsFalseWhenInsideDirective()
        {
            // Arrange
            var syntaxTree = CreateSyntaxTree("@functions { @  }", FunctionsDirective.Directive);
            var location   = new SourceSpan(14, 0);
            var context    = CreateRazorCompletionContext(syntaxTree);

            // Act
            var result = DirectiveCompletionItemProvider.ShouldProvideCompletions(context, location);

            // Assert
            Assert.False(result);
        }
        public void ShouldProvideCompletions_ReturnsFalseWhenOwnerIsExplicitExpression()
        {
            // Arrange
            var syntaxTree = CreateSyntaxTree("@(something)");
            var location   = new SourceSpan(4, 0);
            var context    = CreateRazorCompletionContext(syntaxTree);

            // Act
            var result = DirectiveCompletionItemProvider.ShouldProvideCompletions(context, location);

            // Assert
            Assert.False(result);
        }
        public void ShouldProvideCompletions_ReturnsFalseWhenInsideAttributeArea()
        {
            // Arrange
            var syntaxTree = CreateSyntaxTree("<p @ >");
            var location   = new SourceSpan(4, 0);
            var context    = CreateRazorCompletionContext(syntaxTree);

            // Act
            var result = DirectiveCompletionItemProvider.ShouldProvideCompletions(context, location);

            // Assert
            Assert.False(result);
        }
        public void ShouldProvideCompletions_ReturnsFalseIfNoOwner()
        {
            // Arrange
            var syntaxTree = CreateSyntaxTree("@");
            var location   = new SourceSpan(2, 0);
            var context    = CreateRazorCompletionContext(syntaxTree);

            // Act
            var result = DirectiveCompletionItemProvider.ShouldProvideCompletions(context, location);

            // Assert
            Assert.False(result);
        }