SshClientTests.cs 902 B

1234567891011121314151617181920212223242526272829303132
  1. namespace Renci.SshNet.IntegrationTests
  2. {
  3. /// <summary>
  4. /// The SSH client integration tests
  5. /// </summary>
  6. [TestClass]
  7. public class SshClientTests : IntegrationTestBase, IDisposable
  8. {
  9. private readonly SshClient _sshClient;
  10. public SshClientTests()
  11. {
  12. _sshClient = new SshClient(SshServerHostName, SshServerPort, User.UserName, User.Password);
  13. _sshClient.Connect();
  14. }
  15. [TestMethod]
  16. public void Echo_Command_with_all_characters()
  17. {
  18. var builder = new StringBuilder();
  19. var response = _sshClient.RunCommand("echo $'test !@#$%^&*()_+{}:,./<>[];\\|'");
  20. Assert.AreEqual("test !@#$%^&*()_+{}:,./<>[];\\|\n", response.Result);
  21. }
  22. public void Dispose()
  23. {
  24. _sshClient.Disconnect();
  25. _sshClient.Dispose();
  26. }
  27. }
  28. }