public async Task Can_EvalSha_int() { var luaBody = "return 3141591"; await RedisAsync.ExecLuaAsIntAsync(luaBody, Array.Empty <string>()); var sha1 = await RedisAsync.CalculateSha1Async(luaBody); var intVal = await RedisAsync.ExecLuaShaAsIntAsync(sha1, Array.Empty <string>()); Assert.That(intVal, Is.EqualTo(3141591)); }
public async Task Can_detect_which_scripts_exist() { var sha1 = await RedisAsync.LoadLuaScriptAsync("return 'script1'"); var sha2 = await RedisAsync.CalculateSha1Async("return 'script2'"); var sha3 = await RedisAsync.LoadLuaScriptAsync("return 'script3'"); Assert.That(await RedisAsync.HasLuaScriptAsync(sha1)); var existsMap = await RedisAsync.WhichLuaScriptsExistsAsync(new[] { sha1, sha2, sha3 }); Assert.That(existsMap[sha1]); Assert.That(!existsMap[sha2]); Assert.That(existsMap[sha3]); }