Exemple #1
0
 public void SetCommandWithError()
 {
     using (var connection = new ConnectionMock("set foo 1\r\n3\r\n", "-ERR Get off\r\n"))
     {
         var          f       = new CommandFactory(new NormalCommandExecutor(connection));
         RedisCommand command = f.Set("foo", "3");
         command.Exec();
     }
 }
 public void SetCommandWithError()
 {
     using (var connection = new ConnectionMock("set foo 1\r\n3\r\n", "-ERR Get off\r\n"))
     {
         var f = new CommandFactory(new NormalCommandExecutor(connection));
         RedisCommand command = f.Set("foo", "3");
         command.Exec();
     }
 }
Exemple #3
0
 public void GetCommandWithNormalResult()
 {
     using (var connection = new ConnectionMock("GET foo\r\n", "+baz\r\n"))
     {
         var f       = new CommandFactory(new NormalCommandExecutor(connection));
         var command = f.Get("foo");
         command.Exec();
         Assert.That(Encoding.ASCII.GetString(command.Result), Is.EqualTo("baz"));
     }
 }
Exemple #4
0
 public void SetCommandWithNormalResult()
 {
     using (var connection = new ConnectionMock("SET foo 1_3_", "+OK\r\n"))
     {
         var          f       = new CommandFactory(new NormalCommandExecutor(connection));
         RedisCommand command = f.Set("foo", "3");
         command.Exec();
         connection.Verify();
     }
 }
 public void SetCommandWithNormalResult()
 {
     using (var connection = new ConnectionMock("SET foo 1_3_", "+OK\r\n"))
     {
         var f = new CommandFactory(new NormalCommandExecutor(connection));
         RedisCommand command = f.Set("foo", "3");
         command.Exec();
         connection.Verify();
     }
 }
 public void GetCommandWithNormalResult()
 {
     using (var connection = new ConnectionMock("GET foo\r\n", "+baz\r\n"))
     {
         var f = new CommandFactory(new NormalCommandExecutor(connection));
         var command = f.Get("foo");
         command.Exec();
         Assert.That(Encoding.ASCII.GetString(command.Result), Is.EqualTo("baz"));
     }
 }