public void GetPublishedProviderVersionsFromVersion()
        {
            string  fundingStreamId = NewRandomString();
            string  fundingPeriodId = NewRandomString();
            decimal version         = NewRandomInteger();

            ICosmosDbFeedIterator <PublishedProviderVersion> expectedFeed = NewFeedIterator <PublishedProviderVersion>();

            GivenTheFeedIterator(@"SELECT
                              *
                        FROM publishedProviderVersion p
                        WHERE p.documentType = 'PublishedProviderVersion'
                        AND StringToNumber(CONCAT(Tostring(p.content.majorVersion), '.', Tostring(p.content.minorVersion))) >= @version
                        AND p.content.fundingStreamId = @fundingStreamId
                        AND p.content.fundingPeriodId = @fundingPeriodId
                        AND p.deleted = false",
                                 expectedFeed,
                                 ("@fundingPeriodId", fundingPeriodId),
                                 ("@fundingStreamId", fundingStreamId),
                                 ("@version", version));

            ICosmosDbFeedIterator <PublishedProviderVersion> actualFeedIterator = _repository.GetPublishedProviderVersionsFromVersion(fundingStreamId,
                                                                                                                                      fundingPeriodId,
                                                                                                                                      version);

            actualFeedIterator
            .Should()
            .BeSameAs(expectedFeed);
        }
コード例 #2
0
        public async Task GetPublishedProviderVersionsFromVersion()
        {
            ICosmosDbFeedIterator <PublishedProviderVersion> feed = _repository.GetPublishedProviderVersionsFromVersion("DSG",
                                                                                                                        "FY-2021",
                                                                                                                        2M);

            feed.HasMoreResults
            .Should()
            .BeTrue();

            IEnumerable <PublishedProviderVersion> documents = await feed.ReadNext();

            documents
            .Should()
            .NotBeEmpty();
        }