Пример #1
0
        internal async Task GivenDeleteBulkAsyncWhenDataExistThenDeletesData()
        {
            // Arrange
            mockSubscriptionService
            .Setup(_ => _.DeleteBulkAsync(It.IsAny <ICollection <Guid> >()))
            .Returns(Task.CompletedTask)
            .Verifiable();

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

            // Assert
            mockSubscriptionService.VerifyAll();
            result.Should().NotBeNull().And.BeOfType <NoContentResult>();
            (result as NoContentResult).StatusCode.Should().Be((int)HttpStatusCode.NoContent);
        }
        public async Task GivenDeleteBulkAsyncWhenDataExistThenDeletesData()
        {
            // Arrange
            mockSubscriptionService
            .Setup(_ => _.DeleteBulkAsync(It.IsAny <ICollection <Guid> >()))
            .Returns(Task.CompletedTask)
            .Verifiable();

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

            // Assert
            mockSubscriptionService.VerifyAll();
            Assert.That(result, Is.InstanceOf <NoContentResult>());
            Assert.That((result as NoContentResult).StatusCode, Is.EqualTo((int)HttpStatusCode.NoContent));
        }