public void EmptyIfNull_ReturnsOriginalEnumerationIfNotNull() { var ints = Enumerable.Range(1, 100); var result = IEnumerableExtensions.EmptyIfNull(ints); Assert.IsNotNull(result); Assert.AreEqual(result, ints); }
public void EmptyIfNull_ReturnsEmptyEnumerationIfNull() { var nullInts = (IEnumerable <int>)null; var result = IEnumerableExtensions.EmptyIfNull(nullInts); Assert.IsNotNull(result); Assert.IsTrue(result.Count() == 0); }