Example #1
0
        public void SetUp()
        {
            var options = new ConfigurationOptions();

            options.AllowAdmin = true;
            options.EndPoints.Add("localhost");

            ConnectionMultiplexer connection = ConnectionMultiplexer.Connect(options);
            var server = connection.GetServer(connection.GetEndPoints().First());

            server.ConfigSet("notify-keyspace-events", "KEA");

            _redisDirectDb = connection.GetDatabase();

            //Construct the in-memory cache using an Implemention of IDatabase that counts calls (so tests can tell which requests made it to the network)
            _callMonMemDb = new CallMonitoringRedisDatabase(_redisDirectDb);
            _memDb        = new RedisL1Database(_callMonMemDb);

            //Get a notification database to simulate another client
            _otherClientDb = new NotificationDatabase(_redisDirectDb, "other client");

            //Clean everything out
            server.FlushAllDatabases();
            _memDb.Flush();

            _callMonMemDb.Calls = 0;
        }
Example #2
0
        public void NoRedis_StringGet()
        {
            RedisL1Database db = new RedisL1Database("unique str");

            db.StringSet("nodbkey", "value");
            Assert.AreEqual("value", (string)db.StringGet("nodbkey"));
        }