Esempio n. 1
0
        public void WhenSetTwoCachePropertiesInTwoActionsThenSetTheTwoValuesWithoutLostTheFirst()
        {
            var hbm    = new HbmList();
            var mapper = new ListMapper(typeof(Animal), typeof(Animal), hbm);

            mapper.Cache(ch => ch.Region("pizza"));
            mapper.Cache(ch => ch.Usage(CacheUsage.NonstrictReadWrite));

            var hbmCache = hbm.cache;

            hbmCache.Should().Not.Be.Null();
            hbmCache.region.Should().Be("pizza");
            hbmCache.usage.Should().Be(HbmCacheUsage.NonstrictReadWrite);
        }
        public void CanSetCache()
        {
            var hbm = new HbmList();
            var mapper = new ListMapper(typeof(Animal), typeof(Animal), hbm);
            mapper.Cache(x => x.Region("pizza"));

            hbm.cache.Should().Not.Be.Null();
        }
Esempio n. 3
0
        public void CanSetCache()
        {
            var hbm    = new HbmList();
            var mapper = new ListMapper(typeof(Animal), typeof(Animal), hbm);

            mapper.Cache(x => x.Region("pizza"));

            hbm.cache.Should().Not.Be.Null();
        }
        public void WhenSetTwoCachePropertiesInTwoActionsThenSetTheTwoValuesWithoutLostTheFirst()
        {
            var hbm = new HbmList();
            var mapper = new ListMapper(typeof(Animal), typeof(Animal), hbm);
            mapper.Cache(ch => ch.Region("pizza"));
            mapper.Cache(ch => ch.Usage(CacheUsage.NonstrictReadWrite));

            var hbmCache = hbm.cache;
            hbmCache.Should().Not.Be.Null();
            hbmCache.region.Should().Be("pizza");
            hbmCache.usage.Should().Be(HbmCacheUsage.NonstrictReadWrite);
        }