public void IsNullOrEmptyIEnumerable() { IEnumerable<int> sourceA = new int[0].ToIEnumerable(); IEnumerable<int> sourceB = null; IEnumerable<int> sourceC = new[] {1,2,3}.ToIEnumerable(); Assert.IsTrue(sourceA.IsNullOrEmpty()); Assert.IsTrue(sourceB.IsNullOrEmpty()); Assert.IsFalse(sourceC.IsNullOrEmpty()); }
public void IsNullOrEmptyIList() { IList<int> sourceA = new int[0].ToIList(); IList<int> sourceB = null; IList<int> sourceC = new[] {1,2,3}.ToIList(); Assert.IsTrue(sourceA.IsNullOrEmpty()); Assert.IsTrue(sourceB.IsNullOrEmpty()); Assert.IsFalse(sourceC.IsNullOrEmpty()); }
public void IsNullOrEmptyICollection() { ICollection<int> sourceA = new int[0].ToICollection(); ICollection<int> sourceB = null; ICollection<int> sourceC = new[] {1,2,3}.ToICollection(); Assert.IsTrue(sourceA.IsNullOrEmpty()); Assert.IsTrue(sourceB.IsNullOrEmpty()); Assert.IsFalse(sourceC.IsNullOrEmpty()); }
public void IsNullOrEmptyArray() { int[] sourceA = new int[0].ToArray(); int[] sourceB = null; int[] sourceC = new[] {1,2,3}.ToArray(); Assert.IsTrue(sourceA.IsNullOrEmpty()); Assert.IsTrue(sourceB.IsNullOrEmpty()); Assert.IsFalse(sourceC.IsNullOrEmpty()); }