public void StringSet_WithExpectedParameters()
        {
            // arrange


            // act
            var result = db.StringSet("single", "single value", TimeSpan.FromMinutes(1));

            // assert
            Assert.True(result);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //string RedisConnectionString = ConfigurationManager.ConnectionStrings["RedisExchangeHosts"]?.ConnectionString;
            string SysCustomKey = ConfigurationManager.AppSettings["redisKey"] ?? "";

            var db = new RedisOperator(DbIndex);

            db.CustomKey = SysCustomKey;

            Console.WriteLine("start");
            for (int i = 0; i < 100; i++)
            {
                string key    = $"A{i}";
                var    result = db.StringSet(key, i, TimeSpan.FromSeconds(1 * (i + 1)));

                Console.WriteLine(key);
            }
            Console.WriteLine("end");
        }