|
|
@@ -19,6 +19,18 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ [ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Root_Dont_ExistsAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/asdasd", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[TestMethod]
|
|
|
[TestCategory("Sftp")]
|
|
|
[ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
@@ -31,6 +43,18 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ [ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Root_With_Slash_Dont_ExistsAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/asdasd/", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[TestMethod]
|
|
|
[TestCategory("Sftp")]
|
|
|
[ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
@@ -43,6 +67,18 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ [ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Subfolder_Dont_ExistsAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/asdasd/sssddds", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[TestMethod]
|
|
|
[TestCategory("Sftp")]
|
|
|
[ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
@@ -55,6 +91,18 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ [ExpectedException(typeof(SftpPathNotFoundException))]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Subfolder_With_Slash_Dont_ExistsAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/asdasd/sssddds/", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[TestMethod]
|
|
|
[TestCategory("Sftp")]
|
|
|
public void Test_Sftp_ChangeDirectory_Which_Exists()
|
|
|
@@ -67,6 +115,18 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Which_ExistsAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/usr", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ Assert.AreEqual("/usr", sftp.WorkingDirectory);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[TestMethod]
|
|
|
[TestCategory("Sftp")]
|
|
|
public void Test_Sftp_ChangeDirectory_Which_Exists_With_Slash()
|
|
|
@@ -78,5 +138,17 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
|
|
|
Assert.AreEqual("/usr", sftp.WorkingDirectory);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ [TestMethod]
|
|
|
+ [TestCategory("Sftp")]
|
|
|
+ public async Task Test_Sftp_ChangeDirectory_Which_Exists_With_SlashAsync()
|
|
|
+ {
|
|
|
+ using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
|
|
|
+ {
|
|
|
+ await sftp.ConnectAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await sftp.ChangeDirectoryAsync("/usr/", CancellationToken.None).ConfigureAwait(false);
|
|
|
+ Assert.AreEqual("/usr", sftp.WorkingDirectory);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|