public async Task GetAllAsyncWhenNoPublicationsReturnsEmptyCollection() { //Arrange var mockPublicationRepository = GetDefaultIPublicationRepositoryInstance(); var mockUnitOfWork = GetDefaultIUnitOfWorkInstance(); var publicationId = 200; mockPublicationRepository.Setup(r => r.FindById(publicationId)) .Returns(Task.FromResult <Publication>(null)); var service = new PublicationService(mockPublicationRepository.Object, mockUnitOfWork.Object); //Act PublicationResponse result = await service.GetByIdAsync(publicationId); var message = result.Message; //Assert message.Should().Be("Publication not found"); }