public async Task Should_Throw_Exception_With_Wrong_Id()
        {
            var id = Guid.NewGuid();

            var e = await Assert.ThrowsAsync <EntityNotFoundException>(async() =>
                                                                       await _clientAppService.GetAsync(id));

            e.EntityType.ShouldBe(typeof(Client));

            e = await Assert.ThrowsAsync <EntityNotFoundException>(async() =>
                                                                   await _clientAppService.DeleteAsync(id));

            e.EntityType.ShouldBe(typeof(Client));
        }
示例#2
0
        public async Task <IActionResult> Delete([FromRoute] int id)
        {
            try
            {
                await _clientAppService
                .DeleteAsync(id)
                .ConfigureAwait(false);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(NotFound(ex.Message));
            }
        }
示例#3
0
 public virtual Task DeleteAsync(Guid id)
 {
     return(_clientAppService.DeleteAsync(id));
 }