public void DifferentNonNullReferencesReturnNull() { // Just to be extra careful, make two different references to equal strings. // That way we know we're not actually doing comparisons! string x1 = new string(new [] { 'x' }); string x2 = new string(new [] { 'x' }); Assert.AreNotSame(x1, x2); Assert.IsNull(PartialComparer.ReferenceCompare(x1, x2)); }
public void NonNullGreaterThanNull() { Assert.AreEqual(1, PartialComparer.ReferenceCompare("x", null).Value); }
public void TwoNullReferencesReturnZero() { Assert.AreEqual(0, PartialComparer.ReferenceCompare <string>(null, null).Value); }
public void NullLessThanNonNull() { Assert.AreEqual(-1, PartialComparer.ReferenceCompare(null, "x").Value); }
public void EqualNonNullReferencesReturnZero() { Assert.AreEqual(0, PartialComparer.ReferenceCompare("x", "x").Value); }