public void Keys_RedisServer_ServerMethodCorrectResult() { var result = _redisServer.Keys("pattern*") .ToList(); Assert.That(result.First(), Is.EqualTo("key1")); Assert.That(result.Last(), Is.EqualTo("key2")); _serverMock.Verify(x => x.Keys(0, "somePrefixpattern*", 10, CommandFlags.None)); }
public IEnumerable <string> Keys( string pattern, int database = 0, int pageSize = 10, CommandFlags flags = CommandFlags.None) { try { return(_redisServer?.Keys(pattern, database, pageSize, flags)); } catch (Exception e) { LogError(e); return(null); } }