Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #4
0
        public async Task <IActionResult> TestGetObject()
        {
            var returnValue = await Task.FromResult(WaterBottle.CreateInstance());

            return(Ok(returnValue));
        }