示例#1
0
        public void ImplicitConversionOperatorShouldReturnNodeWhenTuple()
        {
            // Arrange
            Id i1 = new Id.Node(new Id.Node(0, new Id.Node(1, 0)), new Id.Node(1, 0)); // ((0,(1,0)),(1,0))
            Id i2 = ((0, (1, 0)), (1, 0));                                             // combo of C#7 tuples and implicit conversion operator is wow!

            // Act & Assert
            i1.Equals(i2).Should().BeTrue();
        }
示例#2
0
        public void EqualsShouldReturnFalseWhenComparingComplexNodesWithDifferentValues()
        {
            // Arrange
            Id i1 = new Id.Node(new Id.Node(0, new Id.Node(1, 0)), new Id.Node(1, 0)); // ((0,(1,0)),(1,0))
            Id i2 = new Id.Node(new Id.Node(0, new Id.Node(1, 1)), new Id.Node(1, 0)); // ((0,(1,1)),(1,0))

            // Act & Assert
            i1.Equals(i2).Should().BeFalse();
        }
示例#3
0
        public void EqualsShouldReturnFalseWhenComparingNodesWithDifferentValues()
        {
            // Arrange
            Id i1 = new Id.Node(0, 0);
            Id i2 = new Id.Node(0, 1);

            // Act & Assert
            i1.Equals(i2).Should().BeFalse();
        }
示例#4
0
        public void EqualsShouldReturnTrueWhenComparingComplexNodesWithSameValues()
        {
            // Arrange
            Id i1 = new Id.Node(new Id.Node(0, new Id.Node(1, 0)), new Id.Node(1, 0)); // ((0,(1,0)),(1,0))
            Id i2 = new Id.Node(new Id.Node(0, new Id.Node(1, 0)), new Id.Node(1, 0)); // ((0,(1,0)),(1,0))

            // Act & Assert
            i1.Equals(i2).Should().BeTrue();
        }
示例#5
0
        public void EqualsShouldReturnTrueWhenComparingNodesWithSameValues()
        {
            // Arrange
            Id i1 = new Id.Node(0, 1);
            Id i2 = new Id.Node(0, 1);

            // Act & Assert
            i1.Equals(i2).Should().BeTrue();
        }