public static void HasPredicatedItem <T, TItem, TCollection>( this AssertScope <T, TCollection> a, Expression <Func <TItem, bool> > predicate) where TCollection : class, IEnumerable <TItem> { a.IsTrue(x => x != null && x.Any(predicate.Compile()), "HasPredicatedItem " + predicate); }
public static void HasNoItem <T>(this AssertScope <T, int> a) { a.IsTrue(x => x == 0, "HasNoItem"); }
public static void IsZero <T>(this AssertScope <T, int> a) { a.IsTrue(x => x == 0, "IsZero"); }
public static void MoreThanZero <T>(this AssertScope <T, int> a) { a.IsTrue(x => x > 0, "MoreThanZero"); }
public static void Contains <T, TItem, TCollection>(this AssertScope <T, TCollection> a, TItem item) where TCollection : class, IEnumerable <TItem> { a.IsTrue(x => x != null && x.Contains(item), "Contains " + item); }
public static void HasAnyItem <T, TCollection>(this AssertScope <T, TCollection> a) where TCollection : class, IEnumerable { a.IsTrue(x => x != null && x.OfType <object>().Any(), "HasAnyItem"); }
public static void IsNotNullOrWhiteSpace <T>(this AssertScope <T, string> helper) { helper.IsTrue( x => !string.IsNullOrWhiteSpace(x), "Is not null or white space"); }
public static void IsNotNull <T, TTarget>(this AssertScope <T, TTarget> helper) where TTarget : class { helper.IsTrue(x => x != null, "Is not null"); }
public static void IsBetween <T>(this AssertScope <T, decimal> a, decimal minValue, decimal maxValue) { a.IsTrue(x => x > 0, string.Format("Between({0},{1})", minValue, maxValue)); }