Esempio n. 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));
 }
Esempio n. 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
                ));
 }
Esempio n. 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
                ));
 }
Esempio n. 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
                ));
 }
Esempio n. 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
                ));
 }
Esempio n. 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
             );
     }));
 }