Пример #1
0
 public void Should_return_false_if_the_input_contains_items()
 {
     // ReSharper disable UseObjectOrCollectionInitializer
     var input = new ArrayList();
     // ReSharper restore UseObjectOrCollectionInitializer
     input.Add(6);
     input.IsNullOrEmpty().ShouldBeFalse();
 }
Пример #2
0
        public void EnumerableIsNullOrEmpty()
        {
            IEnumerable<object> nullEnumerable = null;
            Assert.IsTrue(nullEnumerable.IsNullOrEmpty());

            IEnumerable emptyEnumerable = new ArrayList() { };
            Assert.IsTrue(emptyEnumerable.IsNullOrEmpty());

            IEnumerable fullEnumerable = new ArrayList() { 1, "I'm a string", 2.04f, DateTime.Now };
            Assert.IsFalse(fullEnumerable.IsNullOrEmpty());
        }
Пример #3
0
        public void IsNullOrEmpty()
        {
            ArrayList al1 = null;
            Assert.True(al1.IsNullOrEmpty());

            ArrayList al2 = new ArrayList();
            Assert.True(al2.IsNullOrEmpty());

            ArrayList al3 = new ArrayList();
            al3.Add(1);
            al3.Add("A");
            al3.Add(DateTime.Now);
            Assert.False(al3.IsNullOrEmpty());
        }
Пример #4
0
 public void Should_return_true_if_the_input_is_empty()
 {
     var input = new ArrayList();
     input.IsNullOrEmpty().ShouldBeTrue();
 }