public async Task GetDelegatesToCosmos() { FundingStreamPeriodProfilePattern expectedProfilePattern = NewProfilePattern(); GivenTheProfilePattern(expectedProfilePattern); FundingStreamPeriodProfilePattern actualProfilePattern = await WhenTheProfilePatternIsQueried(expectedProfilePattern.Id); actualProfilePattern .Should() .BeSameAs(expectedProfilePattern); }
public async Task GetByKeyComponentsDelegatesToCosmos() { FundingStreamPeriodProfilePattern expectedProfilePattern = NewProfilePattern(); GivenTheProfilePattern(expectedProfilePattern); FundingStreamPeriodProfilePattern actualProfilePattern = await WhenTheProfilePatternIsQueried(expectedProfilePattern.FundingPeriodId, expectedProfilePattern.FundingStreamId, expectedProfilePattern.FundingLineId, expectedProfilePattern.ProfilePatternKey); actualProfilePattern .Should() .BeSameAs(expectedProfilePattern); }
public async Task GetPatternsBuildsKeyQueriesCosmosAndCachesResultIfNotCached(string fundingPeriodId, string fundingStreamId, string fundingLineCode, string profilePatternKey) { FundingStreamPeriodProfilePattern expectedPattern = NewProfilePattern(_ => _.WithProfilePatternKey(profilePatternKey) .WithFundingLineId(fundingLineCode) .WithFundingPeriodId(fundingPeriodId) .WithFundingStreamId(fundingStreamId)); GivenTheProfilePattern(expectedPattern); FundingStreamPeriodProfilePattern result = await WhenTheProfilePatternIsQueried(fundingStreamId, fundingPeriodId, fundingLineCode, profilePatternKey); result .Should() .BeSameAs(expectedPattern); AndTheProfilePatternWasCached(expectedPattern); }