2
0

SftpClientTest.ListDirectory.cs 687 B

1234567891011121314151617181920212223
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Renci.SshNet.Common;
  3. using Renci.SshNet.Tests.Properties;
  4. namespace Renci.SshNet.Tests.Classes
  5. {
  6. /// <summary>
  7. /// Implementation of the SSH File Transfer Protocol (SFTP) over SSH.
  8. /// </summary>
  9. public partial class SftpClientTest
  10. {
  11. [TestMethod]
  12. [TestCategory("Sftp")]
  13. public void Test_Sftp_ListDirectory_Without_Connecting()
  14. {
  15. using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
  16. {
  17. Assert.ThrowsException<SshConnectionException>(() => sftp.ListDirectory("."));
  18. }
  19. }
  20. }
  21. }