Esempio n. 1
0
        public static void EqualsReturnsFalseWhenSpanIsDifferent()
        {
            var left  = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));
            var right = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 4));

            Assert.False(left.Equals(right));
        }
Esempio n. 2
0
        public static void EqualsReturnsTrueWhenPositionIsSame()
        {
            var left  = new TestableSyntaxNode(new Position(4, 2));
            var right = new TestableSyntaxNode(new Position(4, 2));

            Assert.True(left.Equals(right));
        }
Esempio n. 3
0
        public static void EqualsReturnsFalseWhenPositionIsDifferent()
        {
            var left  = new TestableSyntaxNode(new Position(4, 2));
            var right = new TestableSyntaxNode(new Position(2, 4));

            Assert.False(left.Equals(right));
        }
Esempio n. 4
0
        public static void EqualsReturnsTrueWhenKindAndSpanAreTheSame()
        {
            var left  = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));
            var right = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));

            Assert.True(left.Equals(right));
        }
Esempio n. 5
0
 public static void EqualsReturnsFalseWhenChildNodesAreDifferent()
 {
     var left = new TestableSyntaxNode(
         SyntaxKind.CodeBlock,
         new TestableSyntaxNode(SyntaxKind.ClassBlockStart, new Span(0, 3)),
         new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(3, 2)));
     var right = new TestableSyntaxNode(
         SyntaxKind.CodeBlock,
         new TestableSyntaxNode(SyntaxKind.ExpressionBlockStart, new Span(0, 3)),
         new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(3, 2)));
     Assert.False(left.Equals(right));
 }
Esempio n. 6
0
 public static void EqualsReturnsTrueWhenChildNodesAreSame()
 {
     var left = new TestableSyntaxNode(
         SyntaxKind.CodeBlock,
         new TestableSyntaxNode(SyntaxKind.StatementBlockStart, new Span(0, 2)),
         new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 2)));
     var right = new TestableSyntaxNode(
         SyntaxKind.CodeBlock,
         new TestableSyntaxNode(SyntaxKind.StatementBlockStart, new Span(0, 2)),
         new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 2)));
     Assert.True(left.Equals(right));
 }
Esempio n. 7
0
        public static void EqualsReturnsFalseWhenChildNodesAreDifferent()
        {
            var left = new TestableSyntaxNode(
                SyntaxKind.CodeBlock,
                new TestableSyntaxNode(SyntaxKind.ClassBlockStart, new Span(0, 3)),
                new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(3, 2)));
            var right = new TestableSyntaxNode(
                SyntaxKind.CodeBlock,
                new TestableSyntaxNode(SyntaxKind.ExpressionBlockStart, new Span(0, 3)),
                new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(3, 2)));

            Assert.False(left.Equals(right));
        }
Esempio n. 8
0
        public static void EqualsReturnsTrueWhenChildNodesAreSame()
        {
            var left = new TestableSyntaxNode(
                SyntaxKind.CodeBlock,
                new TestableSyntaxNode(SyntaxKind.StatementBlockStart, new Span(0, 2)),
                new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 2)));
            var right = new TestableSyntaxNode(
                SyntaxKind.CodeBlock,
                new TestableSyntaxNode(SyntaxKind.StatementBlockStart, new Span(0, 2)),
                new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 2)));

            Assert.True(left.Equals(right));
        }
Esempio n. 9
0
 public static void EqualsReturnsFalseWhenSpanIsDifferent()
 {
     var left = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));
     var right = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(2, 4));
     Assert.False(left.Equals(right));            
 }
Esempio n. 10
0
 public static void EqualsReturnsFalseWhenPositionIsDifferent()
 {
     var left = new TestableSyntaxNode(new Position(4, 2));
     var right = new TestableSyntaxNode(new Position(2, 4));
     Assert.False(left.Equals(right));            
 }
Esempio n. 11
0
 public static void EqualsReturnsTrueWhenPositionIsSame()
 {
     var left = new TestableSyntaxNode(new Position(4, 2));
     var right = new TestableSyntaxNode(new Position(4, 2));
     Assert.True(left.Equals(right));
 }
Esempio n. 12
0
 public static void EqualsReturnsTrueWhenKindAndSpanAreTheSame()
 {
     var left = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));
     var right = new TestableSyntaxNode(SyntaxKind.BlockEnd, new Span(4, 2));
     Assert.True(left.Equals(right));
 }