SftpFileTest.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Renci.SshNet.Common;
  3. using Renci.SshNet.Sftp;
  4. using Renci.SshNet.Tests.Common;
  5. using Renci.SshNet.Tests.Properties;
  6. using System;
  7. using System.IO;
  8. namespace Renci.SshNet.Tests.Classes.Sftp
  9. {
  10. /// <summary>
  11. /// Represents SFTP file information
  12. /// </summary>
  13. [TestClass]
  14. public class SftpFileTest : TestBase
  15. {
  16. [TestMethod]
  17. [TestCategory("Sftp")]
  18. public void Test_Get_Root_Directory()
  19. {
  20. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  21. {
  22. sftp.Connect();
  23. var directory = sftp.Get("/");
  24. Assert.AreEqual("/", directory.FullName);
  25. Assert.IsTrue(directory.IsDirectory);
  26. Assert.IsFalse(directory.IsRegularFile);
  27. }
  28. }
  29. [TestMethod]
  30. [TestCategory("Sftp")]
  31. [ExpectedException(typeof(SftpPathNotFoundException))]
  32. public void Test_Get_Invalid_Directory()
  33. {
  34. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  35. {
  36. sftp.Connect();
  37. sftp.Get("/xyz");
  38. }
  39. }
  40. [TestMethod]
  41. [TestCategory("Sftp")]
  42. public void Test_Get_File()
  43. {
  44. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  45. {
  46. sftp.Connect();
  47. sftp.UploadFile(new MemoryStream(), "abc.txt");
  48. var file = sftp.Get("abc.txt");
  49. Assert.AreEqual("/home/tester/abc.txt", file.FullName);
  50. Assert.IsTrue(file.IsRegularFile);
  51. Assert.IsFalse(file.IsDirectory);
  52. }
  53. }
  54. [TestMethod]
  55. [TestCategory("Sftp")]
  56. [Description("Test passing null to Get.")]
  57. [ExpectedException(typeof(ArgumentNullException))]
  58. public void Test_Get_File_Null()
  59. {
  60. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  61. {
  62. sftp.Connect();
  63. var file = sftp.Get(null);
  64. sftp.Disconnect();
  65. }
  66. }
  67. [TestMethod]
  68. [TestCategory("Sftp")]
  69. public void Test_Get_International_File()
  70. {
  71. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  72. {
  73. sftp.Connect();
  74. sftp.UploadFile(new MemoryStream(), "test-üöä-");
  75. var file = sftp.Get("test-üöä-");
  76. Assert.AreEqual("/home/tester/test-üöä-", file.FullName);
  77. Assert.IsTrue(file.IsRegularFile);
  78. Assert.IsFalse(file.IsDirectory);
  79. }
  80. }
  81. [TestMethod]
  82. [TestCategory("Sftp")]
  83. public void Test_Sftp_SftpFile_MoveTo()
  84. {
  85. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  86. {
  87. sftp.Connect();
  88. string uploadedFileName = Path.GetTempFileName();
  89. string remoteFileName = Path.GetRandomFileName();
  90. string newFileName = Path.GetRandomFileName();
  91. this.CreateTestFile(uploadedFileName, 1);
  92. using (var file = File.OpenRead(uploadedFileName))
  93. {
  94. sftp.UploadFile(file, remoteFileName);
  95. }
  96. var sftpFile = sftp.Get(remoteFileName);
  97. sftpFile.MoveTo(newFileName);
  98. Assert.AreEqual(newFileName, sftpFile.Name);
  99. sftp.Disconnect();
  100. }
  101. }
  102. /// <summary>
  103. ///A test for Delete
  104. ///</summary>
  105. [TestMethod]
  106. [Ignore] // placeholder for actual test
  107. public void DeleteTest()
  108. {
  109. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  110. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  111. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  112. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  113. target.Delete();
  114. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  115. }
  116. /// <summary>
  117. ///A test for MoveTo
  118. ///</summary>
  119. [TestMethod]
  120. [Ignore] // placeholder for actual test
  121. public void MoveToTest()
  122. {
  123. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  124. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  125. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  126. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  127. string destFileName = string.Empty; // TODO: Initialize to an appropriate value
  128. target.MoveTo(destFileName);
  129. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  130. }
  131. /// <summary>
  132. ///A test for SetPermissions
  133. ///</summary>
  134. [TestMethod]
  135. [Ignore] // placeholder for actual test
  136. public void SetPermissionsTest()
  137. {
  138. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  139. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  140. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  141. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  142. short mode = 0; // TODO: Initialize to an appropriate value
  143. target.SetPermissions(mode);
  144. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  145. }
  146. /// <summary>
  147. ///A test for ToString
  148. ///</summary>
  149. [TestMethod]
  150. [Ignore] // placeholder for actual test
  151. public void ToStringTest()
  152. {
  153. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  154. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  155. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  156. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  157. string expected = string.Empty; // TODO: Initialize to an appropriate value
  158. string actual;
  159. actual = target.ToString();
  160. Assert.AreEqual(expected, actual);
  161. Assert.Inconclusive("Verify the correctness of this test method.");
  162. }
  163. /// <summary>
  164. ///A test for UpdateStatus
  165. ///</summary>
  166. [TestMethod]
  167. [Ignore] // placeholder for actual test
  168. public void UpdateStatusTest()
  169. {
  170. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  171. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  172. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  173. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  174. target.UpdateStatus();
  175. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  176. }
  177. /// <summary>
  178. ///A test for GroupCanExecute
  179. ///</summary>
  180. [TestMethod]
  181. [Ignore] // placeholder for actual test
  182. public void GroupCanExecuteTest()
  183. {
  184. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  185. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  186. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  187. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  188. bool expected = false; // TODO: Initialize to an appropriate value
  189. bool actual;
  190. target.GroupCanExecute = expected;
  191. actual = target.GroupCanExecute;
  192. Assert.AreEqual(expected, actual);
  193. Assert.Inconclusive("Verify the correctness of this test method.");
  194. }
  195. /// <summary>
  196. ///A test for GroupCanRead
  197. ///</summary>
  198. [TestMethod]
  199. [Ignore] // placeholder for actual test
  200. public void GroupCanReadTest()
  201. {
  202. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  203. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  204. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  205. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  206. bool expected = false; // TODO: Initialize to an appropriate value
  207. bool actual;
  208. target.GroupCanRead = expected;
  209. actual = target.GroupCanRead;
  210. Assert.AreEqual(expected, actual);
  211. Assert.Inconclusive("Verify the correctness of this test method.");
  212. }
  213. /// <summary>
  214. ///A test for GroupCanWrite
  215. ///</summary>
  216. [TestMethod]
  217. [Ignore] // placeholder for actual test
  218. public void GroupCanWriteTest()
  219. {
  220. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  221. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  222. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  223. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  224. bool expected = false; // TODO: Initialize to an appropriate value
  225. bool actual;
  226. target.GroupCanWrite = expected;
  227. actual = target.GroupCanWrite;
  228. Assert.AreEqual(expected, actual);
  229. Assert.Inconclusive("Verify the correctness of this test method.");
  230. }
  231. /// <summary>
  232. ///A test for GroupId
  233. ///</summary>
  234. [TestMethod]
  235. [Ignore] // placeholder for actual test
  236. public void GroupIdTest()
  237. {
  238. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  239. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  240. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  241. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  242. int expected = 0; // TODO: Initialize to an appropriate value
  243. int actual;
  244. target.GroupId = expected;
  245. actual = target.GroupId;
  246. Assert.AreEqual(expected, actual);
  247. Assert.Inconclusive("Verify the correctness of this test method.");
  248. }
  249. /// <summary>
  250. ///A test for IsBlockDevice
  251. ///</summary>
  252. [TestMethod]
  253. [Ignore] // placeholder for actual test
  254. public void IsBlockDeviceTest()
  255. {
  256. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  257. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  258. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  259. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  260. bool actual;
  261. actual = target.IsBlockDevice;
  262. Assert.Inconclusive("Verify the correctness of this test method.");
  263. }
  264. /// <summary>
  265. ///A test for IsCharacterDevice
  266. ///</summary>
  267. [TestMethod]
  268. [Ignore] // placeholder for actual test
  269. public void IsCharacterDeviceTest()
  270. {
  271. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  272. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  273. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  274. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  275. bool actual;
  276. actual = target.IsCharacterDevice;
  277. Assert.Inconclusive("Verify the correctness of this test method.");
  278. }
  279. /// <summary>
  280. ///A test for IsDirectory
  281. ///</summary>
  282. [TestMethod]
  283. [Ignore] // placeholder for actual test
  284. public void IsDirectoryTest()
  285. {
  286. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  287. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  288. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  289. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  290. bool actual;
  291. actual = target.IsDirectory;
  292. Assert.Inconclusive("Verify the correctness of this test method.");
  293. }
  294. /// <summary>
  295. ///A test for IsNamedPipe
  296. ///</summary>
  297. [TestMethod]
  298. [Ignore] // placeholder for actual test
  299. public void IsNamedPipeTest()
  300. {
  301. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  302. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  303. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  304. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  305. bool actual;
  306. actual = target.IsNamedPipe;
  307. Assert.Inconclusive("Verify the correctness of this test method.");
  308. }
  309. /// <summary>
  310. ///A test for IsRegularFile
  311. ///</summary>
  312. [TestMethod]
  313. [Ignore] // placeholder for actual test
  314. public void IsRegularFileTest()
  315. {
  316. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  317. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  318. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  319. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  320. bool actual;
  321. actual = target.IsRegularFile;
  322. Assert.Inconclusive("Verify the correctness of this test method.");
  323. }
  324. /// <summary>
  325. ///A test for IsSocket
  326. ///</summary>
  327. [TestMethod]
  328. [Ignore] // placeholder for actual test
  329. public void IsSocketTest()
  330. {
  331. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  332. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  333. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  334. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  335. bool actual;
  336. actual = target.IsSocket;
  337. Assert.Inconclusive("Verify the correctness of this test method.");
  338. }
  339. /// <summary>
  340. ///A test for IsSymbolicLink
  341. ///</summary>
  342. [TestMethod]
  343. [Ignore] // placeholder for actual test
  344. public void IsSymbolicLinkTest()
  345. {
  346. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  347. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  348. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  349. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  350. bool actual;
  351. actual = target.IsSymbolicLink;
  352. Assert.Inconclusive("Verify the correctness of this test method.");
  353. }
  354. /// <summary>
  355. ///A test for LastAccessTime
  356. ///</summary>
  357. [TestMethod]
  358. [Ignore] // placeholder for actual test
  359. public void LastAccessTimeTest()
  360. {
  361. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  362. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  363. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  364. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  365. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  366. DateTime actual;
  367. target.LastAccessTime = expected;
  368. actual = target.LastAccessTime;
  369. Assert.AreEqual(expected, actual);
  370. Assert.Inconclusive("Verify the correctness of this test method.");
  371. }
  372. /// <summary>
  373. ///A test for LastAccessTimeUtc
  374. ///</summary>
  375. [TestMethod]
  376. [Ignore] // placeholder for actual test
  377. public void LastAccessTimeUtcTest()
  378. {
  379. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  380. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  381. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  382. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  383. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  384. DateTime actual;
  385. target.LastAccessTimeUtc = expected;
  386. actual = target.LastAccessTimeUtc;
  387. Assert.AreEqual(expected, actual);
  388. Assert.Inconclusive("Verify the correctness of this test method.");
  389. }
  390. /// <summary>
  391. ///A test for LastWriteTime
  392. ///</summary>
  393. [TestMethod]
  394. [Ignore] // placeholder for actual test
  395. public void LastWriteTimeTest()
  396. {
  397. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  398. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  399. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  400. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  401. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  402. DateTime actual;
  403. target.LastWriteTime = expected;
  404. actual = target.LastWriteTime;
  405. Assert.AreEqual(expected, actual);
  406. Assert.Inconclusive("Verify the correctness of this test method.");
  407. }
  408. /// <summary>
  409. ///A test for LastWriteTimeUtc
  410. ///</summary>
  411. [TestMethod]
  412. [Ignore] // placeholder for actual test
  413. public void LastWriteTimeUtcTest()
  414. {
  415. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  416. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  417. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  418. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  419. DateTime expected = new DateTime(); // TODO: Initialize to an appropriate value
  420. DateTime actual;
  421. target.LastWriteTimeUtc = expected;
  422. actual = target.LastWriteTimeUtc;
  423. Assert.AreEqual(expected, actual);
  424. Assert.Inconclusive("Verify the correctness of this test method.");
  425. }
  426. /// <summary>
  427. ///A test for Length
  428. ///</summary>
  429. [TestMethod]
  430. [Ignore] // placeholder for actual test
  431. public void LengthTest()
  432. {
  433. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  434. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  435. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  436. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  437. long actual;
  438. actual = target.Length;
  439. Assert.Inconclusive("Verify the correctness of this test method.");
  440. }
  441. /// <summary>
  442. ///A test for OthersCanExecute
  443. ///</summary>
  444. [TestMethod]
  445. [Ignore] // placeholder for actual test
  446. public void OthersCanExecuteTest()
  447. {
  448. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  449. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  450. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  451. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  452. bool expected = false; // TODO: Initialize to an appropriate value
  453. bool actual;
  454. target.OthersCanExecute = expected;
  455. actual = target.OthersCanExecute;
  456. Assert.AreEqual(expected, actual);
  457. Assert.Inconclusive("Verify the correctness of this test method.");
  458. }
  459. /// <summary>
  460. ///A test for OthersCanRead
  461. ///</summary>
  462. [TestMethod]
  463. [Ignore] // placeholder for actual test
  464. public void OthersCanReadTest()
  465. {
  466. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  467. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  468. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  469. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  470. bool expected = false; // TODO: Initialize to an appropriate value
  471. bool actual;
  472. target.OthersCanRead = expected;
  473. actual = target.OthersCanRead;
  474. Assert.AreEqual(expected, actual);
  475. Assert.Inconclusive("Verify the correctness of this test method.");
  476. }
  477. /// <summary>
  478. ///A test for OthersCanWrite
  479. ///</summary>
  480. [TestMethod]
  481. [Ignore] // placeholder for actual test
  482. public void OthersCanWriteTest()
  483. {
  484. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  485. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  486. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  487. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  488. bool expected = false; // TODO: Initialize to an appropriate value
  489. bool actual;
  490. target.OthersCanWrite = expected;
  491. actual = target.OthersCanWrite;
  492. Assert.AreEqual(expected, actual);
  493. Assert.Inconclusive("Verify the correctness of this test method.");
  494. }
  495. /// <summary>
  496. ///A test for OwnerCanExecute
  497. ///</summary>
  498. [TestMethod]
  499. [Ignore] // placeholder for actual test
  500. public void OwnerCanExecuteTest()
  501. {
  502. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  503. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  504. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  505. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  506. bool expected = false; // TODO: Initialize to an appropriate value
  507. bool actual;
  508. target.OwnerCanExecute = expected;
  509. actual = target.OwnerCanExecute;
  510. Assert.AreEqual(expected, actual);
  511. Assert.Inconclusive("Verify the correctness of this test method.");
  512. }
  513. /// <summary>
  514. ///A test for OwnerCanRead
  515. ///</summary>
  516. [TestMethod]
  517. [Ignore] // placeholder for actual test
  518. public void OwnerCanReadTest()
  519. {
  520. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  521. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  522. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  523. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  524. bool expected = false; // TODO: Initialize to an appropriate value
  525. bool actual;
  526. target.OwnerCanRead = expected;
  527. actual = target.OwnerCanRead;
  528. Assert.AreEqual(expected, actual);
  529. Assert.Inconclusive("Verify the correctness of this test method.");
  530. }
  531. /// <summary>
  532. ///A test for OwnerCanWrite
  533. ///</summary>
  534. [TestMethod]
  535. [Ignore] // placeholder for actual test
  536. public void OwnerCanWriteTest()
  537. {
  538. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  539. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  540. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  541. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  542. bool expected = false; // TODO: Initialize to an appropriate value
  543. bool actual;
  544. target.OwnerCanWrite = expected;
  545. actual = target.OwnerCanWrite;
  546. Assert.AreEqual(expected, actual);
  547. Assert.Inconclusive("Verify the correctness of this test method.");
  548. }
  549. /// <summary>
  550. ///A test for UserId
  551. ///</summary>
  552. [TestMethod]
  553. [Ignore] // placeholder for actual test
  554. public void UserIdTest()
  555. {
  556. SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
  557. string fullName = string.Empty; // TODO: Initialize to an appropriate value
  558. SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
  559. SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
  560. int expected = 0; // TODO: Initialize to an appropriate value
  561. int actual;
  562. target.UserId = expected;
  563. actual = target.UserId;
  564. Assert.AreEqual(expected, actual);
  565. Assert.Inconclusive("Verify the correctness of this test method.");
  566. }
  567. }
  568. }