2
0

SshCommandTest.cs 710 B

123456789101112131415161718192021222324
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Renci.SshNet.Common;
  3. using Renci.SshNet.Tests.Common;
  4. using Renci.SshNet.Tests.Properties;
  5. namespace Renci.SshNet.Tests.Classes
  6. {
  7. /// <summary>
  8. /// Represents SSH command that can be executed.
  9. /// </summary>
  10. [TestClass]
  11. public partial class SshCommandTest : TestBase
  12. {
  13. [TestMethod]
  14. public void Test_Execute_SingleCommand_Without_Connecting()
  15. {
  16. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  17. {
  18. Assert.ThrowsException<SshConnectionException>(() => client.CreateCommand("echo Hello"));
  19. }
  20. }
  21. }
  22. }