コード例 #1
0
        public void Equality_operator_still_works_the_same_when_overriding_equals()
        {
            var a = new CustomEqualsObject(1);
            var b = new CustomEqualsObject(1);

            Assert.IsFalse(a == b);
        }
コード例 #2
0
        public void Equals_can_be_overridden()
        {
            var a = new CustomEqualsObject(1);
            var b = new CustomEqualsObject(1);
            var c = new CustomEqualsObject(2);

            Assert.AreEqual(a, b);
            Assert.AreNotEqual(a, c);
        }