public async Task GetFundingStream_WhenFundingStreamFound_ShouldReturnOkResult()
        {
            // Arrange
            string fundingStreamId = "PSG";

            Models.Specs.FundingStream fundingStream = new Models.Specs.FundingStream
            {
                Id   = fundingStreamId,
                Name = "PE and Sport Grant",
                RequireFinancialEnvelopes = true
            };

            Mapper.Reset();
            MapperConfigurationExpression mappings = new MapperConfigurationExpression();

            mappings.AddProfile <ExternalApiMappingProfile>();
            Mapper.Initialize(mappings);
            IMapper mapper = Mapper.Instance;

            IFundingService mockFundingService = Substitute.For <IFundingService>();

            mockFundingService
            .GetFundingStreamById(Arg.Is(fundingStreamId))
            .Returns(new OkObjectResult(fundingStream));

            FundingStreamService fundingStreamService = new FundingStreamService(mockFundingService, mapper);

            // Act
            IActionResult result = await fundingStreamService.GetFundingStream(fundingStreamId);

            // Assert
            OkObjectResult okResult = result
                                      .Should()
                                      .BeOfType <OkObjectResult>()
                                      .Subject;

            FundingStream actualFundingStream = okResult.Value
                                                .Should()
                                                .BeOfType <FundingStream>()
                                                .Subject;

            actualFundingStream.Id.Should().Be(fundingStreamId);
            actualFundingStream.Name.Should().Be(fundingStream.Name);
            actualFundingStream.RequireFinancialEnvelopes.Should().Be(fundingStream.RequireFinancialEnvelopes);
        }
        public async Task GetFundingStream_WhenFundingStreamNotFound_ShouldReturnNotFoundResult()
        {
            // Arrange
            string fundingStreamId = "unknown";

            IMapper mapper = Substitute.For <IMapper>();

            IFundingService mockFundingService = Substitute.For <IFundingService>();

            mockFundingService
            .GetFundingStreamById(Arg.Is(fundingStreamId))
            .Returns(new NotFoundResult());

            FundingStreamService fundingStreamService = new FundingStreamService(mockFundingService, mapper);

            // Act
            IActionResult result = await fundingStreamService.GetFundingStream(fundingStreamId);

            // Assert
            result
            .Should()
            .BeOfType <NotFoundResult>();
        }