예제 #1
0
        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());
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }