Esempio n. 1
0
        public async Task Match_With_Local_Hash(string script)
        {
            var scriptHash = await connection.ExecuteAsync(
                new SCRIPT.LOAD(script)
                ).ConfigureAwait(false);

            scriptHash.Should().Be(Sha1.Create(script));
        }
Esempio n. 2
0
        public async Task Cause_Exists_To_Return_True()
        {
            const string script = "return redis.call('LOLWUT')";
            var          eval   = new EVAL(script, Array.Empty <Key>(), Array.Empty <BulkString>());
            await connection.ExecuteAsync(eval).ConfigureAwait(false);

            var scriptHash   = Sha1.Create(script);
            var scriptExists = new SCRIPT.EXISTS(scriptHash);
            var response     = await connection.ExecuteAsync(scriptExists).ConfigureAwait(false);

            response.Should().Equal((scriptHash, true));
        }