public async Task TestPostInputWithOutput() { var client = new WebApiClient(TestClient); var url = "/api/webapiclienttest/TestPostInputWithOutput"; var response = await client.PostAsync(url, WaterBottle.CreateInstance()); Assert.AreEqual("Ozarka", response.ResponseValue.Brand); TestHttpResults(response); }
public async Task TestPutInputWithDifferentOutput() { var client = new WebApiClient(TestClient); var url = "/api/webapiclienttest/TestPutInputWithDifferentOutput"; var response = await client.PutAsync <Speaker, WaterBottle>(url, WaterBottle.CreateInstance()); Assert.AreEqual("JBL", response.ResponseValue.Brand); TestHttpResults(response); }
public async Task TestPostInputNoOutput() { var client = new WebApiClient(TestClient); var url = "/api/webapiclienttest/TestPostInputNoOutput"; var response = await client.PostAsync(url, WaterBottle.CreateInstance()); Assert.IsNull(response.ResponseValue); TestHttpResults(response); }
public async Task <IActionResult> TestGetObject() { var returnValue = await Task.FromResult(WaterBottle.CreateInstance()); return(Ok(returnValue)); }