예제 #1
0
        public void EmptyIfNull_ReturnsOriginalEnumerationIfNotNull()
        {
            var ints   = Enumerable.Range(1, 100);
            var result = IEnumerableExtensions.EmptyIfNull(ints);

            Assert.IsNotNull(result);
            Assert.AreEqual(result, ints);
        }
예제 #2
0
        public void EmptyIfNull_ReturnsEmptyEnumerationIfNull()
        {
            var nullInts = (IEnumerable <int>)null;
            var result   = IEnumerableExtensions.EmptyIfNull(nullInts);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count() == 0);
        }