예제 #1
0
        public async Task DeleteNamespace_RemovesAllKeysInGivenNamespace()
        {
            // Arrange
            var redcache = new RedcacheService(_fixture.Multiplexer, _serializer);
            var ns       = _fixture.GetRandomNamespace();
            var key1     = _fixture.GetRandomKey(ns);
            var key2     = _fixture.GetRandomKey(ns);

            // Act
            await redcache.Set(key1, "value");

            await redcache.Set(key2, "value");

            await redcache.DeleteNamespace(ns);

            var key1Exists = await redcache.Exists(key1);

            var key2Exists = await redcache.Exists(key2);

            // Assert
            key1Exists.Should().BeFalse();
            key2Exists.Should().BeFalse();
        }