Exemplo n.º 1
0
        public void TestSimpleScriptThatCallsRedis()
        {
            const string script = "redis.call('set', @Key1, @IntArg1)";

            var keysAndArgs = redisContext.CreateScriptKeyAndArguments()
                              .Apply(x =>
            {
                x.Key1    = "myTest";
                x.IntArg1 = 7878;
            });

            redisContext.RunScript(script, keysAndArgs);

            var getResult = redisContext.TryGet("myTest", out int result);

            Assert.IsTrue(getResult);
            Assert.AreEqual(7878, result);
        }