Esempio n. 1
0
        public void Caching_Query_Should_Respect_Provided_Predicate()
        {
            var collection      = CarFactory.Create();
            var storage         = new Cactus.Blade.Caching.Caching();
            var key             = Guid.NewGuid().ToString();
            var expected_brand  = "BMW";
            var expected_amount = collection.Count(c => c.Brand == expected_brand);

            storage.Store(key, collection);

            var target = storage.Query <Car>(key, c => c.Brand == expected_brand);

            target.Should().NotBeNull();
            target.Count().Should().Be(expected_amount);
            target.All(c => c.Brand == expected_brand);
        }