public void IsInsideParenthesis_InBalancedParenthesis_ReturnsTrue() { // Arrange var tokens = GetTokens(SourceLocation.Zero, "Foo(GetValue(), DoSomething(point))"); // Act var result = ImplicitExpressionEditHandler.IsInsideParenthesis(30, tokens); // Assert Assert.True(result); }
public void IsInsideParenthesis_InvalidParenthesis_ReturnsFalse() { // Arrange var tokens = GetTokens(SourceLocation.Zero, "(hello))point)"); // Act var result = ImplicitExpressionEditHandler.IsInsideParenthesis(10, tokens); // Assert Assert.False(result); }
public void IsInsideParenthesis_NoParenthesis_ReturnsFalse() { // Arrange var tokens = GetTokens(SourceLocation.Zero, "Hello World"); // Act var result = ImplicitExpressionEditHandler.IsInsideParenthesis(3, tokens); // Assert Assert.False(result); }
public void IsInsideParenthesis_SurroundedByCompleteParenthesis_ReturnsFalse() { // Arrange var tokens = GetTokens(SourceLocation.Zero, "(hello)point(world)"); // Act var result = ImplicitExpressionEditHandler.IsInsideParenthesis(9, tokens); // Assert Assert.False(result); }