/// <summary> /// Asserts against an expected attribute, with a matcher for the attribute /// </summary> /// <param name="with"></param> /// <param name="customMessage"></param> /// <typeparam name="TAttribute"></typeparam> /// <returns></returns> public static IMore <MethodInfo> Attribute <TAttribute>( this IWith <MethodInfo> with, string customMessage ) where TAttribute : Attribute { return(with.Attribute <TAttribute>(() => customMessage)); }
/// <summary> /// Asserts against an expected attribute, with a matcher for the attribute /// </summary> /// <param name="with"></param> /// <param name="matcher"></param> /// <param name="customMessage"></param> /// <typeparam name="TAttribute"></typeparam> /// <returns></returns> public static IMore <MethodInfo> Attribute <TAttribute>( this IWith <MethodInfo> with, Func <TAttribute, bool> matcher, string customMessage ) where TAttribute : Attribute { return(with.Attribute( matcher, () => customMessage )); }
/// <summary> /// Asserts against an expected attribute, with a matcher for the attribute /// </summary> /// <param name="with"></param> /// <param name="matcher"></param> /// <typeparam name="TAttribute"></typeparam> /// <returns></returns> public static IMore <MethodInfo> Attribute <TAttribute>( this IWith <MethodInfo> with, Func <TAttribute, bool> matcher ) where TAttribute : Attribute { return(with.Attribute( matcher, NULL_STRING )); }
/// <summary> /// Asserts against an expected attribute, with a matcher for the attribute /// </summary> /// <param name="with"></param> /// <param name="customMessageGenerator"></param> /// <typeparam name="TAttribute"></typeparam> /// <returns></returns> public static IMore <MethodInfo> Attribute <TAttribute>( this IWith <MethodInfo> with, Func <string> customMessageGenerator ) where TAttribute : Attribute { return(with.Attribute( null as Func <TAttribute, bool>, customMessageGenerator )); }
/// <summary> /// Asserts against an expected attribute, with a matcher for the attribute /// </summary> /// <param name="with"></param> /// <typeparam name="TAttribute"></typeparam> /// <returns></returns> public static IMore <MethodInfo> Attribute <TAttribute>( this IWith <MethodInfo> with ) where TAttribute : Attribute { return(with.Attribute <TAttribute>(NULL_STRING)); }