Ejemplo n.º 1
0
        public async Task <bool> DeleteAsync(string urlExtension, string id, string token = null)
        {
            _loggerWrapper.LogInformation(nameof(urlExtension) + ": " + urlExtension + " | " + nameof(id) + ": " + id + " | " + nameof(token) + ": " + token, this.GetType().Name, nameof(DeleteAsync) + "()", null);

            return(await CheckExceptions(async() =>
                                         (await _httwrap.DeleteAsync(urlExtension + "/" + id, null,
                                                                     token != null ? GetCustomHeaders(token) : null)).Success));
        }
Ejemplo n.º 2
0
        public async void Delete_test()
        {
            var product = FixtureRepository.Build <Product>().Without(p => p.Id).Create();
            await _client.PostAsync("api/products", product);

            var response = await _client.DeleteAsync("api/products/1");

            response.Should().NotBeNull();
            response.StatusCode.Should().Be(HttpStatusCode.NoContent);
        }
 protected async Task <IHttwrapResponse> DeleteAsync(string urlExtension, string token = null) =>
 await CheckExceptions(async() => await _httwrapClient.DeleteAsync(urlExtension, null, token != null ? GetCustomHeaders(token) : null));