示例#1
0
        public void GetHashCodeShouldNotMatchWhenLeafsHaveDifferentValues()
        {
            // Arrange
            Event e1 = new Event.Leaf(0);
            Event e2 = new Event.Leaf(4);

            // Act
            int hash1 = e1.GetHashCode();
            int hash2 = e2.GetHashCode();

            e1.Equals(e2).Should().BeFalse();
        }
示例#2
0
        public void GetHashCodeShouldMatchWhenLeafsHaveSameValues()
        {
            // Arrange
            Event e1 = new Event.Leaf(0);
            Event e2 = new Event.Leaf(0);

            // Act
            int hash1 = e1.GetHashCode();
            int hash2 = e2.GetHashCode();

            e1.Equals(e2).Should().BeTrue();
        }