private IBaseTestBuilderWithCaughtException RedirectTo <TController>(LambdaExpression actionCall) where TController : ApiController { var redirectToRouteResult = this.GetRedirectResult <RedirectToRouteResult>(RouteName); RouteValidator.Validate <TController>( redirectToRouteResult.Request, redirectToRouteResult.RouteName, redirectToRouteResult.RouteValues, actionCall, this.ThrowNewRedirectResultAssertionException); return(this); }
private IAndCreatedTestBuilder AtRoute <TController>(LambdaExpression actionCall) where TController : ApiController { RuntimeBinderValidator.ValidateBinding(() => { var createdAtRouteResult = this.GetActionResultAsDynamic(); RouteValidator.Validate <TController>( createdAtRouteResult.Request, createdAtRouteResult.RouteName, createdAtRouteResult.RouteValues, actionCall, new Action <string, string, string>(this.ThrowNewCreatedResultAssertionException)); }); return(this); }
public void RouteValidatorTest() { var routeValidator = new RouteValidator(); var route = new Route(); ValidationResults result = routeValidator.Validate(route); }