internal async Task GivenDeleteBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
        {
            // Arrange

            // Act
            var exception = await Assert.ThrowsAsync <NotImplementedException>(
                () => videoService.DeleteBulkAsync(It.IsAny <IEnumerable <Guid> >()));

            // Assert
            exception.Should().NotBeNull().And.BeOfType <NotImplementedException>();
        }
        public void GivenDeleteBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
        {
            // Arrange

            // Act
            var exception = Assert.ThrowsAsync <NotImplementedException>(
                () => videoService.DeleteBulkAsync(It.IsAny <IEnumerable <Guid> >()));

            // Assert
            Assert.That(exception, Is.Not.Null);
            Assert.That(exception, Is.TypeOf <NotImplementedException>());
        }
Exemplo n.º 3
0
        public void GivenDeleteBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
        {
            // Arrange

            // Act
            var exception = Assert.ThrowsAsync <NotImplementedException>(
                () => videoService.DeleteBulkAsync(It.IsAny <IEnumerable <Guid> >()));

            // Assert
            exception.ShouldNotBeNull();
            exception.ShouldBeOfType <NotImplementedException>();
        }
Exemplo n.º 4
0
        public async Task <IActionResult> DeleteBulkAsync([FromQuery] ICollection <Guid> ids)
        {
            try
            {
                await videoService.DeleteBulkAsync(ids);

                return(NoContent());
            }
            catch (ApplicationException)
            {
                return(NotFound());
            }
            catch
            {
                return(BadRequest());
            }
        }