Example #1
0
        public void Two_Instances_NotEqual_If_End_Different()
        {
            var vacation1 = new Vacation(DateTime.UtcNow.AddDays(1), DateTime.UtcNow.AddDays(2));
            var vacation2 = new Vacation(DateTime.UtcNow.AddDays(1), DateTime.UtcNow.AddDays(3));

            vacation1.Should().NotBe(vacation2);
            vacation1.GetHashCode().Should().NotBe(vacation2.GetHashCode());
        }
Example #2
0
        public void Two_Instances_Equal_If_Same_Start_And_End()
        {
            var vacation1 = new Vacation(DateTime.UtcNow.AddDays(1), DateTime.UtcNow.AddDays(2));
            var vacation2 = new Vacation(DateTime.UtcNow.AddDays(1), DateTime.UtcNow.AddDays(2));

            vacation1.Should().BeEquivalentTo(vacation2);
            vacation1.GetHashCode().Should().Be(vacation2.GetHashCode());
        }