Exemple #1
0
 public void RemoveDesignDocumentAsync_Throws_NotSupportedException()
 {
     Assert.Throws <NotSupportedException>(() => _bucketManager.RemoveDesignDocumentAsync(It.IsAny <string>()));
 }
        public async Task GetDesignDocumentAsync_Exists_Success()
        {
            // Arrange

            var createResult = await _bucketManager.InsertDesignDocumentAsync("test", JsonConvert.SerializeObject(DesignDoc));

            Assert.True(createResult.Success, "{0}-{1}", createResult.Message,
                        createResult.Exception == null ? "" : createResult.Exception.ToString());

            try
            {
                // Act

                var result = await _bucketManager.GetDesignDocumentAsync("test");

                // Assert

                Assert.NotNull(result);
                Assert.True(result.Success, "{0}-{1}", result.Message,
                            result.Exception == null ? "" : result.Exception.ToString());
            }
            finally
            {
                // Cleanup
                var removeResult = _bucketManager.RemoveDesignDocumentAsync("test").Result;
                Assert.True(removeResult.Success, "{0}-{1}", removeResult.Message,
                            removeResult.Exception == null ? "" : removeResult.Exception.ToString());
            }
        }
        public async Task GetDesignDocumentAsync_Exists_Success()
        {
            // Arrange

            var createResult = await _bucketManager.InsertDesignDocumentAsync("test", JsonConvert.SerializeObject(DesignDoc));

            Assert.True(createResult.Success);

            try
            {
                // Act

                var result = await _bucketManager.GetDesignDocumentAsync("test");

                // Assert

                Assert.NotNull(result);
                Assert.True(result.Success);
            }
            finally
            {
                // Cleanup
                var removeResult = _bucketManager.RemoveDesignDocumentAsync("test").Result;
                Assert.True(removeResult.Success);
            }
        }