2
0

SftpClientTest.cs 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Renci.SshNet.Sftp;
  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.Security.Cryptography;
  9. using System.Text;
  10. namespace Renci.SshNet.Tests.Classes
  11. {
  12. /// <summary>
  13. /// Implementation of the SSH File Transfer Protocol (SFTP) over SSH.
  14. /// </summary>
  15. [TestClass]
  16. public partial class SftpClientTest : TestBase
  17. {
  18. private Random _random;
  19. [TestInitialize]
  20. public void SetUp()
  21. {
  22. _random = new Random();
  23. }
  24. [TestMethod]
  25. public void OperationTimeout_Default()
  26. {
  27. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  28. var target = new SftpClient(connectionInfo);
  29. var actual = target.OperationTimeout;
  30. Assert.AreEqual(TimeSpan.FromMilliseconds(-1), actual);
  31. }
  32. [TestMethod]
  33. public void OperationTimeout_InsideLimits()
  34. {
  35. var operationTimeout = TimeSpan.FromMilliseconds(_random.Next(0, int.MaxValue - 1));
  36. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  37. var target = new SftpClient(connectionInfo)
  38. {
  39. OperationTimeout = operationTimeout
  40. };
  41. var actual = target.OperationTimeout;
  42. Assert.AreEqual(operationTimeout, actual);
  43. }
  44. [TestMethod]
  45. public void OperationTimeout_LowerLimit()
  46. {
  47. var operationTimeout = TimeSpan.FromMilliseconds(-1);
  48. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  49. var target = new SftpClient(connectionInfo)
  50. {
  51. OperationTimeout = operationTimeout
  52. };
  53. var actual = target.OperationTimeout;
  54. Assert.AreEqual(operationTimeout, actual);
  55. }
  56. [TestMethod]
  57. public void OperationTimeout_UpperLimit()
  58. {
  59. var operationTimeout = TimeSpan.FromMilliseconds(int.MaxValue);
  60. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  61. var target = new SftpClient(connectionInfo)
  62. {
  63. OperationTimeout = operationTimeout
  64. };
  65. var actual = target.OperationTimeout;
  66. Assert.AreEqual(operationTimeout, actual);
  67. }
  68. [TestMethod]
  69. public void OperationTimeout_LessThanLowerLimit()
  70. {
  71. var operationTimeout = TimeSpan.FromMilliseconds(-2);
  72. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  73. var target = new SftpClient(connectionInfo);
  74. try
  75. {
  76. target.OperationTimeout = operationTimeout;
  77. }
  78. catch (ArgumentOutOfRangeException ex)
  79. {
  80. Assert.IsNull(ex.InnerException);
  81. #if NETFRAMEWORK
  82. Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive." + Environment.NewLine + "Parameter name: " + ex.ParamName, ex.Message);
  83. #else
  84. Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive. (Parameter '" + ex.ParamName + "')", ex.Message);
  85. #endif
  86. Assert.AreEqual("value", ex.ParamName);
  87. }
  88. }
  89. [TestMethod]
  90. public void OperationTimeout_GreaterThanLowerLimit()
  91. {
  92. var operationTimeout = TimeSpan.FromMilliseconds(int.MaxValue).Add(TimeSpan.FromMilliseconds(1));
  93. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  94. var target = new SftpClient(connectionInfo);
  95. try
  96. {
  97. target.OperationTimeout = operationTimeout;
  98. }
  99. catch (ArgumentOutOfRangeException ex)
  100. {
  101. Assert.IsNull(ex.InnerException);
  102. #if NETFRAMEWORK
  103. Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive." + Environment.NewLine + "Parameter name: " + ex.ParamName, ex.Message);
  104. #else
  105. Assert.AreEqual("The timeout must represent a value between -1 and Int32.MaxValue, inclusive. (Parameter '" + ex.ParamName + "')", ex.Message);
  106. #endif
  107. Assert.AreEqual("value", ex.ParamName);
  108. }
  109. }
  110. [TestMethod]
  111. public void OperationTimeout_Disposed()
  112. {
  113. var connectionInfo = new PasswordConnectionInfo("host", 22, "admin", "pwd");
  114. var target = new SftpClient(connectionInfo);
  115. target.Dispose();
  116. // getter
  117. try
  118. {
  119. var actual = target.OperationTimeout;
  120. Assert.Fail("Should have failed, but returned: " + actual);
  121. }
  122. catch (ObjectDisposedException ex)
  123. {
  124. Assert.IsNull(ex.InnerException);
  125. Assert.AreEqual(typeof(SftpClient).FullName, ex.ObjectName);
  126. }
  127. // setter
  128. try
  129. {
  130. target.OperationTimeout = TimeSpan.FromMilliseconds(5);
  131. Assert.Fail();
  132. }
  133. catch (ObjectDisposedException ex)
  134. {
  135. Assert.IsNull(ex.InnerException);
  136. Assert.AreEqual(typeof(SftpClient).FullName, ex.ObjectName);
  137. }
  138. }
  139. /// <summary>
  140. ///A test for SftpClient Constructor
  141. ///</summary>
  142. [TestMethod]
  143. [Ignore] // placeholder for actual test
  144. public void SftpClientConstructorTest()
  145. {
  146. string host = string.Empty; // TODO: Initialize to an appropriate value
  147. string username = string.Empty; // TODO: Initialize to an appropriate value
  148. PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
  149. SftpClient target = new SftpClient(host, username, keyFiles);
  150. Assert.Inconclusive("TODO: Implement code to verify target");
  151. }
  152. /// <summary>
  153. ///A test for SftpClient Constructor
  154. ///</summary>
  155. [TestMethod]
  156. [Ignore] // placeholder for actual test
  157. public void SftpClientConstructorTest1()
  158. {
  159. string host = string.Empty; // TODO: Initialize to an appropriate value
  160. int port = 0; // TODO: Initialize to an appropriate value
  161. string username = string.Empty; // TODO: Initialize to an appropriate value
  162. PrivateKeyFile[] keyFiles = null; // TODO: Initialize to an appropriate value
  163. SftpClient target = new SftpClient(host, port, username, keyFiles);
  164. Assert.Inconclusive("TODO: Implement code to verify target");
  165. }
  166. /// <summary>
  167. ///A test for SftpClient Constructor
  168. ///</summary>
  169. [TestMethod]
  170. [Ignore] // placeholder for actual test
  171. public void SftpClientConstructorTest2()
  172. {
  173. string host = string.Empty; // TODO: Initialize to an appropriate value
  174. string username = string.Empty; // TODO: Initialize to an appropriate value
  175. string password = string.Empty; // TODO: Initialize to an appropriate value
  176. SftpClient target = new SftpClient(host, username, password);
  177. Assert.Inconclusive("TODO: Implement code to verify target");
  178. }
  179. /// <summary>
  180. ///A test for SftpClient Constructor
  181. ///</summary>
  182. [TestMethod]
  183. [Ignore] // placeholder for actual test
  184. public void SftpClientConstructorTest3()
  185. {
  186. string host = string.Empty; // TODO: Initialize to an appropriate value
  187. int port = 0; // TODO: Initialize to an appropriate value
  188. string username = string.Empty; // TODO: Initialize to an appropriate value
  189. string password = string.Empty; // TODO: Initialize to an appropriate value
  190. SftpClient target = new SftpClient(host, port, username, password);
  191. Assert.Inconclusive("TODO: Implement code to verify target");
  192. }
  193. /// <summary>
  194. ///A test for SftpClient Constructor
  195. ///</summary>
  196. [TestMethod]
  197. [Ignore] // placeholder for actual test
  198. public void SftpClientConstructorTest4()
  199. {
  200. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  201. SftpClient target = new SftpClient(connectionInfo);
  202. Assert.Inconclusive("TODO: Implement code to verify target");
  203. }
  204. /// <summary>
  205. ///A test for ChangePermissions
  206. ///</summary>
  207. [TestMethod]
  208. [Ignore] // placeholder for actual test
  209. public void ChangePermissionsTest()
  210. {
  211. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  212. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  213. string path = string.Empty; // TODO: Initialize to an appropriate value
  214. short mode = 0; // TODO: Initialize to an appropriate value
  215. target.ChangePermissions(path, mode);
  216. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  217. }
  218. /// <summary>
  219. ///A test for ChangeDirectory
  220. ///</summary>
  221. [TestMethod]
  222. [Ignore] // placeholder for actual test
  223. public void ChangeDirectoryTest()
  224. {
  225. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  226. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  227. string path = string.Empty; // TODO: Initialize to an appropriate value
  228. target.ChangeDirectory(path);
  229. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  230. }
  231. /// <summary>
  232. ///A test for BeginUploadFile
  233. ///</summary>
  234. [TestMethod]
  235. [Ignore] // placeholder for actual test
  236. public void BeginUploadFileTest()
  237. {
  238. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  239. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  240. Stream input = null; // TODO: Initialize to an appropriate value
  241. string path = string.Empty; // TODO: Initialize to an appropriate value
  242. AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
  243. object state = null; // TODO: Initialize to an appropriate value
  244. Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
  245. IAsyncResult expected = null; // TODO: Initialize to an appropriate value
  246. IAsyncResult actual;
  247. actual = target.BeginUploadFile(input, path, asyncCallback, state, uploadCallback);
  248. Assert.AreEqual(expected, actual);
  249. Assert.Inconclusive("Verify the correctness of this test method.");
  250. }
  251. /// <summary>
  252. ///A test for BeginUploadFile
  253. ///</summary>
  254. [TestMethod]
  255. [Ignore] // placeholder for actual test
  256. public void BeginUploadFileTest1()
  257. {
  258. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  259. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  260. Stream input = null; // TODO: Initialize to an appropriate value
  261. string path = string.Empty; // TODO: Initialize to an appropriate value
  262. bool canOverride = false; // TODO: Initialize to an appropriate value
  263. AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
  264. object state = null; // TODO: Initialize to an appropriate value
  265. Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
  266. IAsyncResult expected = null; // TODO: Initialize to an appropriate value
  267. IAsyncResult actual;
  268. actual = target.BeginUploadFile(input, path, canOverride, asyncCallback, state, uploadCallback);
  269. Assert.AreEqual(expected, actual);
  270. Assert.Inconclusive("Verify the correctness of this test method.");
  271. }
  272. /// <summary>
  273. ///A test for BeginSynchronizeDirectories
  274. ///</summary>
  275. [TestMethod]
  276. [Ignore] // placeholder for actual test
  277. public void BeginSynchronizeDirectoriesTest()
  278. {
  279. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  280. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  281. string sourcePath = string.Empty; // TODO: Initialize to an appropriate value
  282. string destinationPath = string.Empty; // TODO: Initialize to an appropriate value
  283. string searchPattern = string.Empty; // TODO: Initialize to an appropriate value
  284. AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
  285. object state = null; // TODO: Initialize to an appropriate value
  286. IAsyncResult expected = null; // TODO: Initialize to an appropriate value
  287. IAsyncResult actual;
  288. actual = target.BeginSynchronizeDirectories(sourcePath, destinationPath, searchPattern, asyncCallback, state);
  289. Assert.AreEqual(expected, actual);
  290. Assert.Inconclusive("Verify the correctness of this test method.");
  291. }
  292. /// <summary>
  293. ///A test for BeginListDirectory
  294. ///</summary>
  295. [TestMethod]
  296. [Ignore] // placeholder for actual test
  297. public void BeginListDirectoryTest()
  298. {
  299. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  300. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  301. string path = string.Empty; // TODO: Initialize to an appropriate value
  302. AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
  303. object state = null; // TODO: Initialize to an appropriate value
  304. Action<int> listCallback = null; // TODO: Initialize to an appropriate value
  305. IAsyncResult expected = null; // TODO: Initialize to an appropriate value
  306. IAsyncResult actual;
  307. actual = target.BeginListDirectory(path, asyncCallback, state, listCallback);
  308. Assert.AreEqual(expected, actual);
  309. Assert.Inconclusive("Verify the correctness of this test method.");
  310. }
  311. /// <summary>
  312. ///A test for BeginDownloadFile
  313. ///</summary>
  314. [TestMethod]
  315. [Ignore] // placeholder for actual test
  316. public void BeginDownloadFileTest()
  317. {
  318. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  319. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  320. string path = string.Empty; // TODO: Initialize to an appropriate value
  321. Stream output = null; // TODO: Initialize to an appropriate value
  322. AsyncCallback asyncCallback = null; // TODO: Initialize to an appropriate value
  323. object state = null; // TODO: Initialize to an appropriate value
  324. Action<ulong> downloadCallback = null; // TODO: Initialize to an appropriate value
  325. IAsyncResult expected = null; // TODO: Initialize to an appropriate value
  326. IAsyncResult actual;
  327. actual = target.BeginDownloadFile(path, output, asyncCallback, state, downloadCallback);
  328. Assert.AreEqual(expected, actual);
  329. Assert.Inconclusive("Verify the correctness of this test method.");
  330. }
  331. /// <summary>
  332. ///A test for AppendText
  333. ///</summary>
  334. [TestMethod]
  335. [Ignore] // placeholder for actual test
  336. public void AppendTextTest()
  337. {
  338. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  339. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  340. string path = string.Empty; // TODO: Initialize to an appropriate value
  341. Encoding encoding = null; // TODO: Initialize to an appropriate value
  342. StreamWriter expected = null; // TODO: Initialize to an appropriate value
  343. StreamWriter actual;
  344. actual = target.AppendText(path, encoding);
  345. Assert.AreEqual(expected, actual);
  346. Assert.Inconclusive("Verify the correctness of this test method.");
  347. }
  348. /// <summary>
  349. ///A test for AppendText
  350. ///</summary>
  351. [TestMethod]
  352. [Ignore] // placeholder for actual test
  353. public void AppendTextTest1()
  354. {
  355. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  356. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  357. string path = string.Empty; // TODO: Initialize to an appropriate value
  358. StreamWriter expected = null; // TODO: Initialize to an appropriate value
  359. StreamWriter actual;
  360. actual = target.AppendText(path);
  361. Assert.AreEqual(expected, actual);
  362. Assert.Inconclusive("Verify the correctness of this test method.");
  363. }
  364. /// <summary>
  365. ///A test for AppendAllText
  366. ///</summary>
  367. [TestMethod]
  368. [Ignore] // placeholder for actual test
  369. public void AppendAllTextTest()
  370. {
  371. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  372. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  373. string path = string.Empty; // TODO: Initialize to an appropriate value
  374. string contents = string.Empty; // TODO: Initialize to an appropriate value
  375. target.AppendAllText(path, contents);
  376. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  377. }
  378. /// <summary>
  379. ///A test for AppendAllText
  380. ///</summary>
  381. [TestMethod]
  382. [Ignore] // placeholder for actual test
  383. public void AppendAllTextTest1()
  384. {
  385. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  386. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  387. string path = string.Empty; // TODO: Initialize to an appropriate value
  388. string contents = string.Empty; // TODO: Initialize to an appropriate value
  389. Encoding encoding = null; // TODO: Initialize to an appropriate value
  390. target.AppendAllText(path, contents, encoding);
  391. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  392. }
  393. /// <summary>
  394. ///A test for AppendAllLines
  395. ///</summary>
  396. [TestMethod]
  397. [Ignore] // placeholder for actual test
  398. public void AppendAllLinesTest()
  399. {
  400. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  401. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  402. string path = string.Empty; // TODO: Initialize to an appropriate value
  403. IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
  404. target.AppendAllLines(path, contents);
  405. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  406. }
  407. /// <summary>
  408. ///A test for AppendAllLines
  409. ///</summary>
  410. [TestMethod]
  411. [Ignore] // placeholder for actual test
  412. public void AppendAllLinesTest1()
  413. {
  414. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  415. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  416. string path = string.Empty; // TODO: Initialize to an appropriate value
  417. IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
  418. Encoding encoding = null; // TODO: Initialize to an appropriate value
  419. target.AppendAllLines(path, contents, encoding);
  420. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  421. }
  422. /// <summary>
  423. ///A test for CreateText
  424. ///</summary>
  425. [TestMethod]
  426. [Ignore] // placeholder for actual test
  427. public void CreateTextTest()
  428. {
  429. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  430. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  431. string path = string.Empty; // TODO: Initialize to an appropriate value
  432. Encoding encoding = null; // TODO: Initialize to an appropriate value
  433. StreamWriter expected = null; // TODO: Initialize to an appropriate value
  434. StreamWriter actual;
  435. actual = target.CreateText(path, encoding);
  436. Assert.AreEqual(expected, actual);
  437. Assert.Inconclusive("Verify the correctness of this test method.");
  438. }
  439. /// <summary>
  440. ///A test for CreateText
  441. ///</summary>
  442. [TestMethod]
  443. [Ignore] // placeholder for actual test
  444. public void CreateTextTest1()
  445. {
  446. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  447. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  448. string path = string.Empty; // TODO: Initialize to an appropriate value
  449. StreamWriter expected = null; // TODO: Initialize to an appropriate value
  450. StreamWriter actual;
  451. actual = target.CreateText(path);
  452. Assert.AreEqual(expected, actual);
  453. Assert.Inconclusive("Verify the correctness of this test method.");
  454. }
  455. /// <summary>
  456. ///A test for CreateDirectory
  457. ///</summary>
  458. [TestMethod]
  459. [Ignore] // placeholder for actual test
  460. public void CreateDirectoryTest()
  461. {
  462. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  463. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  464. string path = string.Empty; // TODO: Initialize to an appropriate value
  465. target.CreateDirectory(path);
  466. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  467. }
  468. /// <summary>
  469. ///A test for Create
  470. ///</summary>
  471. [TestMethod]
  472. [Ignore] // placeholder for actual test
  473. public void CreateTest()
  474. {
  475. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  476. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  477. string path = string.Empty; // TODO: Initialize to an appropriate value
  478. int bufferSize = 0; // TODO: Initialize to an appropriate value
  479. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  480. SftpFileStream actual;
  481. actual = target.Create(path, bufferSize);
  482. Assert.AreEqual(expected, actual);
  483. Assert.Inconclusive("Verify the correctness of this test method.");
  484. }
  485. /// <summary>
  486. ///A test for Create
  487. ///</summary>
  488. [TestMethod]
  489. [Ignore] // placeholder for actual test
  490. public void CreateTest1()
  491. {
  492. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  493. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  494. string path = string.Empty; // TODO: Initialize to an appropriate value
  495. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  496. SftpFileStream actual;
  497. actual = target.Create(path);
  498. Assert.AreEqual(expected, actual);
  499. Assert.Inconclusive("Verify the correctness of this test method.");
  500. }
  501. /// <summary>
  502. ///A test for EndSynchronizeDirectories
  503. ///</summary>
  504. [TestMethod]
  505. [Ignore] // placeholder for actual test
  506. public void EndSynchronizeDirectoriesTest()
  507. {
  508. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  509. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  510. IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
  511. IEnumerable<FileInfo> expected = null; // TODO: Initialize to an appropriate value
  512. IEnumerable<FileInfo> actual;
  513. actual = target.EndSynchronizeDirectories(asyncResult);
  514. Assert.AreEqual(expected, actual);
  515. Assert.Inconclusive("Verify the correctness of this test method.");
  516. }
  517. /// <summary>
  518. ///A test for EndListDirectory
  519. ///</summary>
  520. [TestMethod]
  521. [Ignore] // placeholder for actual test
  522. public void EndListDirectoryTest()
  523. {
  524. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  525. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  526. IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
  527. IEnumerable<ISftpFile> expected = null; // TODO: Initialize to an appropriate value
  528. IEnumerable<ISftpFile> actual;
  529. actual = target.EndListDirectory(asyncResult);
  530. Assert.AreEqual(expected, actual);
  531. Assert.Inconclusive("Verify the correctness of this test method.");
  532. }
  533. /// <summary>
  534. ///A test for EndDownloadFile
  535. ///</summary>
  536. [TestMethod]
  537. [Ignore] // placeholder for actual test
  538. public void EndDownloadFileTest()
  539. {
  540. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  541. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  542. IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
  543. target.EndDownloadFile(asyncResult);
  544. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  545. }
  546. /// <summary>
  547. ///A test for DownloadFile
  548. ///</summary>
  549. [TestMethod]
  550. [Ignore] // placeholder for actual test
  551. public void DownloadFileTest()
  552. {
  553. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  554. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  555. string path = string.Empty; // TODO: Initialize to an appropriate value
  556. Stream output = null; // TODO: Initialize to an appropriate value
  557. Action<ulong> downloadCallback = null; // TODO: Initialize to an appropriate value
  558. target.DownloadFile(path, output, downloadCallback);
  559. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  560. }
  561. /// <summary>
  562. ///A test for DeleteFile
  563. ///</summary>
  564. [TestMethod]
  565. [Ignore] // placeholder for actual test
  566. public void DeleteFileTest()
  567. {
  568. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  569. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  570. string path = string.Empty; // TODO: Initialize to an appropriate value
  571. target.DeleteFile(path);
  572. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  573. }
  574. /// <summary>
  575. ///A test for DeleteDirectory
  576. ///</summary>
  577. [TestMethod]
  578. [Ignore] // placeholder for actual test
  579. public void DeleteDirectoryTest()
  580. {
  581. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  582. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  583. string path = string.Empty; // TODO: Initialize to an appropriate value
  584. target.DeleteDirectory(path);
  585. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  586. }
  587. /// <summary>
  588. ///A test for Delete
  589. ///</summary>
  590. [TestMethod]
  591. [Ignore] // placeholder for actual test
  592. public void DeleteTest()
  593. {
  594. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  595. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  596. string path = string.Empty; // TODO: Initialize to an appropriate value
  597. target.Delete(path);
  598. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  599. }
  600. /// <summary>
  601. ///A test for GetLastAccessTimeUtc
  602. ///</summary>
  603. [TestMethod]
  604. [Ignore] // placeholder for actual test
  605. public void GetLastAccessTimeUtcTest()
  606. {
  607. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  608. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  609. string path = string.Empty; // TODO: Initialize to an appropriate value
  610. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  611. DateTime actual;
  612. actual = target.GetLastAccessTimeUtc(path);
  613. Assert.AreEqual(expected, actual);
  614. Assert.Inconclusive("Verify the correctness of this test method.");
  615. }
  616. /// <summary>
  617. ///A test for GetLastAccessTime
  618. ///</summary>
  619. [TestMethod]
  620. [Ignore] // placeholder for actual test
  621. public void GetLastAccessTimeTest()
  622. {
  623. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  624. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  625. string path = string.Empty; // TODO: Initialize to an appropriate value
  626. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  627. DateTime actual;
  628. actual = target.GetLastAccessTime(path);
  629. Assert.AreEqual(expected, actual);
  630. Assert.Inconclusive("Verify the correctness of this test method.");
  631. }
  632. /// <summary>
  633. ///A test for GetAttributes
  634. ///</summary>
  635. [TestMethod]
  636. [Ignore] // placeholder for actual test
  637. public void GetAttributesTest()
  638. {
  639. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  640. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  641. string path = string.Empty; // TODO: Initialize to an appropriate value
  642. SftpFileAttributes expected = null; // TODO: Initialize to an appropriate value
  643. SftpFileAttributes actual;
  644. actual = target.GetAttributes(path);
  645. Assert.AreEqual(expected, actual);
  646. Assert.Inconclusive("Verify the correctness of this test method.");
  647. }
  648. /// <summary>
  649. ///A test for Get
  650. ///</summary>
  651. [TestMethod]
  652. [Ignore] // placeholder for actual test
  653. public void GetTest()
  654. {
  655. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  656. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  657. string path = string.Empty; // TODO: Initialize to an appropriate value
  658. ISftpFile expected = null; // TODO: Initialize to an appropriate value
  659. ISftpFile actual;
  660. actual = target.Get(path);
  661. Assert.AreEqual(expected, actual);
  662. Assert.Inconclusive("Verify the correctness of this test method.");
  663. }
  664. /// <summary>
  665. ///A test for Exists
  666. ///</summary>
  667. [TestMethod]
  668. [Ignore] // placeholder for actual test
  669. public void ExistsTest()
  670. {
  671. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  672. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  673. string path = string.Empty; // TODO: Initialize to an appropriate value
  674. bool expected = false; // TODO: Initialize to an appropriate value
  675. bool actual;
  676. actual = target.Exists(path);
  677. Assert.AreEqual(expected, actual);
  678. Assert.Inconclusive("Verify the correctness of this test method.");
  679. }
  680. /// <summary>
  681. ///A test for EndUploadFile
  682. ///</summary>
  683. [TestMethod]
  684. [Ignore] // placeholder for actual test
  685. public void EndUploadFileTest()
  686. {
  687. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  688. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  689. IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value
  690. target.EndUploadFile(asyncResult);
  691. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  692. }
  693. /// <summary>
  694. ///A test for GetLastWriteTimeUtc
  695. ///</summary>
  696. [TestMethod]
  697. [Ignore] // placeholder for actual test
  698. public void GetLastWriteTimeUtcTest()
  699. {
  700. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  701. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  702. string path = string.Empty; // TODO: Initialize to an appropriate value
  703. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  704. DateTime actual;
  705. actual = target.GetLastWriteTimeUtc(path);
  706. Assert.AreEqual(expected, actual);
  707. Assert.Inconclusive("Verify the correctness of this test method.");
  708. }
  709. /// <summary>
  710. ///A test for GetLastWriteTime
  711. ///</summary>
  712. [TestMethod]
  713. [Ignore] // placeholder for actual test
  714. public void GetLastWriteTimeTest()
  715. {
  716. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  717. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  718. string path = string.Empty; // TODO: Initialize to an appropriate value
  719. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  720. DateTime actual;
  721. actual = target.GetLastWriteTime(path);
  722. Assert.AreEqual(expected, actual);
  723. Assert.Inconclusive("Verify the correctness of this test method.");
  724. }
  725. /// <summary>
  726. ///A test for GetStatus
  727. ///</summary>
  728. [TestMethod]
  729. [Ignore] // placeholder for actual test
  730. public void GetStatusTest()
  731. {
  732. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  733. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  734. string path = string.Empty; // TODO: Initialize to an appropriate value
  735. SftpFileSytemInformation expected = null; // TODO: Initialize to an appropriate value
  736. SftpFileSytemInformation actual;
  737. actual = target.GetStatus(path);
  738. Assert.AreEqual(expected, actual);
  739. Assert.Inconclusive("Verify the correctness of this test method.");
  740. }
  741. /// <summary>
  742. ///A test for ListDirectory
  743. ///</summary>
  744. [TestMethod]
  745. [Ignore] // placeholder for actual test
  746. public void ListDirectoryTest()
  747. {
  748. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  749. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  750. string path = string.Empty; // TODO: Initialize to an appropriate value
  751. Action<int> listCallback = null; // TODO: Initialize to an appropriate value
  752. IEnumerable<ISftpFile> expected = null; // TODO: Initialize to an appropriate value
  753. IEnumerable<ISftpFile> actual;
  754. actual = target.ListDirectory(path, listCallback);
  755. Assert.AreEqual(expected, actual);
  756. Assert.Inconclusive("Verify the correctness of this test method.");
  757. }
  758. /// <summary>
  759. ///A test for Open
  760. ///</summary>
  761. [TestMethod]
  762. [Ignore] // placeholder for actual test
  763. public void OpenTest()
  764. {
  765. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  766. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  767. string path = string.Empty; // TODO: Initialize to an appropriate value
  768. FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value
  769. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  770. SftpFileStream actual;
  771. actual = target.Open(path, mode);
  772. Assert.AreEqual(expected, actual);
  773. Assert.Inconclusive("Verify the correctness of this test method.");
  774. }
  775. /// <summary>
  776. ///A test for Open
  777. ///</summary>
  778. [TestMethod]
  779. [Ignore] // placeholder for actual test
  780. public void OpenTest1()
  781. {
  782. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  783. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  784. string path = string.Empty; // TODO: Initialize to an appropriate value
  785. FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value
  786. FileAccess access = new FileAccess(); // TODO: Initialize to an appropriate value
  787. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  788. SftpFileStream actual;
  789. actual = target.Open(path, mode, access);
  790. Assert.AreEqual(expected, actual);
  791. Assert.Inconclusive("Verify the correctness of this test method.");
  792. }
  793. /// <summary>
  794. ///A test for OpenRead
  795. ///</summary>
  796. [TestMethod]
  797. [Ignore] // placeholder for actual test
  798. public void OpenReadTest()
  799. {
  800. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  801. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  802. string path = string.Empty; // TODO: Initialize to an appropriate value
  803. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  804. SftpFileStream actual;
  805. actual = target.OpenRead(path);
  806. Assert.AreEqual(expected, actual);
  807. Assert.Inconclusive("Verify the correctness of this test method.");
  808. }
  809. /// <summary>
  810. ///A test for OpenText
  811. ///</summary>
  812. [TestMethod]
  813. [Ignore] // placeholder for actual test
  814. public void OpenTextTest()
  815. {
  816. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  817. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  818. string path = string.Empty; // TODO: Initialize to an appropriate value
  819. StreamReader expected = null; // TODO: Initialize to an appropriate value
  820. StreamReader actual;
  821. actual = target.OpenText(path);
  822. Assert.AreEqual(expected, actual);
  823. Assert.Inconclusive("Verify the correctness of this test method.");
  824. }
  825. /// <summary>
  826. ///A test for OpenWrite
  827. ///</summary>
  828. [TestMethod]
  829. [Ignore] // placeholder for actual test
  830. public void OpenWriteTest()
  831. {
  832. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  833. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  834. string path = string.Empty; // TODO: Initialize to an appropriate value
  835. SftpFileStream expected = null; // TODO: Initialize to an appropriate value
  836. SftpFileStream actual;
  837. actual = target.OpenWrite(path);
  838. Assert.AreEqual(expected, actual);
  839. Assert.Inconclusive("Verify the correctness of this test method.");
  840. }
  841. /// <summary>
  842. ///A test for ReadAllBytes
  843. ///</summary>
  844. [TestMethod]
  845. [Ignore] // placeholder for actual test
  846. public void ReadAllBytesTest()
  847. {
  848. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  849. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  850. string path = string.Empty; // TODO: Initialize to an appropriate value
  851. byte[] expected = null; // TODO: Initialize to an appropriate value
  852. byte[] actual;
  853. actual = target.ReadAllBytes(path);
  854. Assert.AreEqual(expected, actual);
  855. Assert.Inconclusive("Verify the correctness of this test method.");
  856. }
  857. /// <summary>
  858. ///A test for ReadAllLines
  859. ///</summary>
  860. [TestMethod]
  861. [Ignore] // placeholder for actual test
  862. public void ReadAllLinesTest()
  863. {
  864. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  865. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  866. string path = string.Empty; // TODO: Initialize to an appropriate value
  867. Encoding encoding = null; // TODO: Initialize to an appropriate value
  868. string[] expected = null; // TODO: Initialize to an appropriate value
  869. string[] actual;
  870. actual = target.ReadAllLines(path, encoding);
  871. Assert.AreEqual(expected, actual);
  872. Assert.Inconclusive("Verify the correctness of this test method.");
  873. }
  874. /// <summary>
  875. ///A test for ReadAllLines
  876. ///</summary>
  877. [TestMethod]
  878. [Ignore] // placeholder for actual test
  879. public void ReadAllLinesTest1()
  880. {
  881. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  882. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  883. string path = string.Empty; // TODO: Initialize to an appropriate value
  884. string[] expected = null; // TODO: Initialize to an appropriate value
  885. string[] actual;
  886. actual = target.ReadAllLines(path);
  887. Assert.AreEqual(expected, actual);
  888. Assert.Inconclusive("Verify the correctness of this test method.");
  889. }
  890. /// <summary>
  891. ///A test for ReadAllText
  892. ///</summary>
  893. [TestMethod]
  894. [Ignore] // placeholder for actual test
  895. public void ReadAllTextTest()
  896. {
  897. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  898. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  899. string path = string.Empty; // TODO: Initialize to an appropriate value
  900. Encoding encoding = null; // TODO: Initialize to an appropriate value
  901. string expected = string.Empty; // TODO: Initialize to an appropriate value
  902. string actual;
  903. actual = target.ReadAllText(path, encoding);
  904. Assert.AreEqual(expected, actual);
  905. Assert.Inconclusive("Verify the correctness of this test method.");
  906. }
  907. /// <summary>
  908. ///A test for ReadAllText
  909. ///</summary>
  910. [TestMethod]
  911. [Ignore] // placeholder for actual test
  912. public void ReadAllTextTest1()
  913. {
  914. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  915. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  916. string path = string.Empty; // TODO: Initialize to an appropriate value
  917. string expected = string.Empty; // TODO: Initialize to an appropriate value
  918. string actual;
  919. actual = target.ReadAllText(path);
  920. Assert.AreEqual(expected, actual);
  921. Assert.Inconclusive("Verify the correctness of this test method.");
  922. }
  923. /// <summary>
  924. ///A test for ReadLines
  925. ///</summary>
  926. [TestMethod]
  927. [Ignore] // placeholder for actual test
  928. public void ReadLinesTest()
  929. {
  930. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  931. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  932. string path = string.Empty; // TODO: Initialize to an appropriate value
  933. IEnumerable<string> expected = null; // TODO: Initialize to an appropriate value
  934. IEnumerable<string> actual;
  935. actual = target.ReadLines(path);
  936. Assert.AreEqual(expected, actual);
  937. Assert.Inconclusive("Verify the correctness of this test method.");
  938. }
  939. /// <summary>
  940. ///A test for ReadLines
  941. ///</summary>
  942. [TestMethod]
  943. [Ignore] // placeholder for actual test
  944. public void ReadLinesTest1()
  945. {
  946. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  947. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  948. string path = string.Empty; // TODO: Initialize to an appropriate value
  949. Encoding encoding = null; // TODO: Initialize to an appropriate value
  950. IEnumerable<string> expected = null; // TODO: Initialize to an appropriate value
  951. IEnumerable<string> actual;
  952. actual = target.ReadLines(path, encoding);
  953. Assert.AreEqual(expected, actual);
  954. Assert.Inconclusive("Verify the correctness of this test method.");
  955. }
  956. /// <summary>
  957. ///A test for RenameFile
  958. ///</summary>
  959. [TestMethod]
  960. [Ignore] // placeholder for actual test
  961. public void RenameFileTest()
  962. {
  963. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  964. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  965. string oldPath = string.Empty; // TODO: Initialize to an appropriate value
  966. string newPath = string.Empty; // TODO: Initialize to an appropriate value
  967. target.RenameFile(oldPath, newPath);
  968. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  969. }
  970. /// <summary>
  971. ///A test for RenameFile
  972. ///</summary>
  973. [TestMethod]
  974. [Ignore] // placeholder for actual test
  975. public void RenameFileTest1()
  976. {
  977. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  978. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  979. string oldPath = string.Empty; // TODO: Initialize to an appropriate value
  980. string newPath = string.Empty; // TODO: Initialize to an appropriate value
  981. bool isPosix = false; // TODO: Initialize to an appropriate value
  982. target.RenameFile(oldPath, newPath, isPosix);
  983. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  984. }
  985. /// <summary>
  986. ///A test for SetAttributes
  987. ///</summary>
  988. [TestMethod]
  989. [Ignore] // placeholder for actual test
  990. public void SetAttributesTest()
  991. {
  992. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  993. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  994. string path = string.Empty; // TODO: Initialize to an appropriate value
  995. SftpFileAttributes fileAttributes = null; // TODO: Initialize to an appropriate value
  996. target.SetAttributes(path, fileAttributes);
  997. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  998. }
  999. /// <summary>
  1000. ///A test for SetLastAccessTime
  1001. ///</summary>
  1002. [TestMethod]
  1003. [Ignore] // placeholder for actual test
  1004. public void SetLastAccessTimeTest()
  1005. {
  1006. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1007. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1008. string path = string.Empty; // TODO: Initialize to an appropriate value
  1009. DateTime lastAccessTime = new DateTime(); // TODO: Initialize to an appropriate value
  1010. #pragma warning disable CS0618 // Type or member is obsolete
  1011. target.SetLastAccessTime(path, lastAccessTime);
  1012. #pragma warning restore CS0618 // Type or member is obsolete
  1013. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1014. }
  1015. /// <summary>
  1016. ///A test for SetLastAccessTimeUtc
  1017. ///</summary>
  1018. [TestMethod]
  1019. [Ignore] // placeholder for actual test
  1020. public void SetLastAccessTimeUtcTest()
  1021. {
  1022. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1023. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1024. string path = string.Empty; // TODO: Initialize to an appropriate value
  1025. DateTime lastAccessTimeUtc = new DateTime(); // TODO: Initialize to an appropriate value
  1026. #pragma warning disable CS0618 // Type or member is obsolete
  1027. target.SetLastAccessTimeUtc(path, lastAccessTimeUtc);
  1028. #pragma warning restore CS0618 // Type or member is obsolete
  1029. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1030. }
  1031. /// <summary>
  1032. ///A test for SetLastWriteTime
  1033. ///</summary>
  1034. [TestMethod]
  1035. [Ignore] // placeholder for actual test
  1036. public void SetLastWriteTimeTest()
  1037. {
  1038. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1039. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1040. string path = string.Empty; // TODO: Initialize to an appropriate value
  1041. DateTime lastWriteTime = new DateTime(); // TODO: Initialize to an appropriate value
  1042. #pragma warning disable CS0618 // Type or member is obsolete
  1043. target.SetLastWriteTime(path, lastWriteTime);
  1044. #pragma warning restore CS0618 // Type or member is obsolete
  1045. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1046. }
  1047. /// <summary>
  1048. ///A test for SetLastWriteTimeUtc
  1049. ///</summary>
  1050. [TestMethod]
  1051. [Ignore] // placeholder for actual test
  1052. public void SetLastWriteTimeUtcTest()
  1053. {
  1054. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1055. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1056. string path = string.Empty; // TODO: Initialize to an appropriate value
  1057. DateTime lastWriteTimeUtc = new DateTime(); // TODO: Initialize to an appropriate value
  1058. #pragma warning disable CS0618 // Type or member is obsolete
  1059. target.SetLastWriteTimeUtc(path, lastWriteTimeUtc);
  1060. #pragma warning restore CS0618 // Type or member is obsolete
  1061. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1062. }
  1063. /// <summary>
  1064. ///A test for SymbolicLink
  1065. ///</summary>
  1066. [TestMethod]
  1067. [Ignore] // placeholder for actual test
  1068. public void SymbolicLinkTest()
  1069. {
  1070. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1071. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1072. string path = string.Empty; // TODO: Initialize to an appropriate value
  1073. string linkPath = string.Empty; // TODO: Initialize to an appropriate value
  1074. target.SymbolicLink(path, linkPath);
  1075. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1076. }
  1077. /// <summary>
  1078. ///A test for SynchronizeDirectories
  1079. ///</summary>
  1080. [TestMethod]
  1081. [Ignore] // placeholder for actual test
  1082. public void SynchronizeDirectoriesTest()
  1083. {
  1084. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1085. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1086. string sourcePath = string.Empty; // TODO: Initialize to an appropriate value
  1087. string destinationPath = string.Empty; // TODO: Initialize to an appropriate value
  1088. string searchPattern = string.Empty; // TODO: Initialize to an appropriate value
  1089. IEnumerable<FileInfo> expected = null; // TODO: Initialize to an appropriate value
  1090. IEnumerable<FileInfo> actual;
  1091. actual = target.SynchronizeDirectories(sourcePath, destinationPath, searchPattern);
  1092. Assert.AreEqual(expected, actual);
  1093. Assert.Inconclusive("Verify the correctness of this test method.");
  1094. }
  1095. /// <summary>
  1096. ///A test for UploadFile
  1097. ///</summary>
  1098. [TestMethod]
  1099. [Ignore] // placeholder for actual test
  1100. public void UploadFileTest()
  1101. {
  1102. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1103. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1104. Stream input = null; // TODO: Initialize to an appropriate value
  1105. string path = string.Empty; // TODO: Initialize to an appropriate value
  1106. Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
  1107. target.UploadFile(input, path, uploadCallback);
  1108. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1109. }
  1110. /// <summary>
  1111. ///A test for UploadFile
  1112. ///</summary>
  1113. [TestMethod]
  1114. [Ignore] // placeholder for actual test
  1115. public void UploadFileTest1()
  1116. {
  1117. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1118. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1119. Stream input = null; // TODO: Initialize to an appropriate value
  1120. string path = string.Empty; // TODO: Initialize to an appropriate value
  1121. bool canOverride = false; // TODO: Initialize to an appropriate value
  1122. Action<ulong> uploadCallback = null; // TODO: Initialize to an appropriate value
  1123. target.UploadFile(input, path, canOverride, uploadCallback);
  1124. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1125. }
  1126. /// <summary>
  1127. ///A test for WriteAllBytes
  1128. ///</summary>
  1129. [TestMethod]
  1130. [Ignore] // placeholder for actual test
  1131. public void WriteAllBytesTest()
  1132. {
  1133. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1134. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1135. string path = string.Empty; // TODO: Initialize to an appropriate value
  1136. byte[] bytes = null; // TODO: Initialize to an appropriate value
  1137. target.WriteAllBytes(path, bytes);
  1138. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1139. }
  1140. /// <summary>
  1141. ///A test for WriteAllLines
  1142. ///</summary>
  1143. [TestMethod]
  1144. [Ignore] // placeholder for actual test
  1145. public void WriteAllLinesTest()
  1146. {
  1147. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1148. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1149. string path = string.Empty; // TODO: Initialize to an appropriate value
  1150. IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
  1151. target.WriteAllLines(path, contents);
  1152. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1153. }
  1154. /// <summary>
  1155. ///A test for WriteAllLines
  1156. ///</summary>
  1157. [TestMethod]
  1158. [Ignore] // placeholder for actual test
  1159. public void WriteAllLinesTest1()
  1160. {
  1161. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1162. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1163. string path = string.Empty; // TODO: Initialize to an appropriate value
  1164. string[] contents = null; // TODO: Initialize to an appropriate value
  1165. target.WriteAllLines(path, contents);
  1166. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1167. }
  1168. /// <summary>
  1169. ///A test for WriteAllLines
  1170. ///</summary>
  1171. [TestMethod]
  1172. [Ignore] // placeholder for actual test
  1173. public void WriteAllLinesTest2()
  1174. {
  1175. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1176. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1177. string path = string.Empty; // TODO: Initialize to an appropriate value
  1178. IEnumerable<string> contents = null; // TODO: Initialize to an appropriate value
  1179. Encoding encoding = null; // TODO: Initialize to an appropriate value
  1180. target.WriteAllLines(path, contents, encoding);
  1181. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1182. }
  1183. /// <summary>
  1184. ///A test for WriteAllLines
  1185. ///</summary>
  1186. [TestMethod]
  1187. [Ignore] // placeholder for actual test
  1188. public void WriteAllLinesTest3()
  1189. {
  1190. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1191. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1192. string path = string.Empty; // TODO: Initialize to an appropriate value
  1193. string[] contents = null; // TODO: Initialize to an appropriate value
  1194. Encoding encoding = null; // TODO: Initialize to an appropriate value
  1195. target.WriteAllLines(path, contents, encoding);
  1196. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1197. }
  1198. /// <summary>
  1199. ///A test for WriteAllText
  1200. ///</summary>
  1201. [TestMethod]
  1202. [Ignore] // placeholder for actual test
  1203. public void WriteAllTextTest()
  1204. {
  1205. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1206. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1207. string path = string.Empty; // TODO: Initialize to an appropriate value
  1208. string contents = string.Empty; // TODO: Initialize to an appropriate value
  1209. target.WriteAllText(path, contents);
  1210. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1211. }
  1212. /// <summary>
  1213. ///A test for WriteAllText
  1214. ///</summary>
  1215. [TestMethod]
  1216. [Ignore] // placeholder for actual test
  1217. public void WriteAllTextTest1()
  1218. {
  1219. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1220. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1221. string path = string.Empty; // TODO: Initialize to an appropriate value
  1222. string contents = string.Empty; // TODO: Initialize to an appropriate value
  1223. Encoding encoding = null; // TODO: Initialize to an appropriate value
  1224. target.WriteAllText(path, contents, encoding);
  1225. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  1226. }
  1227. /// <summary>
  1228. ///A test for BufferSize
  1229. ///</summary>
  1230. [TestMethod]
  1231. [Ignore] // placeholder for actual test
  1232. public void BufferSizeTest()
  1233. {
  1234. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1235. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1236. uint expected = 0; // TODO: Initialize to an appropriate value
  1237. uint actual;
  1238. target.BufferSize = expected;
  1239. actual = target.BufferSize;
  1240. Assert.AreEqual(expected, actual);
  1241. Assert.Inconclusive("Verify the correctness of this test method.");
  1242. }
  1243. /// <summary>
  1244. ///A test for OperationTimeout
  1245. ///</summary>
  1246. [TestMethod]
  1247. [Ignore] // placeholder for actual test
  1248. public void OperationTimeoutTest()
  1249. {
  1250. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1251. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1252. TimeSpan expected = new TimeSpan(); // TODO: Initialize to an appropriate value
  1253. TimeSpan actual;
  1254. target.OperationTimeout = expected;
  1255. actual = target.OperationTimeout;
  1256. Assert.AreEqual(expected, actual);
  1257. Assert.Inconclusive("Verify the correctness of this test method.");
  1258. }
  1259. /// <summary>
  1260. ///A test for WorkingDirectory
  1261. ///</summary>
  1262. [TestMethod]
  1263. [Ignore] // placeholder for actual test
  1264. public void WorkingDirectoryTest()
  1265. {
  1266. ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
  1267. SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
  1268. string actual;
  1269. actual = target.WorkingDirectory;
  1270. Assert.Inconclusive("Verify the correctness of this test method.");
  1271. }
  1272. protected static string CalculateMD5(string fileName)
  1273. {
  1274. using (FileStream file = new FileStream(fileName, FileMode.Open))
  1275. {
  1276. MD5 md5 = new MD5CryptoServiceProvider();
  1277. byte[] retVal = md5.ComputeHash(file);
  1278. file.Close();
  1279. StringBuilder sb = new StringBuilder();
  1280. for (int i = 0; i < retVal.Length; i++)
  1281. {
  1282. sb.Append(retVal[i].ToString("x2"));
  1283. }
  1284. return sb.ToString();
  1285. }
  1286. }
  1287. private static void RemoveAllFiles()
  1288. {
  1289. using (var client = new SshClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  1290. {
  1291. client.Connect();
  1292. client.RunCommand("rm -rf *");
  1293. client.Disconnect();
  1294. }
  1295. }
  1296. /// <summary>
  1297. /// Helper class to help with upload and download testing
  1298. /// </summary>
  1299. private class TestInfo
  1300. {
  1301. public string RemoteFileName { get; set; }
  1302. public string UploadedFileName { get; set; }
  1303. public string DownloadedFileName { get; set; }
  1304. //public ulong UploadedBytes { get; set; }
  1305. //public ulong DownloadedBytes { get; set; }
  1306. public FileStream UploadedFile { get; set; }
  1307. public FileStream DownloadedFile { get; set; }
  1308. public string UploadedHash { get; set; }
  1309. public string DownloadedHash { get; set; }
  1310. public SftpUploadAsyncResult UploadResult { get; set; }
  1311. public SftpDownloadAsyncResult DownloadResult { get; set; }
  1312. }
  1313. }
  1314. }