コード例 #1
0
        public async Task DeleteAsync_TestRequestAndResponse()
        {
            var messageHandler = FakeResponseHandler.Create(HttpStatusCode.OK, endpoint, payload);
            var client         = new RestfulClient(endpoint, messageHandler);

            var testObject = await client.DeleteAsync <TestObject>(endpoint);

            Assert.IsNotNull(testObject);
            Assert.AreEqual(1, messageHandler.Requests.Count);

            var request = messageHandler.Requests.FirstOrDefault();

            Assert.AreEqual(HttpMethod.Delete, request.Method);
            Assert.AreEqual(new Uri(endpoint), request.RequestUri);
            Assert.IsNull(request.Content);
        }