Exemplo n.º 1
0
 /// <summary>
 /// Deletes the specified id and it's associated document from the database.
 /// </summary>
 /// <param name="id">The name of the id to delete.</param>
 /// <returns>True if the id/document was deleted, false if there was an error or it could not otherwise be deleted.</returns>
 public override bool Delete(string id)
 {
     if (!string.IsNullOrWhiteSpace(id))
     {
         var result = client.ExecuteRemove(id);
         return(result.Success);
     }
     else
     {
         return(false);
     }
 }
        public void When_Removing_A_Key_From_A_Down_Node_No_Exception_Is_Thrown_And_Success_Is_False()
        {
            var config = new CouchbaseClientConfiguration();
            config.Urls.Add(new Uri("http://doesnotexist:8091/pools/"));
            config.Bucket = "default";

            var client = new CouchbaseClient(config);
            var removeResult = client.ExecuteRemove("foo");

            Assert.That(removeResult.Success, Is.False);
            Assert.That(removeResult.Message, Is.StringContaining(ClientErrors.FAILURE_NODE_NOT_FOUND));
        }
Exemplo n.º 3
0
        public void When_Removing_A_Key_From_A_Down_Node_No_Exception_Is_Thrown_And_Success_Is_False()
        {
            var config = new CouchbaseClientConfiguration();

            config.Urls.Add(new Uri("http://doesnotexist:8091/pools/"));
            config.Bucket = "default";

            var client       = new CouchbaseClient(config);
            var removeResult = client.ExecuteRemove("foo");

            Assert.That(removeResult.Success, Is.False);
            Assert.That(removeResult.Message, Is.StringContaining(ClientErrors.FAILURE_NODE_NOT_FOUND));
        }