Exemplo n.º 1
0
        public void Null_enumerator_pass()
        {
            var x        = new EnumerableStruct <int>(null);
            var comparer = new ComparerBuilder().GetComparer <EnumerableStruct <int> >();

            Assert.Throws <NullReferenceException>(() => comparer.Compare(x, x));
            Assert.Throws <NullReferenceException>(() => comparer.Compare(default, default));
Exemplo n.º 2
0
        public void Null_enumerator_pass()
        {
            var x        = new EnumerableStruct <int>(null);
            var comparer = ComparerBuilder.Default.GetEqualityComparer <EnumerableStruct <int> >();
            var hashX    = comparer.GetHashCode(x);

            using (new AssertionScope()) {
                Assert.Throws <NullReferenceException>(() => comparer.Equals(x, x));
                Assert.Throws <NullReferenceException>(() => comparer.Equals(default, default));