Пример #1
0
        public void ThrowsWhenPredicateIsNull()
        {
            var source = new[] { 1, 2, 3 };

            Assert.Throws <ArgumentNullException>(() => MyEnumerable.Any(source, null));
        }
Пример #2
0
        public void TrueWhenNotEmpty()
        {
            var numbers = new[] { 1, 2, 3 };

            Assert.That(MyEnumerable.Any(numbers, n => n > 1), Is.True);
        }
Пример #3
0
        public void ThrowsWhenSourceIsNull()
        {
            IEnumerable <Int32> source = null;

            Assert.Throws <ArgumentNullException>(() => MyEnumerable.Any(source, n => n > 1));
        }
Пример #4
0
        public void FalseWhenEmpty()
        {
            var numbers = new List <Int32>();

            Assert.That(MyEnumerable.Any(numbers, n => n > 0), Is.False);
        }