Beispiel #1
0
        public void DisjointedSortedSet_Remove_Simple()
        {
            var set = new DisjointedSortedSet();

            set.Add(new[]
            {
                new StackExchange.Redis.SortedSetEntry("anna", 10),
                new StackExchange.Redis.SortedSetEntry("bob", 20)
            });
            Assert.AreEqual(2, set.Count);
            set.Remove(new RedisValue[] { "anna" });
            Assert.AreEqual(1, set.Count);
        }
Beispiel #2
0
        public void DisjointedSortedSet_Remove_InMiddle()
        {
            var set = new DisjointedSortedSet();

            set.Add(new[]
            {
                new StackExchange.Redis.SortedSetEntry("anna", 10),
                new StackExchange.Redis.SortedSetEntry("bob", 20),
                new StackExchange.Redis.SortedSetEntry("carol", 30)
            });
            set.Remove(new RedisValue[] { "bob" });
            var result = set.RetrieveByScore(10, 30, Exclude.None);

            Assert.AreEqual(2, result.Count());
        }