Exemplo n.º 1
0
        public void TestAnyWhenFalse()
        {
            var array = new int[] { 1, 2, 3, 4, 5 };

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

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

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

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

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