public void ComparerReturnsTrueIfOjectsAreSameInstance() { var comparer = new ObjectReferenceComparer <ObjRefComparerTestStub>(); var x = new ObjRefComparerTestStub(1); var y = x; bool result = comparer.Equals(x, y); Assert.IsTrue(result); }
public void ComparerReturnsFalseIfObjectsAreNotSame() { var comparer = new ObjectReferenceComparer <ObjRefComparerTestStub>(); var x = new ObjRefComparerTestStub(1); var y = new ObjRefComparerTestStub(2); bool result = comparer.Equals(x, y); Assert.IsFalse(result); }
public void ComparerReturnsFalseIfObjectsAreNotSameInstanceIgnoringEquatableImplementation() { var comparer = new ObjectReferenceComparer <ObjRefComparerTestStub>(); var x = new ObjRefComparerTestStub(1); var y = new ObjRefComparerTestStub(1); bool comparerResult = comparer.Equals(x, y); bool equalsResult = x.Equals(y); Assert.IsFalse(comparerResult); Assert.IsTrue(equalsResult); }
public void ComparerInitialises() { var comparer = new ObjectReferenceComparer <ObjRefComparerTestStub>(); Assert.IsNotNull(comparer); }