本文整理汇总了C#中RedisClient.ScriptFlush方法的典型用法代码示例。如果您正苦于以下问题:C# RedisClient.ScriptFlush方法的具体用法?C# RedisClient.ScriptFlush怎么用?C# RedisClient.ScriptFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedisClient
的用法示例。
在下文中一共展示了RedisClient.ScriptFlush方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScriptFlushTest
public void ScriptFlushTest()
{
using (var mock = new FakeRedisSocket("+OK\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("OK", redis.ScriptFlush());
Assert.AreEqual("*2\r\n$6\r\nSCRIPT\r\n$5\r\nFLUSH\r\n", mock.GetMessage());
}
}
示例2: ScriptFlushTest
public void ScriptFlushTest()
{
using(var mock = new MockConnector("localhost", 9999, "+OK\r\n"))
using(var redis = new RedisClient(mock))
{
Assert.True(redis.ScriptFlush());
Assert.Equal("*2\r\n$6\r\nSCRIPT\r\n$5\r\nFLUSH\r\n", mock.GetMessage());
}
}
示例3: Can_call_Cached_Lua_even_after_script_is_flushed
public void Can_call_Cached_Lua_even_after_script_is_flushed()
{
using (var redis = new RedisClient())
{
var r = redis.ExecCachedLua(LuaScript, sha1 =>
redis.ExecLuaSha(sha1, "key:*", "10"));
Assert.That(r.Children.Count, Is.EqualTo(10));
redis.ScriptFlush();
r = redis.ExecCachedLua(LuaScript, sha1 =>
redis.ExecLuaSha(sha1, "key:*", "10"));
Assert.That(r.Children.Count, Is.EqualTo(10));
}
}