public void IsDirectiveCompletableToken_ReturnsFalseForInvalidCSharpTokens() { // Arrange var csharpToken = SyntaxFactory.Token(SyntaxKind.Tilde, "~"); // Act var result = DirectiveCompletionItemProvider.IsDirectiveCompletableToken(csharpToken); // Assert Assert.False(result); }
public void IsDirectiveCompletableToken_ReturnsFalseForNonCSharpTokens() { // Arrange var token = SyntaxFactory.Token(SyntaxKind.Text, string.Empty); // Act var result = DirectiveCompletionItemProvider.IsDirectiveCompletableToken(token); // Assert Assert.False(result); }
public void IsDirectiveCompletableToken_ReturnsTrueForCSharpIdentifiers() { // Arrange var csharpToken = SyntaxFactory.Token(SyntaxKind.Identifier, "model"); // Act var result = DirectiveCompletionItemProvider.IsDirectiveCompletableToken(csharpToken); // Assert Assert.True(result); }
public void IsDirectiveCompletableToken_ReturnsTrueForCSharpMarkerTokens() { // Arrange var csharpToken = SyntaxFactory.Token(SyntaxKind.Marker, string.Empty); // Act var result = DirectiveCompletionItemProvider.IsDirectiveCompletableToken(csharpToken); // Assert Assert.True(result); }
public void IsDirectiveCompletableToken_ReturnsTrueForCSharpKeywords() { // If you're typing `@inject` and stop at `@in` it will be parsed as a C# Keyword instead of an identifier, so we have to allow them too // Arrange var csharpToken = SyntaxFactory.Token(SyntaxKind.Keyword, "in"); // Act var result = DirectiveCompletionItemProvider.IsDirectiveCompletableToken(csharpToken); // Assert Assert.True(result); }