public void GetRemoteUri() { var uri = new FileAdapterConnectionUri(new Uri( "file://server/C$/Local/Folder/*.txt")); Assert.AreEqual("*.txt", uri.FileName, StringComparison.InvariantCultureIgnoreCase); Assert.AreEqual(@"\\server\C$\Local\Folder", uri.Path, StringComparison.InvariantCultureIgnoreCase); }
public void SetRemoteUri() { var uri = new FileAdapterConnectionUri(); uri.FileName = "*.txt"; uri.Path = @"\\server\C$\Local\Folder"; Assert.AreEqual( "file://server/C$/Local/Folder/*.txt", uri.Uri.ToString(), StringComparison.InvariantCultureIgnoreCase); }
public void Internal_OutputTest(string sourcePath, string destinationFolder, string destinationFile, string expectedPath, string fileContent, OverwriteAction overwriteAction = default(OverwriteAction)) { var adapter = new FileAdapter { OverwriteAction = overwriteAction }; var connectionUri = new FileAdapterConnectionUri { Path = destinationFolder, FileName = destinationFile }; var factory = new FileAdapterConnectionFactory(connectionUri, new ClientCredentials(), adapter); var connection = factory.CreateConnection(); var outputHandler = connection.BuildHandler<FileAdapterOutboundHandler>(null); outputHandler.Execute(CreateMessage(sourcePath, GetTestStream(fileContent)), TimeSpan.MaxValue); Assert.IsTrue(System.IO.File.Exists(expectedPath)); Assert.AreEqual(fileContent, System.IO.File.ReadAllText(expectedPath)); }