Example #1
0
        public async Task Can_UnionBetweenSets()
        {
            var storeMembers  = Factory.CreateList();
            var storeMembers2 = Factory.CreateList2();

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

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

            var unionMembers = await redis.GetUnionFromSetsAsync(new[] { Set, Set2 });

            var union = (await Set.ToListAsync()).Union(await Set2.ToListAsync()).ToList();

            Assert.That(unionMembers, Is.EquivalentTo(union));
        }