public async Task GetContinuousChangesAsync_WithDesignFilter()
        {
            using var httpTest = new HttpTest();

            // Arrange
            var tokenSource = new CancellationTokenSource();
            var docId       = SetFeedResponse(httpTest);

            httpTest.RespondWithJson(new { ok = true });

            var filter = ChangesFeedFilter.Design();

            // Act
            await foreach (var change in _rebels.GetContinuousChangesAsync(null, filter, tokenSource.Token))
            {
                Assert.Equal(docId, change.Id);
                tokenSource.Cancel();
            }

            // Assert
            httpTest
            .ShouldHaveCalled("http://localhost/rebels/_changes")
            .WithQueryParamValue("feed", "continuous")
            .WithQueryParamValue("filter", "_design")
            .WithVerb(HttpMethod.Get);
        }
Пример #2
0
        public async Task GetChangesAsync_WithDesignFilter()
        {
            using var httpTest = new HttpTest();

            // Arrange
            SetFeedResponse(httpTest);
            httpTest.RespondWithJson(new { ok = true });

            var filter = ChangesFeedFilter.Design();

            // Act
            var newR = await _rebels.GetChangesAsync(null, filter);

            // Assert
            httpTest
            .ShouldHaveCalled("http://localhost/rebels/_changes")
            .WithQueryParamValue("filter", "_design")
            .WithVerb(HttpMethod.Get);
        }