public async Task SelectSpecificationForFunding_GivenNoFundingStreamAlreadySelectedInPeriod_ReturnsConflict() { Specification specification = CreateSpecification(); Specification specificationWithFundingStreamClash = CreateSpecification(); SpecificationVersion currentVersionOfSpecification = specification.Current; string commonFundingStreamId = currentVersionOfSpecification.FundingStreams.First().Id; specificationWithFundingStreamClash.Current.FundingStreams.First().Id = commonFundingStreamId; ISpecificationsRepository specificationsRepository = CreateSpecificationsRepository(); specificationsRepository .GetSpecificationById(SpecificationId) .Returns(specification); specificationsRepository .GetSpecificationsSelectedForFundingByPeriod(currentVersionOfSpecification.FundingPeriod.Id) .Returns(new[] { specificationWithFundingStreamClash }); IActionResult result = await CreateService( logs : CreateLogger(), specificationsRepository : specificationsRepository) .SelectSpecificationForFunding(SpecificationId); result .Should() .BeOfType <ConflictResult>(); }