public static Task <T> GetAsync <TController, T>( this ApiControllerTest <TController> test, string url, Expression <Func <HttpResponseMessage, T> > expression) where TController : ApiController { return(test.HttpRequest(HttpMethod.Get, url, expression)); }
public static ApiControllerTest <T> Test <T>( this T controller, IEnumerable <DelegatingHandler> messageHandlers = null, IEnumerable <IFilter> filters = null, Action <HttpConfiguration> customSetup = null) where T : ApiController { return(ApiControllerTest <T> .Get(controller, messageHandlers, filters, customSetup)); }
public static Task <T> PostAsync <TController, T>( this ApiControllerTest <TController> test, string url, Expression <Func <HttpResponseMessage, T> > expression, string body = null) where TController : ApiController { var action = body != null ? r => SetBody(r, body) : new Action <HttpRequestMessage>(r => { }); return(test.HttpRequest(HttpMethod.Post, url, expression, action)); }