public async Task PutDocuments_ShouldSucceed()
        {
            var response = await _docClient.PostDocumentsAsync(_testCollection,
                                                               new[] {
                new { value = 1 },
                new { value = 2 }
            });

            var updateResponse = await _docClient.PutDocumentsAsync(_testCollection,
                                                                    new[]
            {
                new { response[0]._key, value = 3 },
                new { response[1]._key, value = 4 }
            });

            Assert.NotNull(response[0]._rev);
            Assert.NotNull(updateResponse[0]._rev);
            Assert.NotNull(updateResponse[0]._oldRev);
            Assert.NotEqual(response[0]._rev, updateResponse[0]._rev);
            Assert.Equal(response[0]._rev, updateResponse[0]._oldRev);

            Assert.NotNull(response[1]._rev);
            Assert.NotNull(updateResponse[1]._rev);
            Assert.NotNull(updateResponse[1]._oldRev);
            Assert.NotEqual(response[1]._rev, updateResponse[1]._rev);
            Assert.Equal(response[1]._rev, updateResponse[1]._oldRev);
        }
        public async Task PutDocumentsAsync_ShouldUseQueryParameters_WhenProvided()
        {
            var mockTransport = new Mock <IApiClientTransport>();

            var mockResponse = new Mock <IApiClientResponse>();

            var mockResponseContent = new Mock <IApiClientResponseContent>();

            mockResponse.Setup(x => x.Content)
            .Returns(mockResponseContent.Object);

            mockResponse.Setup(x => x.IsSuccessStatusCode)
            .Returns(true);

            string requestUri = null;

            mockTransport.Setup(x => x.PutAsync(It.IsAny <string>(), It.IsAny <byte[]>()))
            .Returns((string uri, byte[] content) =>
            {
                requestUri = uri;
                return(Task.FromResult(mockResponse.Object));
            });

            var client = new DocumentApiClient(mockTransport.Object);

            await client.PutDocumentsAsync <object>(
                "mycollection",
                new[]
            {
                new { Value = 1, Name = "test1" }
            },
                new PutDocumentsQuery
            {
                IgnoreRevs  = true,
                ReturnOld   = true,
                Silent      = true,
                WaitForSync = true,
                ReturnNew   = true
            });

            Assert.NotNull(requestUri);
            Assert.Contains("ignoreRevs=true", requestUri);
            Assert.Contains("returnOld=true", requestUri);
            Assert.Contains("silent=true", requestUri);
            Assert.Contains("waitForSync=true", requestUri);
            Assert.Contains("returnNew=true", requestUri);
        }