コード例 #1
0
 private void AssertNotEqual(SourceMapping left, SourceMapping right)
 {
     Assert.False(left == right);
     Assert.False(left.Equals(right));
     Assert.False(right.Equals(left));
     Assert.False(Equals(left, right));
 }
コード例 #2
0
        public void GeneratedCodeMappingsAreNotEqualIfAbsoluteIndexIsNotEqual()
        {
            // Arrange
            var left = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 2, 3), 4),
                new SourceSpan(new SourceLocation(4, 6, 7), 8));

            var right = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 2, 3), 4),
                new SourceSpan(new SourceLocation(5, 6, 7), 9));

            // Assert
            AssertNotEqual(left, right);
        }
コード例 #3
0
        public void GeneratedCodeMappingsAreNotEqualIfStartLineIsNotEqual()
        {
            // Arrange
            var left = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 2, 3), 4),
                new SourceSpan(new SourceLocation(5, 5, 7), 8));

            var right = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 1, 3), 4),
                new SourceSpan(new SourceLocation(5, 6, 7), 8));

            // Assert
            AssertNotEqual(left, right);
        }
コード例 #4
0
        public void GeneratedCodeMappingsAreEqualIfDataIsEqual()
        {
            // Arrange
            var left = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 2, 3), 4),
                new SourceSpan(new SourceLocation(5, 6, 7), 8));

            var right = new SourceMapping(
                new SourceSpan(new SourceLocation(1, 2, 3), 4),
                new SourceSpan(new SourceLocation(5, 6, 7), 8));

            // Assert
            Assert.True(left.Equals(right));
            Assert.True(right.Equals(left));
            Assert.True(Equals(left, right));
        }