예제 #1
0
        public async Task GetCorrelationIdDetailsForPublishedProviderVersions()
        {
            UndoTaskDetails undoTaskDetails = await _repository
                                              .GetCorrelationIdDetailsForPublishedProviderVersions(CorrelationId);

            undoTaskDetails
            .Should()
            .BeEquivalentTo(new UndoTaskDetails
            {
                FundingStreamId = "DSG",
                FundingPeriodId = "FY-2021",
                TimeStamp       = 1588684299
            });
        }
        public async Task GetCorrelationIdDetailsForPublishedProviderVersions()
        {
            UndoTaskDetails expectedDetails = NewUndoTaskDetails();
            string          correlationId   = NewRandomString();

            GivenTheCorrelationIdDetailsForCosmosQuery(@"SELECT
                              MIN(p._ts) AS timeStamp,
                              p.content.fundingStreamId,
                              p.content.fundingPeriodId
                        FROM publishedProviderVersion p
                        WHERE p.documentType = 'PublishedProviderVersion'
                        AND p.content.correlationId = @correlationId
                        AND p.deleted = false
                        GROUP BY p.content.fundingStreamId,
                        p.content.fundingPeriodId",
                                                       correlationId,
                                                       expectedDetails);

            UndoTaskDetails actualDetails = await _repository.GetCorrelationIdDetailsForPublishedProviderVersions(correlationId);

            actualDetails
            .Should()
            .BeSameAs(expectedDetails);
        }