/// <summary> /// Assigns the argument found at the specified <paramref name="index"/> of the stub (or expected) call /// through the <paramref name="assign"/> lambda received. /// <para> An exception is thrown if the method doesn't have the specified argument or he is not of the expected type. </para> /// </summary> /// /// <typeparam name="TArgument"> Type of the argument.</typeparam> /// <param name="options"></param> /// <param name="index">The index of the argument we are looking for</param> /// <param name="assign">The lambda that will be called with the argument value (C#: x => ... / VB: Sub(x) ...) </param> public static IMethodOptions <object> AssignArgument <TArgument>(this IMethodOptions <object> options, int index, Action <TArgument> assign) { return(options.AssignArgument <object, TArgument>(index, assign)); }
/// <summary> /// Assigns the first argument of the stub (or expected) call through the <paramref name="assign"/> lambda /// received. /// <para> An exception is thrown if the method has no argument or the first one is not of the expected type. </para> /// </summary> /// /// <typeparam name="T"> Type of the mocked object </typeparam> /// <typeparam name="TFirstArgument"> Type of the first argument.</typeparam> /// <param name="options"></param> /// <param name="assign">The lambda that will be called with the first argument value (C#: x => ... / VB: Sub(x) ...) </param> public static IMethodOptions <T> AssignFirstArgument <T, TFirstArgument>(this IMethodOptions <T> options, Action <TFirstArgument> assign) { return(options.AssignArgument <T, TFirstArgument>(0, assign)); }