public static IAssert <T> Fulfills <T, TMember>(
     this IAssertMember <T, TMember> member,
     Func <IAssert <TMember>, IAssert <TMember> > assertion)
 {
     return
         (member.SetAssertion(
              new AssertToAssertValueAdapter <TMember>(assertion(new ObjectAssertion <TMember>()))));
 }
Example #2
0
 public static IAssert <T> IsEqualTo <T, TItem>(this IAssertMember <T, IList <TItem> > member, IList <TItem> expectedItems)
 {
     return(member.SetAssertion(new Assertions.MemberAssertions.Lists.EqualAssertion <TItem>(expectedItems)));
 }
Example #3
0
 public static IAssert <T> FulfilAll <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, Expression <Func <TElement, bool> > expected)
 {
     return(member.SetAssertion(new AllFulfilPredicateAssertion <TElement>(expected)));
 }
Example #4
0
 public static IAssert <T> HasNonePredicate <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, Expression <Func <TElement, bool> > predicate)
 {
     return(member.SetAssertion(new NoneFulfilsPredicateAssertion <TElement>(predicate)));
 }
Example #5
0
 public static IAssert <T> DoesntContain <T, TItem>(this IAssertMember <T, IEnumerable <TItem> > member, params TItem[] expectedItems)
 {
     return(member.SetAssertion(new ContainsNotAssertion <TItem>(expectedItems)));
 }
Example #6
0
 public static IAssert <T> ContainsInOrder <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, IList <TElement> expectedElements)
 {
     return(member.SetAssertion(new ContainsInOrderAssertion <TElement>(expectedElements)));
 }
Example #7
0
 public static IAssert <T> HasAny <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, params Func <IAssert <TElement>, IAssert <TElement> >[] assertions)
 {
     return(member.SetAssertion(new HasAnyMultipleAssertion <TElement>(assertions.Map(assertion => assertion(new ObjectAssertion <TElement>())))));
 }
Example #8
0
 public static IAssert <T> StartsWith <T>(this IAssertMember <T, string> member, string expectedStart)
 {
     return(member.SetAssertion(new StartsWithAssertion(expectedStart)));
 }
Example #9
0
 public static IAssert <T> DoesntEndWith <T>(this IAssertMember <T, string> member, string expected)
 {
     return(member.SetAssertion(new EndsNotWithAssertion(expected)));
 }
Example #10
0
 public static IAssert <T> IsEqualTo <T>(this IAssertMember <T, string> member, string expected)
 {
     return(member.SetAssertion(new EqualAssertion(expected)));
 }
Example #11
0
 public static IAssert <T> HasLength <T>(this IAssertMember <T, string> member, int expectedLength)
 {
     return(member.SetAssertion(new HasLengthAssertion(expectedLength)));
 }
 public static IAssert <T> IsNull <T, TMember>(this IAssertMember <T, TMember> member)
     where TMember : class
 {
     return(member.SetAssertion(new IsNullAssertion <TMember>()));
 }
 public static IAssert <T> IsEqualToAny <T, TMember>(this IAssertMember <T, TMember> member,
                                                     params TMember[] expectedValues)
 {
     return(member.SetAssertion(new IsEqualToAnyAssertion <TMember>(expectedValues)));
 }
 public static IAssert <T> Printout <T, TMember>(this IAssertMember <T, TMember> member)
 {
     return(member.SetAssertion(new PrintoutAssertion <TMember>()));
 }
Example #15
0
 public static IAssert <T> IsPositive <T>(this IAssertMember <T, TimeSpan> member)
 {
     return(member.SetAssertion(new IsPositiveAssertion()));
 }
Example #16
0
 public static IAssert <T> DoesntContain <T>(this IAssertMember <T, string> member, string expected)
 {
     return(member.SetAssertion(new ContainsNotAssertion(expected)));
 }
Example #17
0
 public static IAssert <T> IsSubsetOf <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, IEnumerable <TElement> expectedSuperset)
 {
     return(member.SetAssertion(new IsSubsetOfAssertion <TElement>(expectedSuperset)));
 }
Example #18
0
 public static IAssert <T> IsNull <T>(this IAssertMember <T, string> member)
 {
     return(member.SetAssertion(new IsNullAssertion()));
 }
Example #19
0
 public static IAssert <T> IsNotEmpty <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member)
 {
     return(member.SetAssertion(new IsNotEmptyAssertion <TElement>()));
 }
Example #20
0
 public static IAssert <T> IsInRange <T, TMember>(this IAssertMember <T, TMember> member, TMember min, TMember max)
     where TMember : IComparable <TMember>
 {
     return(member.SetAssertion(new InRangeAssertion <TMember>(min, max)));
 }
Example #21
0
 public static IAssert <T> HasNone <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, Func <IAssert <TElement>, IAssert <TElement> > assertion)
 {
     return(member.SetAssertion(new HasNoneAssertion <TElement>(assertion(new ObjectAssertion <TElement>()))));
 }
Example #22
0
 public static IAssert <T> IsGreaterOrEqualTo <T, TMember>(this IAssertMember <T, TMember> member, TMember expected)
     where TMember : IComparable <TMember>
 {
     return(member.SetAssertion(new GreaterOrEqualAssertion <TMember>(expected)));
 }
Example #23
0
 public static IAssert <T> HasCount <T, TMember>(this IAssertMember <T, IEnumerable <TMember> > member, int expected)
 {
     return(member.SetAssertion(new HasCountAssertion <TMember>(expected)));
 }
Example #24
0
 public static IAssert <T> IsLessThan <T, TMember>(this IAssertMember <T, TMember> member, TMember expected)
     where TMember : IComparable <TMember>
 {
     return(member.SetAssertion(new LessThanAssertion <TMember>(expected)));
 }
Example #25
0
 public static IAssert <T> DoesntContainNulls <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member)
 {
     return(member.SetAssertion(new ContainsNoNullsAssertion <TElement>()));
 }
Example #26
0
 public static IAssert <T> IsNotEqualTo <T>(this IAssertMember <T, TimeSpan> member, TimeSpan expected)
 {
     return(member.SetAssertion(new NotEqualAssertion <TimeSpan>(expected)));
 }
Example #27
0
 public static IAssert <T> IsEquivalentTo <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, IEnumerable <TElement> expected)
 {
     return(member.SetAssertion(new EquivalentAssertion <TElement>(expected)));
 }
Example #28
0
 public static IAssert <T> IsCloseTo <T>(this IAssertMember <T, TimeSpan> member, TimeSpan expected, TimeSpan range)
 {
     return(member.SetAssertion(new IsCloseToAssertion(expected, range)));
 }
Example #29
0
 public static IAssert <T> EndsWith <T, TElement>(this IAssertMember <T, IEnumerable <TElement> > member, TElement expected)
 {
     return(member.SetAssertion(new EndsWithAssertion <TElement>(expected)));
 }
 public static IAssert <T> IsEqualTo <T, TMember>(this IAssertMember <T, TMember> member, TMember expected)
 {
     return(member.SetAssertion(new EqualAssertion <TMember>(expected)));
 }