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))); }
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); }