示例#1
0
        public void TestAllWhenFalse()
        {
            var array = new int[] { 2, 4, 3 };

            Func <int, bool> myFunc = (x) => { return(x % 2 == 0); };

            Assert.False(LINQFunctions.All(array, p => myFunc(p)));
        }
示例#2
0
        public void TestAllThrowningExceptions()
        {
            int[] array = null;

            Func <int, bool> myFunc = (x) => { return(x % 2 == 0); };

            Assert.Throws <ArgumentNullException>(() => LINQFunctions.All(array, p => myFunc(p)));

            array = new int[] { 2, 4, 6 };

            Assert.Throws <ArgumentNullException>(() => LINQFunctions.All(array, null));
        }