Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> TestGetObject()
        {
            var returnValue = await Task.FromResult(WaterBottle.CreateInstance());

            return(Ok(returnValue));
        }