Example #1
0
 /// <summary>
 /// Asserts that the given collection is ordered ascending with the
 /// provided comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <param name="comparer">Comparer for two items of type T,
 /// implementing IComparer&lt;T&gt;</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Ascending <T>(
     this ICollectionOrdered <T> collectionOrdered,
     IComparer <T> comparer
     )
 {
     return(collectionOrdered.Ascending(comparer, NULL_STRING));
 }
Example #2
0
 /// <summary>
 /// Asserts that the given collection is ordered ascending with the
 /// default comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Ascending <T>(
     this ICollectionOrdered <T> collectionOrdered
     )
 {
     return(collectionOrdered.Ascending(
                Comparer <T> .Default
                ));
 }
Example #3
0
 /// <summary>
 /// Asserts that the given collection is ordered ascending with the
 /// default comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <param name="customMessage">Custom message to include when assertion fails</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Ascending <T>(
     this ICollectionOrdered <T> collectionOrdered,
     string customMessage)
 {
     return(collectionOrdered.Ascending(
                Comparer <T> .Default,
                customMessage
                ));
 }
Example #4
0
 /// <summary>
 /// Asserts that the given collection is ordered descending with the
 /// default comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <param name="customMessageGenerator">
 /// Generates a custom message to include when assertion fails</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Descending <T>(
     this ICollectionOrdered <T> collectionOrdered,
     Func <string> customMessageGenerator
     )
 {
     return(collectionOrdered.Descending(
                Comparer <T> .Default,
                customMessageGenerator
                ));
 }
Example #5
0
 /// <summary>
 /// Asserts that the given collection is ordered descending with the
 /// provided comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <param name="comparer">Comparer for two items of type T,
 /// implementing IComparer&lt;T&gt;</param>
 /// <param name="customMessage">Custom message to include when assertion fails</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Descending <T>(
     this ICollectionOrdered <T> collectionOrdered,
     IComparer <T> comparer,
     string customMessage
     )
 {
     return(collectionOrdered.Descending(
                comparer,
                () => customMessage
                ));
 }
Example #6
0
 /// <summary>
 /// Asserts that the given collection is ordered descending with the
 /// provided comparer for T. A collection with less than 2 items will
 /// always fail.
 /// </summary>
 /// <param name="collectionOrdered">Continuation</param>
 /// <param name="comparer">Comparer for two items of type T,
 /// implementing IComparer&lt;T&gt;</param>
 /// <param name="customMessageGenerator">
 /// Generates a custom message to include when assertion fails</param>
 /// <typeparam name="T">Collection item type</typeparam>
 /// <returns></returns>
 public static IMore <IEnumerable <T> > Descending <T>(
     this ICollectionOrdered <T> collectionOrdered,
     IComparer <T> comparer,
     Func <string> customMessageGenerator
     )
 {
     return(collectionOrdered.AddMatcher(
                actual =>
     {
         return TestOrderingOf(
             actual,
             comparer,
             i => i < 0,
             customMessageGenerator
             );
     }));
 }