public void Equals_should_use_custom_logic()
        {
            var first = new CustomEquals();

            first.X = 1;

            var second = new CustomEquals();

            second.X = 2;

            var result = first.Equals(second);

            Assert.True(result);
            Assert.True(first.CustomCalled);
        }
Ejemplo n.º 2
0
 bool Custom(CustomEquals other)
 {
     return(X == 1 && other.X == 2 || X == 2 && other.X == 1);
 }
Ejemplo n.º 3
0
 bool CustomEqualsMethod(CustomEquals other)
 {
     this.CustomCalled = true;
     return(X == 1 && other.X == 2 || X == 2 && other.X == 1);
 }