public void Test_Sftp_BeginSynchronizeDirectories() { RemoveAllFiles(); using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD)) { sftp.Connect(); string uploadedFileName = Path.GetTempFileName(); string sourceDir = Path.GetDirectoryName(uploadedFileName); string destDir = "/"; string searchPattern = Path.GetFileName(uploadedFileName); var asyncResult = sftp.BeginSynchronizeDirectories(sourceDir, destDir, searchPattern, null, null ); // Wait for the WaitHandle to become signaled. asyncResult.AsyncWaitHandle.WaitOne(1000); var upLoadedFiles = sftp.EndSynchronizeDirectories(asyncResult); Assert.IsTrue(upLoadedFiles.Count() > 0); foreach (var file in upLoadedFiles) { Debug.WriteLine(file.FullName); } // Close the wait handle. asyncResult.AsyncWaitHandle.Close(); sftp.Disconnect(); } }
public void EndSynchronizeDirectoriesTest() { ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value IAsyncResult asyncResult = null; // TODO: Initialize to an appropriate value IEnumerable<FileInfo> expected = null; // TODO: Initialize to an appropriate value IEnumerable<FileInfo> actual; actual = target.EndSynchronizeDirectories(asyncResult); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }