Exemplo n.º 1
0
        public void LinksAreRemovedAfterSaving()
        {
            var jeremiah = Client.Get(TestBucket, Jeremiah).Value;
            var linkToRemove = new RiakLink(TestBucket, OJ, "ozzies");

#pragma warning disable 618
            jeremiah.RemoveLink(linkToRemove);
#pragma warning restore 618

            var result = Client.Put(jeremiah, new RiakPutOptions { ReturnBody = true });
            result.IsSuccess.ShouldBeTrue();

            jeremiah = result.Value;

            var ojLinks = new List<RiakLink>
            {
                new RiakLink(TestBucket, OJ, "friends"),
                new RiakLink(TestBucket, OJ, "coworkers")
            };

            jeremiah.Links.ShouldNotContain(linkToRemove);

            ojLinks.ForEach(l => jeremiah.Links.ShouldContain(l));
        }
Exemplo n.º 2
0
        public void LinksAreRemovedSuccessfullyInMemory()
        {
            var jeremiah = Client.Get(TestBucket, Jeremiah).Value;
            var linkToRemove = new RiakLink(TestBucket, OJ, "ozzies");

#pragma warning disable 618
            jeremiah.RemoveLink(linkToRemove);
#pragma warning restore 618

            var ojLinks = new List<RiakLink>
            {
                new RiakLink(TestBucket, OJ, "friends"),
                new RiakLink(TestBucket, OJ, "coworkers")
            };

            jeremiah.Links.ShouldNotContain(linkToRemove);

            ojLinks.ForEach(l => jeremiah.Links.ShouldContain(l));
        }
Exemplo n.º 3
0
        public void RemoveLink(string bucket, string key, string tag)
        {
            var link = new RiakLink(bucket, key, tag);

            RemoveLink(link);
        }
Exemplo n.º 4
0
 public void RemoveLink(RiakLink link)
 {
     Links.Remove(link);
 }
        /// <summary>
        /// Determines whether the specified object is equal to the current object.
        /// </summary>
        /// <param name="other">The object to compare with the current object.</param>
        /// <returns><b>true</b> if the specified object is equal to the current object, otherwise, <b>false</b>.</returns>
        public bool Equals(RiakLink other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return Equals(other.Bucket, bucket) && Equals(other.Key, key) && Equals(other.Tag, tag);
        }