-
-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable list directory async for net framework (#1206)
* Enable ListDirectoryAsync for .NET Framework * Removed (now) unused constant.
- Loading branch information
1 parent
1c7166a
commit 91d1ed2
Showing
5 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
src/Renci.SshNet.Tests/Classes/SftpClientTest.ListDirectory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Renci.SshNet.Tests/Classes/SftpClientTest.ListDirectoryAsync.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Diagnostics; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Renci.SshNet.Common; | ||
using Renci.SshNet.Tests.Properties; | ||
|
||
namespace Renci.SshNet.Tests.Classes | ||
{ | ||
/// <summary> | ||
/// Implementation of the SSH File Transfer Protocol (SFTP) over SSH. | ||
/// </summary> | ||
public partial class SftpClientTest | ||
{ | ||
[TestMethod] | ||
[TestCategory("Sftp")] | ||
[ExpectedException(typeof(SshConnectionException))] | ||
public async Task Test_Sftp_ListDirectoryAsync_Without_ConnectingAsync() | ||
{ | ||
using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD)) | ||
{ | ||
await foreach (var file in sftp.ListDirectoryAsync(".", CancellationToken.None)) | ||
{ | ||
Debug.WriteLine(file.FullName); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters