public async Task Can_Delete_ModelWithIdAndName()
        {
            var tos = Factory.CreateList();
            var ids = tos.ConvertAll(x => x.GetId().ToString());

            await redis.StoreAllAsync(tos);

            var deleteIds = new[] { ids[1], ids[3] };

            await redis.DeleteByIdsAsync(deleteIds);

            var froms = await redis.GetByIdsAsync(ids);

            var fromIds = froms.Map(x => x.GetId().ToString());

            var expectedIds = ids.Where(x => !deleteIds.Contains(x))
                              .ToList().ConvertAll(x => x.ToString());

            Assert.That(fromIds, Is.EquivalentTo(expectedIds));
        }
Example #2
0
 public async Task DeleteByIdsAsync(IEnumerable ids, CancellationToken token = default)
 {
     await redisTypedClient.DeleteByIdsAsync(ids, token);
 }