예제 #1
0
        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));
        }
예제 #2
0
 public void NonNullGreaterThanNull()
 {
     Assert.AreEqual(1, PartialComparer.ReferenceCompare("x", null).Value);
 }
예제 #3
0
 public void TwoNullReferencesReturnZero()
 {
     Assert.AreEqual(0, PartialComparer.ReferenceCompare <string>(null, null).Value);
 }
예제 #4
0
 public void NullLessThanNonNull()
 {
     Assert.AreEqual(-1, PartialComparer.ReferenceCompare(null, "x").Value);
 }
예제 #5
0
 public void EqualNonNullReferencesReturnZero()
 {
     Assert.AreEqual(0, PartialComparer.ReferenceCompare("x", "x").Value);
 }