/// <inheritdoc /> public IAndRedirectTestBuilder ToAction(string actionName) { var redirectAtActionResult = this.GetRedirectResult <RedirectToActionResult>("action name"); RouteActionResultValidator.ValidateActionName( redirectAtActionResult, actionName, this.ThrowNewRedirectResultAssertionException); return(this); }
/// <inheritdoc /> public IAndCreatedTestBuilder AtAction(string actionName) { var createdAtActionResult = this.GetCreatedResult <CreatedAtActionResult>("action name"); RouteActionResultValidator.ValidateActionName( createdAtActionResult, actionName, this.ThrowNewCreatedResultAssertionException); return(this); }
/// <summary> /// Tests whether the <see cref="RedirectToActionResult"/> /// has specific action name. /// </summary> /// <param name="redirectTestBuilder"> /// Instance of <see cref="IRedirectTestBuilder"/> type. /// </param> /// <param name="actionName">Expected action name.</param> /// <returns>The same <see cref="IAndRedirectTestBuilder"/>.</returns> public static IAndRedirectTestBuilder ToAction( this IRedirectTestBuilder redirectTestBuilder, string actionName) { var actualBuilder = GetRedirectTestBuilder <RedirectToActionResult>(redirectTestBuilder, "action name"); RouteActionResultValidator.ValidateActionName( actualBuilder.ActionResult, actionName, actualBuilder.ThrowNewFailedValidationException); return(actualBuilder); }
/// <summary> /// Tests whether the <see cref="AcceptedAtActionResult"/> /// has specific action name. /// </summary> /// <param name="acceptedTestBuilder"> /// Instance of <see cref="IAcceptedTestBuilder"/> type. /// </param> /// <param name="actionName">Expected action name.</param> /// <returns>The same <see cref="IAndAcceptedTestBuilder"/>.</returns> public static IAndAcceptedTestBuilder AtAction( this IAcceptedTestBuilder acceptedTestBuilder, string actionName) { var actualBuilder = GetAcceptedTestBuilder <AcceptedAtActionResult>( acceptedTestBuilder, "action name"); RouteActionResultValidator.ValidateActionName( actualBuilder.ActionResult, actionName, actualBuilder.ThrowNewFailedValidationException); return(actualBuilder); }