Beispiel #1
0
        public void FindShouldNotFindAnyThingInArrayWithPredicate()
        {
            //Arrange
            var expectedLength = 0;
            //Act
            var item = array.Find(x => x >= 300);

            //Assert
            Assert.AreEqual(expectedLength, item);
        }
 /// <summary>
 /// Checks for item that meet a given condition.
 /// </summary>
 /// <param name="predicate">Defines the conditions of the element to search for.</param>
 /// <returns>Returns first found item, if the item is not found will return default value of <typeparamref name="T"/></returns>
 public T Find(Func <T, bool> predicate)
 {
     return(array.Find(predicate));
 }