Exemplo n.º 1
0
            public void ReturesEmptySet()
            {
                var fixture = new CacheFixture();

                var set = fixture.Cache.For(typeof (object));

                Assert.Equal(0, set.Items.Count);
            }
Exemplo n.º 2
0
            public void ReturesEmptySet()
            {
                var fixture = new CacheFixture();

                var set = fixture.Cache.For(typeof(object));

                Assert.Equal(0, set.Items.Count);
            }
Exemplo n.º 3
0
        public RedisCacheTest()
        {
            var REDIS_ENABLED      = Environment.GetEnvironmentVariable("REDIS_ENABLED") ?? "true";
            var REDIS_SERVICE_HOST = Environment.GetEnvironmentVariable("REDIS_SERVICE_HOST") ?? "localhost";
            var REDIS_SERVICE_PORT = Environment.GetEnvironmentVariable("REDIS_SERVICE_PORT") ?? "6379";

            _enabled = BooleanConverter.ToBoolean(REDIS_ENABLED);
            if (_enabled)
            {
                _cache = new RedisCache();
                _cache.Configure(ConfigParams.FromTuples(
                                     "connection.host", REDIS_SERVICE_HOST,
                                     "connection.port", REDIS_SERVICE_PORT
                                     ));

                _fixture = new CacheFixture(_cache);

                _cache.OpenAsync(null).Wait();
            }
        }
        public MemcachedCacheTest()
        {
            var MEMCACHED_ENABLED      = Environment.GetEnvironmentVariable("MEMCACHED_ENABLED") ?? "true";
            var MEMCACHED_SERVICE_HOST = Environment.GetEnvironmentVariable("MEMCACHED_SERVICE_HOST") ?? "localhost";
            var MEMCACHED_SERVICE_PORT = Environment.GetEnvironmentVariable("MEMCACHED_SERVICE_PORT") ?? "11211";

            _enabled = BooleanConverter.ToBoolean(MEMCACHED_ENABLED);
            if (_enabled)
            {
                _cache = new MemcachedCache();
                _cache.Configure(ConfigParams.FromTuples(
                                     "connection.host", MEMCACHED_SERVICE_HOST,
                                     "connection.port", MEMCACHED_SERVICE_PORT
                                     ));

                _fixture = new CacheFixture(_cache);

                _cache.OpenAsync(null).Wait();
            }
        }
Exemplo n.º 5
0
 protected StoreTest(CacheFixture fix, ITestOutputHelper output)
 {
     this._fix = fix;
     this._output = output;
     this.Store = new CustomerStore(fix.Cache, fix.Elector);
 }
Exemplo n.º 6
0
 protected CacheTest(CacheFixture fix, ITestOutputHelper output)
 {
     this._fix = fix;
     this._output = output;
 }