public void CopyTo(bool compressValues, bool useBasic) { RedisCachingService service = RedisHelpers.GetRedis(compressValues: compressValues, useBasic: useBasic); service.Clear(); Foobar cachable = RedisHelpers.GetCachableObject(); string cachableKey = RedisHelpers.CachableKey; service.Cache(cachableKey, cachable); ICachedObject <Foobar> existsRetrievedWrapper = service.Retrieve <Foobar>(cachableKey); KeyValuePair <string, ICachedObjectBasic>[] cache = new KeyValuePair <string, ICachedObjectBasic> [1]; service.CopyTo(cache, 0); Assert.NotNull(cache); Assert.NotEmpty(cache); Assert.Single(cache); Foobar returned = RedisHelpers.SerializationService.DeserializeObject <Foobar>((string)cache[0].Value.UntypedValue, RedisHelpers.SerializationSettings); Assert.NotNull(returned); Assert.NotEqual(cachable, returned); Assert.True(RedisHelpers.CheckFooBarEquality(existsRetrievedWrapper.Value, returned)); Assert.Equal(cachableKey, ((RedisId)cache[0].Key).ObjectIdentifier); }