예제 #1
0
        public void Caching_Keys_Should_Return_Zero_On_Empty_Collection()
        {
            var storage = new Cactus.Blade.Caching.Caching(TestHelpers.UniqueInstance());

            var target = storage.Keys();

            target.Should().NotBeNull();
            target.Should().BeEmpty();
            target.Count.Should().Be(0, because: "nothing is added to the Caching");
        }
예제 #2
0
        public void Caching_Keys_Should_Return_Collection_Of_Keys()
        {
            var storage = new Cactus.Blade.Caching.Caching(TestHelpers.UniqueInstance());

            for (var i = 0; i < 10; i++)
            {
                storage.Store(Guid.NewGuid().ToString(), i);
            }
            var expected_keycount = storage.Count;

            var target = storage.Keys();

            target.Should().NotBeNullOrEmpty();
            target.Count.Should().Be(expected_keycount);
        }