Пример #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));
 }
Пример #2
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));
        }