internal async Task GivenDeleteBulkAsyncWhenDataExistThenDeletesData()
        {
            // Arrange
            mockChannelService
            .Setup(_ => _.DeleteBulkAsync(It.IsAny <ICollection <int> >()))
            .Returns(Task.CompletedTask)
            .Verifiable();

            // Act
            var result = await channelController.DeleteBulkAsync(It.IsAny <ICollection <int> >());

            // Assert
            mockChannelService.VerifyAll();
            Assert.IsType <NoContentResult>(result);
            Assert.Equal((int)HttpStatusCode.NoContent, (result as NoContentResult).StatusCode);
        }
Exemplo n.º 2
0
        public async Task GivenDeleteBulkAsyncWhenDataExistThenDeletesData()
        {
            // Arrange
            mockChannelService
            .Setup(_ => _.DeleteBulkAsync(It.IsAny <ICollection <int> >()))
            .Returns(Task.CompletedTask)
            .Verifiable();

            // Act
            var result = await channelController.DeleteBulkAsync(It.IsAny <ICollection <int> >());

            // Assert
            mockChannelService.VerifyAll();
            result.Should().NotBeNull().And.BeOfType <NoContentResult>();
            (result as NoContentResult).StatusCode.Should().Be((int)HttpStatusCode.NoContent);
        }