コード例 #1
0
        public async Task ListAsyncWhenNoProgresssReturnsEmptyCollection()
        {
            var mockProgressRepository = GetDefaultIProgressRepositoryInstance();
            mockProgressRepository.Setup(r => r.ListAsync())
                .ReturnsAsync(new List<Progress>());
            var mockUnitOfWork = GetDefaultIUnitOfWorkInstance();
            var service = new ProgressService(
                mockProgressRepository.Object,
                mockUnitOfWork.Object);

            // Act
            List<Progress> result = (List<Progress>)await service.ListAsync();
            int progressesCount = result.Count;

            // Assert
            progressesCount.Should().Equals(0);
        }