예제 #1
0
        public async Task GivenAFeedRequest_WhenMaxContinuationSizeIsSet_ThenFeedRequestIsUpdated()
        {
            IDocumentClient client = new FhirDocumentClient(_innerClient, _fhirRequestContextAccessor, 5);

            _innerClient
            .ReadDatabaseFeedAsync(Arg.Is <FeedOptions>(o => o.ResponseContinuationTokenLimitInKb == 5))
            .Returns(CreateFeedResponse(Enumerable.Empty <Database>(), new NameValueCollection()));

            await client.ReadDatabaseFeedAsync();
        }
        public async Task GivenAFeedRequest_WhenMaxContinuationSizeIsSet_ThenFeedRequestIsUpdated()
        {
            IDocumentClient client = new FhirDocumentClient(_innerClient, _fhirRequestContextAccessor, 5, _cosmosResponseProcessor);

            _innerClient
            .ReadDatabaseFeedAsync(Arg.Is <FeedOptions>(o => o.ResponseContinuationTokenLimitInKb == 5))
            .Returns(new FeedResponse <Database>(Enumerable.Empty <Database>()));

            await client.ReadDatabaseFeedAsync();

            await _cosmosResponseProcessor.Received(1).ProcessResponse(Arg.Any <FeedResponse <Database> >());
        }