コード例 #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);
 }