Esempio n. 1
0
        public async Task GetCorrelationDetailsForPublishedProviders()
        {
            UndoTaskDetails undoTaskDetails = await _repository
                                              .GetCorrelationDetailsForPublishedProviders(CorrelationId);

            undoTaskDetails
            .Should()
            .BeEquivalentTo(new UndoTaskDetails
            {
                FundingStreamId = "DSG",
                FundingPeriodId = "FY-2021-7db621f6-ff28-4910-a3b2-5440c2cd80b0",
                TimeStamp       = 1588682808
            });
        }
        public async Task GetCorrelationDetailsForPublishedProviders()
        {
            UndoTaskDetails expectedDetails = NewUndoTaskDetails();
            string          correlationId   = NewRandomString();

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

            UndoTaskDetails actualDetails = await _repository.GetCorrelationDetailsForPublishedProviders(correlationId);

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