/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <typeparam name="T">Type of object being tested</typeparam> public static void Equal <T>( this IToAfterNot <T> continuation, T?expected ) where T : struct { continuation.Equal(expected, NULL_STRING); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="TInterface">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Implement <TInterface>( this IToAfterNot <Type> to, string customMessage ) { return(to.Implement <TInterface>(() => customMessage)); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <typeparam name="T">Type of object being tested</typeparam> public static void Equal <T>( this IToAfterNot <T> continuation, T expected ) { continuation.Equal(expected, NULL_STRING); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <typeparam name="TBase">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Inherit <TBase>( this IToAfterNot <Type> to, Func <string> customMessageGenerator ) { return(to.AddInheritsMatcher <TBase>(customMessageGenerator)); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="TBase">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Inherit <TBase>( this IToAfterNot <Type> to, string customMessage ) { return(to.AddInheritsMatcher <TBase>(() => customMessage)); }
/// <summary> /// Match the value under test with a simple Func which takes in your value /// and returns true if the test should pass. /// </summary> /// <param name="continuation">Continuation to act on</param> /// <param name="test">Func to test the original value with</param> /// <typeparam name="T"></typeparam> public static void Match <T>( this IToAfterNot <T> continuation, Func <T, bool> test ) { continuation.Match(test, NULL_STRING); }
/// <summary> /// Performs reference equality checking between your actual and the provided expected value /// </summary> /// <param name="be">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="T">Type of the object being tested</typeparam> public static IMore <T> Be <T>( this IToAfterNot <T> be, object expected, string customMessage) { return(be.Be(expected, () => customMessage)); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <typeparam name="T">Type of object being tested</typeparam> public static IMore <T> Equal <T>( this IToAfterNot <T> continuation, T?expected ) where T : struct { return(continuation.Equal(expected, NULL_STRING)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matcher">Continuation to operate on</param> /// <param name="regex">Regex string to match with</param> /// <returns>More continuation for Actual string</returns> public static IStringMore Match( this IToAfterNot <string> matcher, string regex ) { return(matcher.Match(regex, NULL_STRING)); }
/// <summary> /// Performs reference equality checking between your actual and the provided expected value /// </summary> /// <param name="be">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <typeparam name="T">Type of the object being tested</typeparam> public static void Be <T>( this IToAfterNot <T> be, object expected, Func <string> customMessageGenerator) { be.AddMatcher(CreateRefEqualMatcherFor <T>(expected, customMessageGenerator)); }
/// <summary> /// Performs reference equality checking between your actual and the provided expected value /// </summary> /// <param name="be">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="T">Type of the object being tested</typeparam> public static void Be <T>( this IToAfterNot <T> be, object expected, string customMessage) { be.Be(expected, () => customMessage); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="customMessageGenerator">Custom message to add to failure messages</param> /// <typeparam name="TInterface">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Implement <TInterface>( this IToAfterNot <Type> to, Func <string> customMessageGenerator ) { return(to.AddImplementsMatcher <TInterface>(customMessageGenerator)); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="expected">Interface type which should be implemented</param> /// <returns></returns> public static IMore <Type> Implement( this IToAfterNot <Type> to, Type expected ) { return(to.Implement(expected, NULL_STRING)); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="T">Type of object being tested</typeparam> public static IMore <T> Equal <T>( this IToAfterNot <T> continuation, T?expected, string customMessage ) where T : struct { return(continuation.Equal(expected, () => customMessage)); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <typeparam name="T">Type of object being tested</typeparam> public static void Equal <T>( this IToAfterNot <T> continuation, T?expected, string customMessage ) where T : struct { continuation.Equal(expected, () => customMessage); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="expected">Interface type which should be implemented</param> /// <param name="customMessageGenerator">Custom message to add to failure messages</param> /// <returns></returns> public static IMore <Type> Implement( this IToAfterNot <Type> to, Type expected, Func <string> customMessageGenerator ) { return(to.AddImplementsMatcher(expected, customMessageGenerator)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matcher">Continuation to operate on</param> /// <param name="regex">Regex string to match with</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <returns>More continuation for Actual string</returns> public static IStringMore Match( this IToAfterNot <string> matcher, string regex, string customMessage ) { return(matcher.Match(regex, () => customMessage)); }
/// <summary> /// Match the value under test with a simple Func which takes in your value /// and returns true if the test should pass. /// </summary> /// <param name="continuation">Continuation to act on</param> /// <param name="test">Func to test the original value with</param> /// <param name="customMessage">Message to include in the result upon failure</param> /// <typeparam name="T"></typeparam> public static void Match <T>( this IToAfterNot <T> continuation, Func <T, bool> test, string customMessage ) { continuation.Match(test, () => customMessage); }
/// <summary> /// Match the value under test with a simple Func which takes in your value /// and returns true if the test should pass. /// </summary> /// <param name="continuation">Continuation to act on</param> /// <param name="test">Func to test the original value with</param> /// <param name="customMessageGenerator">Generates a custom message to include in the result upon failure</param> /// <typeparam name="T"></typeparam> public static void Match <T>( this IToAfterNot <T> continuation, Func <T, bool> test, Func <string> customMessageGenerator ) { continuation.AddMatcher(MatchMatcherFor(test, customMessageGenerator)); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <param name="expected">Interface type which should be implemented</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <returns></returns> public static IMore <Type> Implement( this IToAfterNot <Type> to, Type expected, string customMessage ) { return(to.Implement(expected, () => customMessage)); }
/// <summary> /// Tests whether the Actual string is matched by the given Regex /// </summary> /// <param name="matcher">Continuation to operate on</param> /// <param name="regex">Regex string to match with</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <returns>More continuation for Actual string</returns> public static IStringMore Match( this IToAfterNot <string> matcher, string regex, Func <string> customMessageGenerator ) { AddRegexMatcher(matcher, regex, customMessageGenerator); return(matcher.More()); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <typeparam name="T">Type of object being tested</typeparam> public static IMore <T> Equal <T>( this IToAfterNot <T> continuation, T?expected, Func <string> customMessageGenerator ) where T : struct { return(continuation.AddMatcher( GenerateNullableEqualityMatcherFor(expected, customMessageGenerator) )); }
/// <summary> /// Performs equality checking -- the end of .To.Equal() /// </summary> /// <param name="continuation">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <typeparam name="T">Type of object being tested</typeparam> public static void Equal <T>( this IToAfterNot <T> continuation, T expected, Func <string> customMessageGenerator ) { continuation.AddMatcher( GenerateEqualityMatcherFor(expected, customMessageGenerator) ); }
/// <summary> /// Performs reference equality checking between your actual and the provided expected value /// </summary> /// <param name="be">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <typeparam name="T">Type of the object being tested</typeparam> public static IMore <T> Be <T>(this IToAfterNot <T> be, object expected) { return(be.Be(expected, NULL_STRING)); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <typeparam name="TInterface">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Implement <TInterface>( this IToAfterNot <Type> to ) { return(to.Implement <TInterface>(NULL_STRING)); }
/// <summary> /// Expects that the Actual type implements the interface provided /// as a generic parameter /// </summary> /// <param name="to">Continuation to operate on</param> /// <typeparam name="TBase">Interface type to look for</typeparam> /// <returns></returns> public static IMore <Type> Inherit <TBase>( this IToAfterNot <Type> to ) { return(to.Inherit <TBase>(NULL_STRING)); }
/// <summary> /// Performs reference equality checking between your actual and the provided expected value /// </summary> /// <param name="be">Continuation to operate on</param> /// <param name="expected">Expected value</param> /// <typeparam name="T">Type of the object being tested</typeparam> public static void Be <T>(this IToAfterNot <T> be, object expected) { be.Be(expected, NULL_STRING); }