コード例 #1
0
    public void IsAcceptableInsertionInBalancedParenthesis_ReturnsFalseIfChangeIsParenthesis(string changeText)
    {
        // Arrange
        var change = new SourceChange(0, 1, changeText);

        // Act
        var result = ImplicitExpressionEditHandler.IsAcceptableInsertionInBalancedParenthesis(null, change);

        // Assert
        Assert.False(result);
    }
コード例 #2
0
    public void IsAcceptableInsertionInBalancedParenthesis_BalancedParenthesis_ReturnsTrue()
    {
        // Arrange
        var span   = GetSyntaxNode(SourceLocation.Zero, "(Hello)");
        var change = new SourceChange(new SourceSpan(6, 0), " World");

        // Act
        var result = ImplicitExpressionEditHandler.IsAcceptableInsertionInBalancedParenthesis(span, change);

        // Assert
        Assert.True(result);
    }
コード例 #3
0
    public void IsAcceptableInsertionInBalancedParenthesis_InsertingParenthesis_ReturnsFalse(string text)
    {
        // Arrange
        var span   = GetSyntaxNode(SourceLocation.Zero, "(Hello World)");
        var change = new SourceChange(new SourceSpan(3, 0), text);

        // Act
        var result = ImplicitExpressionEditHandler.IsAcceptableInsertionInBalancedParenthesis(span, change);

        // Assert
        Assert.False(result);
    }