Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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));
        }