コード例 #1
0
        public async Task GetByIdAsyncWhenNoStartupFoundReturnsStartupNotFoundResponse()
        {
            // Arrange
            var mockStartupRepository = GetDefaultIStartupRepositoryInstance();
            var mockUnitOfWork        = GetDefaultIUnitOfWorkInstance();
            var startupId             = 1;

            mockStartupRepository.Setup(r => r.FindById(startupId))
            .Returns(Task.FromResult <Domain.Models.Startup>(null));

            var service = new StartupService(mockStartupRepository.Object, mockUnitOfWork.Object);

            // Act
            StartupResponse result = await service.GetByIdAsync(startupId);

            var message = result.Message;

            // Assert
            message.Should().Be("Startup not found");
        }