public Task Delete(EchoRequestModel echoRequest) { // Create the HttpRequest with get verb, the request model will be serialized in query string HttpRequestMessage Request() => _client.CreateDelete("delete", echoRequest); // Send your request and receive the response deserialized using the specified type return(_client.SendAsync(Request)); }
public Task <EchoPostResponseModel> Put(EchoRequestModel echoRequest) { // Create the HttpRequest with put verb and no query string HttpRequestMessage Request() => _client.CreatePut("put", echoRequest); // Send your request and receive the response deserialized using the specified type return(_client.SendAsync <EchoPostResponseModel>(Request)); }
public async Task Delete() { var echoRequestModel = new EchoRequestModel { Name = "Perry", Surname = "the Platypus", Age = 11, Enabled = true, Birthday = new DateTime(2021, 01, 01) }; await _sut2.Delete(echoRequestModel); }
public async Task Get() { var echoRequestModel = new EchoRequestModel { Name = "Perry", Surname = "the Platypus", Age = 11, Enabled = true, Birthday = new DateTime(2021, 01, 01) }; var results = await _sut2.Get(echoRequestModel); Assert.IsNotNull(results); Assert.AreEqual(echoRequestModel.Name, results.Args.Name); Assert.AreEqual(echoRequestModel.Surname, results.Args.Surname); Assert.AreEqual(echoRequestModel.Age, results.Args.Age); Assert.AreEqual(echoRequestModel.Birthday, results.Args.Birthday); Assert.AreEqual(echoRequestModel.Enabled, results.Args.Enabled); }