Пример #1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _studiosService.Delete(id);

                return(Ok());
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Пример #2
0
        public void DeleteCastTest()
        {
            CreateStudioDto myDeleteExceptionCast = new CreateStudioDto();

            Task.WaitAll(Assert.ThrowsExceptionAsync <ArgumentOutOfRangeException>(() => _StudiosService.Delete(-1), "Id cannot be lower than 1."));
        }