public async Task HttpTriggerTestsMediaTypeDoNotMatter(string functionName, string body, string mediaType, HttpStatusCode expectedStatusCode, string expectedBody) { HttpResponseMessage response = await HttpHelpers.InvokeHttpTriggerWithBody(functionName, body, expectedStatusCode, mediaType); string responseBody = await response.Content.ReadAsStringAsync(); Assert.Equal(expectedStatusCode, response.StatusCode); Assert.Equal(expectedBody, responseBody); }
public async Task HttpTriggerTestsPocoResult() { HttpResponseMessage response = await HttpHelpers.InvokeHttpTriggerWithBody("HelloUsingPoco", string.Empty, HttpStatusCode.OK, "application/json"); string responseBody = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal($"{{{Environment.NewLine} \"Name\": \"Test\"{Environment.NewLine}}}", responseBody); }
public async Task HttpProxy() { HttpResponseMessage response = await HttpHelpers.InvokeHttpTriggerWithBody("proxytest", string.Empty, HttpStatusCode.OK, "application/json"); string responseBody = await response.Content.ReadAsStringAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("Proxy response", responseBody); }