Пример #1
0
 public async Task GetByIdAsyncWhenInvalidIdReturnsProgressNotFoundResponse()
 {
     // Arrange
     var mockProgressRepository = GetDefaultIProgressRepositoryInstance();
     var progressId = 1;
     mockProgressRepository.Setup(r => r.FindById(progressId))
         .Returns(Task.FromResult<Progress>(null));
     var mockUnitOfWork = GetDefaultIUnitOfWorkInstance();
     var service = new ProgressService(mockProgressRepository.Object, mockUnitOfWork.Object);
     // Act
     ProgressResponse result = await service.GetByIdAsync(progressId);
     var message = result.Message;
     // Assert
     message.Should().Be("Progress not found");
 }