Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
Esempio n. 1
0
        public void Two_Participants_with_the_same_ids_are_equal()
        {
            var p1 = new Participant { Id = 1 };
            var p2 = new Participant { Id = 1 };

            Assert.That(p1.Equals(p2));
            Assert.That(p2.Equals(p1));
        }
Esempio n. 2
0
        public void Two_Participants_with_the_different_ids_are_not_equal()
        {
            var p1 = new Participant { Id = 1 };
            var p2 = new Participant { Id = 2 };

            Assert.That(p1.Equals(p2), Is.False);
            Assert.That(p2.Equals(p1), Is.False);
        }