public void GetHashCodeShouldNotMatchWhenNodesHaveDifferentValues() { // Arrange Id i1 = new Id.Node(0, 0); Id i2 = new Id.Node(0, 1); // Act int hash1 = i1.GetHashCode(); int hash2 = i2.GetHashCode(); // Assert hash1.Should().NotBe(hash2); }
public void GetHashCodeShouldNotMatchWhenComplexNodesHaveDifferentValues() { // 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 int hash1 = i1.GetHashCode(); int hash2 = i2.GetHashCode(); // Assert hash1.Should().NotBe(hash2); }
public void GetHashCodeShouldMatchWhenNodesHaveSameValues() { // Arrange Id i1 = new Id.Node(0, 1); Id i2 = new Id.Node(0, 1); // Act int hash1 = i1.GetHashCode(); int hash2 = i2.GetHashCode(); // Assert hash1.Should().Be(hash2); }