SshClientTest.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Renci.SshNet.Common;
  3. using Renci.SshNet.Tests.Common;
  4. using Renci.SshNet.Tests.Properties;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Text;
  9. using System.Linq;
  10. namespace Renci.SshNet.Tests.Classes
  11. {
  12. /// <summary>
  13. /// Provides client connection to SSH server.
  14. /// </summary>
  15. [TestClass]
  16. public class SshClientTest : TestBase
  17. {
  18. [TestMethod]
  19. [TestCategory("Authentication")]
  20. public void Test_Connect_Using_Correct_Password()
  21. {
  22. var host = Resources.HOST;
  23. var username = Resources.USERNAME;
  24. var password = Resources.PASSWORD;
  25. #region Example SshClient(host, username) Connect
  26. using (var client = new SshClient(host, username, password))
  27. {
  28. client.Connect();
  29. // Do something here
  30. client.Disconnect();
  31. }
  32. #endregion
  33. }
  34. [TestMethod]
  35. [TestCategory("Authentication")]
  36. public void Test_Connect_Handle_HostKeyReceived()
  37. {
  38. var host = Resources.HOST;
  39. var username = Resources.USERNAME;
  40. var password = Resources.PASSWORD;
  41. var hostKeyValidated = false;
  42. #region Example SshClient Connect HostKeyReceived
  43. using (var client = new SshClient(host, username, password))
  44. {
  45. client.HostKeyReceived += delegate(object sender, HostKeyEventArgs e)
  46. {
  47. hostKeyValidated = true;
  48. if (e.FingerPrint.SequenceEqual(new byte[] { 0x00, 0x01, 0x02, 0x03 }))
  49. {
  50. e.CanTrust = true;
  51. }
  52. else
  53. {
  54. e.CanTrust = false;
  55. }
  56. };
  57. client.Connect();
  58. // Do something here
  59. client.Disconnect();
  60. }
  61. #endregion
  62. Assert.IsTrue(hostKeyValidated);
  63. }
  64. [TestMethod]
  65. [TestCategory("Authentication")]
  66. public void Test_Connect_Timeout()
  67. {
  68. var host = Resources.HOST;
  69. var username = Resources.USERNAME;
  70. var password = Resources.PASSWORD;
  71. #region Example SshClient Connect Timeout
  72. var connectionInfo = new PasswordConnectionInfo(host, username, password);
  73. connectionInfo.Timeout = TimeSpan.FromSeconds(30);
  74. using (var client = new SshClient(connectionInfo))
  75. {
  76. client.Connect();
  77. // Do something here
  78. client.Disconnect();
  79. }
  80. #endregion
  81. Assert.Inconclusive();
  82. }
  83. [TestMethod]
  84. [TestCategory("Authentication")]
  85. public void Test_Connect_Handle_ErrorOccurred()
  86. {
  87. var host = Resources.HOST;
  88. var username = Resources.USERNAME;
  89. var password = Resources.PASSWORD;
  90. var exceptionOccured = false;
  91. #region Example SshClient Connect ErrorOccurred
  92. using (var client = new SshClient(host, username, password))
  93. {
  94. client.ErrorOccurred += delegate(object sender, ExceptionEventArgs e)
  95. {
  96. Console.WriteLine("Error occured: " + e.Exception.ToString());
  97. exceptionOccured = true;
  98. };
  99. client.Connect();
  100. // Do something here
  101. client.Disconnect();
  102. }
  103. #endregion
  104. Assert.IsTrue(exceptionOccured);
  105. }
  106. [TestMethod]
  107. [TestCategory("Authentication")]
  108. [ExpectedException(typeof(SshAuthenticationException))]
  109. public void Test_Connect_Using_Invalid_Password()
  110. {
  111. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, "invalid password"))
  112. {
  113. client.Connect();
  114. client.Disconnect();
  115. }
  116. }
  117. [TestMethod]
  118. [TestCategory("Authentication")]
  119. public void Test_Connect_Using_Rsa_Key_Without_PassPhrase()
  120. {
  121. var host = Resources.HOST;
  122. var username = Resources.USERNAME;
  123. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.RSA_KEY_WITHOUT_PASS));
  124. #region Example SshClient(host, username) Connect PrivateKeyFile
  125. using (var client = new SshClient(host, username, new PrivateKeyFile(keyFileStream)))
  126. {
  127. client.Connect();
  128. client.Disconnect();
  129. }
  130. #endregion
  131. }
  132. [TestMethod]
  133. [TestCategory("Authentication")]
  134. public void Test_Connect_Using_RsaKey_With_PassPhrase()
  135. {
  136. var host = Resources.HOST;
  137. var username = Resources.USERNAME;
  138. var passphrase = Resources.PASSWORD;
  139. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.RSA_KEY_WITH_PASS));
  140. #region Example SshClient(host, username) Connect PrivateKeyFile PassPhrase
  141. using (var client = new SshClient(host, username, new PrivateKeyFile(keyFileStream, passphrase)))
  142. {
  143. client.Connect();
  144. client.Disconnect();
  145. }
  146. #endregion
  147. }
  148. [TestMethod]
  149. [TestCategory("Authentication")]
  150. [ExpectedException(typeof(SshPassPhraseNullOrEmptyException))]
  151. public void Test_Connect_Using_Key_With_Empty_PassPhrase()
  152. {
  153. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.RSA_KEY_WITH_PASS));
  154. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, new PrivateKeyFile(keyFileStream, null)))
  155. {
  156. client.Connect();
  157. client.Disconnect();
  158. }
  159. }
  160. [TestMethod]
  161. [TestCategory("Authentication")]
  162. public void Test_Connect_Using_DsaKey_Without_PassPhrase()
  163. {
  164. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.DSA_KEY_WITHOUT_PASS));
  165. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, new PrivateKeyFile(keyFileStream)))
  166. {
  167. client.Connect();
  168. client.Disconnect();
  169. }
  170. }
  171. [TestMethod]
  172. [TestCategory("Authentication")]
  173. public void Test_Connect_Using_DsaKey_With_PassPhrase()
  174. {
  175. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.DSA_KEY_WITH_PASS));
  176. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, new PrivateKeyFile(keyFileStream, Resources.PASSWORD)))
  177. {
  178. client.Connect();
  179. client.Disconnect();
  180. }
  181. }
  182. [TestMethod]
  183. [TestCategory("Authentication")]
  184. [ExpectedException(typeof(SshAuthenticationException))]
  185. public void Test_Connect_Using_Invalid_PrivateKey()
  186. {
  187. MemoryStream keyFileStream = new MemoryStream(Encoding.ASCII.GetBytes(Resources.INVALID_KEY));
  188. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, new PrivateKeyFile(keyFileStream)))
  189. {
  190. client.Connect();
  191. client.Disconnect();
  192. }
  193. }
  194. [TestMethod]
  195. [TestCategory("Authentication")]
  196. public void Test_Connect_Using_Multiple_PrivateKeys()
  197. {
  198. using (var client = new SshClient(Resources.HOST, Resources.USERNAME,
  199. new PrivateKeyFile(new MemoryStream(Encoding.ASCII.GetBytes(Resources.INVALID_KEY))),
  200. new PrivateKeyFile(new MemoryStream(Encoding.ASCII.GetBytes(Resources.DSA_KEY_WITH_PASS)), Resources.PASSWORD),
  201. new PrivateKeyFile(new MemoryStream(Encoding.ASCII.GetBytes(Resources.RSA_KEY_WITH_PASS)), Resources.PASSWORD),
  202. new PrivateKeyFile(new MemoryStream(Encoding.ASCII.GetBytes(Resources.RSA_KEY_WITHOUT_PASS))),
  203. new PrivateKeyFile(new MemoryStream(Encoding.ASCII.GetBytes(Resources.DSA_KEY_WITHOUT_PASS)))
  204. ))
  205. {
  206. client.Connect();
  207. client.Disconnect();
  208. }
  209. }
  210. [TestMethod]
  211. [TestCategory("Authentication")]
  212. public void Test_Connect_Then_Reconnect()
  213. {
  214. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  215. {
  216. client.Connect();
  217. client.Disconnect();
  218. client.Connect();
  219. client.Disconnect();
  220. }
  221. }
  222. /// <summary>
  223. ///A test for CreateShellStream
  224. ///</summary>
  225. [TestMethod()]
  226. public void CreateShellStreamTest()
  227. {
  228. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  229. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  230. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  231. uint columns = 0; // TODO: Initialize to an appropriate value
  232. uint rows = 0; // TODO: Initialize to an appropriate value
  233. uint width = 0; // TODO: Initialize to an appropriate value
  234. uint height = 0; // TODO: Initialize to an appropriate value
  235. int bufferSize = 0; // TODO: Initialize to an appropriate value
  236. IDictionary<TerminalModes, uint> terminalModeValues = null; // TODO: Initialize to an appropriate value
  237. ShellStream expected = null; // TODO: Initialize to an appropriate value
  238. ShellStream actual;
  239. actual = target.CreateShellStream(terminalName, columns, rows, width, height, bufferSize, terminalModeValues);
  240. Assert.AreEqual(expected, actual);
  241. Assert.Inconclusive("Verify the correctness of this test method.");
  242. }
  243. /// <summary>
  244. ///A test for CreateShellStream
  245. ///</summary>
  246. [TestMethod()]
  247. public void CreateShellStreamTest1()
  248. {
  249. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  250. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  251. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  252. uint columns = 0; // TODO: Initialize to an appropriate value
  253. uint rows = 0; // TODO: Initialize to an appropriate value
  254. uint width = 0; // TODO: Initialize to an appropriate value
  255. uint height = 0; // TODO: Initialize to an appropriate value
  256. int bufferSize = 0; // TODO: Initialize to an appropriate value
  257. ShellStream expected = null; // TODO: Initialize to an appropriate value
  258. ShellStream actual;
  259. actual = target.CreateShellStream(terminalName, columns, rows, width, height, bufferSize);
  260. Assert.AreEqual(expected, actual);
  261. Assert.Inconclusive("Verify the correctness of this test method.");
  262. }
  263. /// <summary>
  264. ///A test for CreateShell
  265. ///</summary>
  266. [TestMethod()]
  267. public void CreateShellTest()
  268. {
  269. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  270. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  271. Encoding encoding = null; // TODO: Initialize to an appropriate value
  272. string input = string.Empty; // TODO: Initialize to an appropriate value
  273. Stream output = null; // TODO: Initialize to an appropriate value
  274. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  275. Shell expected = null; // TODO: Initialize to an appropriate value
  276. Shell actual;
  277. actual = target.CreateShell(encoding, input, output, extendedOutput);
  278. Assert.AreEqual(expected, actual);
  279. Assert.Inconclusive("Verify the correctness of this test method.");
  280. }
  281. /// <summary>
  282. ///A test for CreateShell
  283. ///</summary>
  284. [TestMethod()]
  285. public void CreateShellTest1()
  286. {
  287. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  288. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  289. Encoding encoding = null; // TODO: Initialize to an appropriate value
  290. string input = string.Empty; // TODO: Initialize to an appropriate value
  291. Stream output = null; // TODO: Initialize to an appropriate value
  292. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  293. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  294. uint columns = 0; // TODO: Initialize to an appropriate value
  295. uint rows = 0; // TODO: Initialize to an appropriate value
  296. uint width = 0; // TODO: Initialize to an appropriate value
  297. uint height = 0; // TODO: Initialize to an appropriate value
  298. IDictionary<TerminalModes, uint> terminalModes = null; // TODO: Initialize to an appropriate value
  299. Shell expected = null; // TODO: Initialize to an appropriate value
  300. Shell actual;
  301. actual = target.CreateShell(encoding, input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes);
  302. Assert.AreEqual(expected, actual);
  303. Assert.Inconclusive("Verify the correctness of this test method.");
  304. }
  305. /// <summary>
  306. ///A test for CreateShell
  307. ///</summary>
  308. [TestMethod()]
  309. public void CreateShellTest2()
  310. {
  311. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  312. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  313. Encoding encoding = null; // TODO: Initialize to an appropriate value
  314. string input = string.Empty; // TODO: Initialize to an appropriate value
  315. Stream output = null; // TODO: Initialize to an appropriate value
  316. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  317. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  318. uint columns = 0; // TODO: Initialize to an appropriate value
  319. uint rows = 0; // TODO: Initialize to an appropriate value
  320. uint width = 0; // TODO: Initialize to an appropriate value
  321. uint height = 0; // TODO: Initialize to an appropriate value
  322. IDictionary<TerminalModes, uint> terminalModes = null; // TODO: Initialize to an appropriate value
  323. int bufferSize = 0; // TODO: Initialize to an appropriate value
  324. Shell expected = null; // TODO: Initialize to an appropriate value
  325. Shell actual;
  326. actual = target.CreateShell(encoding, input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, bufferSize);
  327. Assert.AreEqual(expected, actual);
  328. Assert.Inconclusive("Verify the correctness of this test method.");
  329. }
  330. /// <summary>
  331. ///A test for CreateShell
  332. ///</summary>
  333. [TestMethod()]
  334. public void CreateShellTest3()
  335. {
  336. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  337. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  338. Stream input = null; // TODO: Initialize to an appropriate value
  339. Stream output = null; // TODO: Initialize to an appropriate value
  340. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  341. Shell expected = null; // TODO: Initialize to an appropriate value
  342. Shell actual;
  343. actual = target.CreateShell(input, output, extendedOutput);
  344. Assert.AreEqual(expected, actual);
  345. Assert.Inconclusive("Verify the correctness of this test method.");
  346. }
  347. /// <summary>
  348. ///A test for CreateShell
  349. ///</summary>
  350. [TestMethod()]
  351. public void CreateShellTest4()
  352. {
  353. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  354. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  355. Stream input = null; // TODO: Initialize to an appropriate value
  356. Stream output = null; // TODO: Initialize to an appropriate value
  357. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  358. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  359. uint columns = 0; // TODO: Initialize to an appropriate value
  360. uint rows = 0; // TODO: Initialize to an appropriate value
  361. uint width = 0; // TODO: Initialize to an appropriate value
  362. uint height = 0; // TODO: Initialize to an appropriate value
  363. IDictionary<TerminalModes, uint> terminalModes = null; // TODO: Initialize to an appropriate value
  364. Shell expected = null; // TODO: Initialize to an appropriate value
  365. Shell actual;
  366. actual = target.CreateShell(input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes);
  367. Assert.AreEqual(expected, actual);
  368. Assert.Inconclusive("Verify the correctness of this test method.");
  369. }
  370. /// <summary>
  371. ///A test for CreateShell
  372. ///</summary>
  373. [TestMethod()]
  374. public void CreateShellTest5()
  375. {
  376. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  377. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  378. Stream input = null; // TODO: Initialize to an appropriate value
  379. Stream output = null; // TODO: Initialize to an appropriate value
  380. Stream extendedOutput = null; // TODO: Initialize to an appropriate value
  381. string terminalName = string.Empty; // TODO: Initialize to an appropriate value
  382. uint columns = 0; // TODO: Initialize to an appropriate value
  383. uint rows = 0; // TODO: Initialize to an appropriate value
  384. uint width = 0; // TODO: Initialize to an appropriate value
  385. uint height = 0; // TODO: Initialize to an appropriate value
  386. IDictionary<TerminalModes, uint> terminalModes = null; // TODO: Initialize to an appropriate value
  387. int bufferSize = 0; // TODO: Initialize to an appropriate value
  388. Shell expected = null; // TODO: Initialize to an appropriate value
  389. Shell actual;
  390. actual = target.CreateShell(input, output, extendedOutput, terminalName, columns, rows, width, height, terminalModes, bufferSize);
  391. Assert.AreEqual(expected, actual);
  392. Assert.Inconclusive("Verify the correctness of this test method.");
  393. }
  394. /// <summary>
  395. ///A test for CreateCommand
  396. ///</summary>
  397. [TestMethod()]
  398. public void CreateCommandTest()
  399. {
  400. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  401. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  402. string commandText = string.Empty; // TODO: Initialize to an appropriate value
  403. Encoding encoding = null; // TODO: Initialize to an appropriate value
  404. SshCommand expected = null; // TODO: Initialize to an appropriate value
  405. SshCommand actual;
  406. actual = target.CreateCommand(commandText, encoding);
  407. Assert.AreEqual(expected, actual);
  408. Assert.Inconclusive("Verify the correctness of this test method.");
  409. }
  410. /// <summary>
  411. ///A test for CreateCommand
  412. ///</summary>
  413. [TestMethod()]
  414. public void CreateCommandTest1()
  415. {
  416. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  417. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  418. string commandText = string.Empty; // TODO: Initialize to an appropriate value
  419. SshCommand expected = null; // TODO: Initialize to an appropriate value
  420. SshCommand actual;
  421. actual = target.CreateCommand(commandText);
  422. Assert.AreEqual(expected, actual);
  423. Assert.Inconclusive("Verify the correctness of this test method.");
  424. }
  425. /// <summary>
  426. ///A test for AddForwardedPort
  427. ///</summary>
  428. [TestMethod()]
  429. public void AddForwardedPortTest()
  430. {
  431. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  432. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  433. ForwardedPort port = null; // TODO: Initialize to an appropriate value
  434. target.AddForwardedPort(port);
  435. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  436. }
  437. /// <summary>
  438. ///A test for SshClient Constructor
  439. ///</summary>
  440. [TestMethod()]
  441. public void SshClientConstructorTest()
  442. {
  443. string host = string.Empty; // TODO: Initialize to an appropriate value
  444. string username = string.Empty; // TODO: Initialize to an appropriate value
  445. PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
  446. SshClient target = new SshClient(host, username, keyFiles);
  447. Assert.Inconclusive("TODO: Implement code to verify target");
  448. }
  449. /// <summary>
  450. ///A test for SshClient Constructor
  451. ///</summary>
  452. [TestMethod()]
  453. public void SshClientConstructorTest1()
  454. {
  455. string host = string.Empty; // TODO: Initialize to an appropriate value
  456. int port = 0; // TODO: Initialize to an appropriate value
  457. string username = string.Empty; // TODO: Initialize to an appropriate value
  458. PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
  459. SshClient target = new SshClient(host, port, username, keyFiles);
  460. Assert.Inconclusive("TODO: Implement code to verify target");
  461. }
  462. /// <summary>
  463. ///A test for SshClient Constructor
  464. ///</summary>
  465. [TestMethod()]
  466. public void SshClientConstructorTest2()
  467. {
  468. string host = string.Empty; // TODO: Initialize to an appropriate value
  469. string username = string.Empty; // TODO: Initialize to an appropriate value
  470. string password = string.Empty; // TODO: Initialize to an appropriate value
  471. SshClient target = new SshClient(host, username, password);
  472. Assert.Inconclusive("TODO: Implement code to verify target");
  473. }
  474. /// <summary>
  475. ///A test for SshClient Constructor
  476. ///</summary>
  477. [TestMethod()]
  478. public void SshClientConstructorTest3()
  479. {
  480. string host = string.Empty; // TODO: Initialize to an appropriate value
  481. int port = 0; // TODO: Initialize to an appropriate value
  482. string username = string.Empty; // TODO: Initialize to an appropriate value
  483. string password = string.Empty; // TODO: Initialize to an appropriate value
  484. SshClient target = new SshClient(host, port, username, password);
  485. Assert.Inconclusive("TODO: Implement code to verify target");
  486. }
  487. /// <summary>
  488. ///A test for SshClient Constructor
  489. ///</summary>
  490. [TestMethod()]
  491. public void SshClientConstructorTest4()
  492. {
  493. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  494. SshClient target = new SshClient(connectionInfo);
  495. Assert.Inconclusive("TODO: Implement code to verify target");
  496. }
  497. /// <summary>
  498. ///A test for RemoveForwardedPort
  499. ///</summary>
  500. [TestMethod()]
  501. public void RemoveForwardedPortTest()
  502. {
  503. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  504. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  505. ForwardedPort port = null; // TODO: Initialize to an appropriate value
  506. target.RemoveForwardedPort(port);
  507. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  508. }
  509. /// <summary>
  510. ///A test for RunCommand
  511. ///</summary>
  512. [TestMethod()]
  513. public void RunCommandTest()
  514. {
  515. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  516. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  517. string commandText = string.Empty; // TODO: Initialize to an appropriate value
  518. SshCommand expected = null; // TODO: Initialize to an appropriate value
  519. SshCommand actual;
  520. actual = target.RunCommand(commandText);
  521. Assert.AreEqual(expected, actual);
  522. Assert.Inconclusive("Verify the correctness of this test method.");
  523. }
  524. /// <summary>
  525. ///A test for ForwardedPorts
  526. ///</summary>
  527. [TestMethod()]
  528. public void ForwardedPortsTest()
  529. {
  530. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  531. SshClient target = new SshClient(connectionInfo); // TODO: Initialize to an appropriate value
  532. IEnumerable<ForwardedPort> actual;
  533. actual = target.ForwardedPorts;
  534. Assert.Inconclusive("Verify the correctness of this test method.");
  535. }
  536. }
  537. }