-
-
Notifications
You must be signed in to change notification settings - Fork 980
Expand file tree
/
Copy pathSftpClientTest.GetAttributes.cs
More file actions
47 lines (39 loc) · 1.34 KB
/
SftpClientTest.GetAttributes.cs
File metadata and controls
47 lines (39 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Renci.SshNet.Common;
namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
{
public partial class SftpClientTest
{
[TestMethod]
[TestCategory("Sftp")]
public void Test_Sftp_GetAttributes_Not_Exists()
{
using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
{
sftp.Connect();
Assert.ThrowsExactly<SftpPathNotFoundException>(() => sftp.GetAttributes("/asdfgh"));
}
}
[TestMethod]
[TestCategory("Sftp")]
public void Test_Sftp_GetAttributes_Null()
{
using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
{
sftp.Connect();
Assert.ThrowsExactly<ArgumentNullException>(() => sftp.GetAttributes(null));
}
}
[TestMethod]
[TestCategory("Sftp")]
public void Test_Sftp_GetAttributes_Current()
{
using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
{
sftp.Connect();
var attributes = sftp.GetAttributes(".");
Assert.IsNotNull(attributes);
sftp.Disconnect();
}
}
}
}