예제 #1
0
        public async Task Can_MoveBetweenSets()
        {
            var fromSetMembers = Factory.CreateList();
            var toSetMembers   = Factory.CreateList2();

            await fromSetMembers.ForEachAsync(x => redis.AddItemToSetAsync(Set, x));

            await toSetMembers.ForEachAsync(x => redis.AddItemToSetAsync(Set2, x));

            await redis.MoveBetweenSetsAsync(Set, Set2, Factory.ExistingValue);

            fromSetMembers.Remove(Factory.ExistingValue);
            toSetMembers.Add(Factory.ExistingValue);

            var readFromSetId = await redis.GetAllItemsFromSetAsync(Set);

            var readToSetId = await redis.GetAllItemsFromSetAsync(Set2);

            Assert.That(readFromSetId, Is.EquivalentTo(fromSetMembers));
            Assert.That(readToSetId, Is.EquivalentTo(toSetMembers));
        }