コード例 #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);
        }