Exemplo n.º 1
0
        public void TestAllWhenFalse()
        {
            var array = new int[] { 2, 4, 6, 7 };

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

            Assert.False(LinqFunctions.All(array, p => myFunc(p)));
        }
Exemplo n.º 2
0
        public void TestAllWhenSourceIsNull()
        {
            int[] array = null;

            Func <int, bool> myFunc = (x) => { return(x == 4); };

            var msg = Assert.Throws <ArgumentNullException>(() => LinqFunctions.All(array, p => myFunc(p)));

            Assert.Equal("Value cannot be null.\r\nParameter name: source", msg.Message);
        }