SshClientTest.cs 26 KB

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