Exemple #1
0
        ////[Trait("category", "Unreliable")]
        public void Redis_Multiple_PubSub_ClearRegion()
        {
            // arrange
            var item        = new CacheItem <object>(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "something");
            var channelName = Guid.NewGuid().ToString();

            // act/assert
            RedisTests.RunMultipleCaches(
                (cacheA, cacheB) =>
            {
                cacheA.Add(item);
                cacheB.Get(item.Key, item.Region).Should().Be(item.Value);
                cacheB.ClearRegion(item.Region);
            },
                (cache) =>
            {
                cache.Get(item.Key, item.Region).Should().BeNull();
            },
                2,
                TestManagers.CreateRedisCache(5),
                TestManagers.CreateRedisCache(5),
                TestManagers.CreateRedisCache(5),
                TestManagers.CreateRedisCache(5));
        }
Exemple #2
0
        public void Redis_Multiple_PubSub_Clear()
        {
            // arrange
            var item        = new CacheItem <object>(Guid.NewGuid().ToString(), "something");
            var channelName = Guid.NewGuid().ToString();

            // act/assert
            RedisTests.RunMultipleCaches(
                (cacheA, cacheB) =>
            {
                cacheA.Add(item);
                cacheB.Get(item.Key).Should().Be(item.Value);
                cacheB.Clear();
            },
                (cache) =>
            {
                cache.Get(item.Key).Should().BeNull();
            },
                2,
                TestManagers.CreateRedisAndSystemCacheWithBackPlate(444, true, channelName),
                TestManagers.CreateRedisAndSystemCacheWithBackPlate(444, true, channelName),
                TestManagers.CreateRedisCache(444),
                TestManagers.CreateRedisAndSystemCacheWithBackPlate(444, true, channelName));
        }