public void Validate() { var ifa = new FtpAdapter.Inbound(); Assert.That( () => ((ISupportValidation)ifa).Validate(), Throws.TypeOf <BindingException>().With.Message.EqualTo(@"The Server Address is not defined")); }
public void Validate() { Skip.IfNot(BizTalkServerGroup.IsConfigured); var ifa = new FtpAdapter.Inbound(); Invoking(() => ((ISupportValidation)ifa).Validate()) .Should().Throw <BindingException>() .WithMessage(@"The Server Address is not defined"); }
public void ValidateDoesNotThrow() { Skip.IfNot(BizTalkServerGroup.IsConfigured); var ifa = new FtpAdapter.Inbound( a => { a.MaximumNumberOfFiles = 1; a.MaximumBatchSize = 2; a.FirewallAddress = "firewall.com"; a.FirewallType = FtpAdapter.FirewallType.Socks4; a.FirewallUserName = "******"; a.FirewallPassword = "******"; a.Server = "ftp.server.com"; a.Folder = "/out/to_bts/"; a.FileMask = "*.*.csv"; a.UserName = "******"; a.Password = "******"; a.AfterGet = a.BeforeGet = "cd /"; a.ErrorThreshold = 11; a.Log = "c:\\windows\\temp\\ftp.log"; a.MaximumFileSize = 100; a.UseNameList = false; a.DeleteAfterDownload = true; a.EnableTimestampComparison = true; a.PollingInterval = TimeSpan.FromSeconds(120); a.ClientCertificate = "hash"; a.FtpsConnectionMode = FtpAdapter.FtpsConnectionMode.Implicit; a.UseSsl = true; a.ReceiveTimeout = TimeSpan.FromMinutes(1); a.TemporaryFolder = "c:\\windows\\temp"; }); Invoking(() => ((ISupportValidation)ifa).Validate()).Should().NotThrow(); }
public void SerializeToXml() { var ifa = new FtpAdapter.Inbound( a => { a.MaximumNumberOfFiles = 1; a.MaximumBatchSize = 2; a.FirewallAddress = "firewall.com"; a.FirewallType = FtpAdapter.FirewallType.Socks4; a.FirewallUserName = "******"; a.FirewallPassword = "******"; a.Server = "ftp.server.com"; a.Folder = "/out/to_bts/"; a.FileMask = "*.*.csv"; a.UserName = "******"; a.Password = "******"; a.AfterGet = a.BeforeGet = "cd /"; a.ErrorThreshold = 11; a.Log = "c:\\windows\\temp\\ftp.log"; a.MaximumFileSize = 100; a.UseNameList = false; a.DeleteAfterDownload = true; a.EnableTimestampComparison = true; a.PollingInterval = TimeSpan.FromSeconds(120); a.ClientCertificate = "hash"; a.FtpsConnectionMode = FtpAdapter.FtpsConnectionMode.Implicit; a.UseSsl = true; a.ReceiveTimeout = TimeSpan.FromMinutes(1); a.TemporaryFolder = "c:\\windows\\temp"; }); var xml = ((IAdapterBindingSerializerFactory)ifa).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<AdapterConfig vt=\"8\">" + SecurityElement.Escape( "<Config>" + "<uri>ftp://ftp.server.com:21//out/to_bts//*.*.csv</uri>" + "<maximumNumberOfFiles>1</maximumNumberOfFiles>" + "<maximumBatchSize>2</maximumBatchSize>" + "<firewallAddress>firewall.com</firewallAddress>" + "<firewallPort>21</firewallPort>" + "<firewallUserName>fireuser</firewallUserName>" + "<firewallPassword>p@ssw0rd</firewallPassword>" + "<firewallType>Socks4</firewallType>" + "<passiveMode>False</passiveMode>" + "<serverAddress>ftp.server.com</serverAddress>" + "<serverPort>21</serverPort>" + "<targetFolder>/out/to_bts/</targetFolder>" + "<fileMask>*.*.csv</fileMask>" + "<userName>ftpuser</userName>" + "<password>p@ssw0rd</password>" + "<afterGet>cd /</afterGet>" + "<beforeGet>cd /</beforeGet>" + "<errorThreshold>11</errorThreshold>" + "<commandLogFilename>c:\\windows\\temp\\ftp.log</commandLogFilename>" + "<maxFileSize>100</maxFileSize>" + "<representationType>binary</representationType>" + "<useNLST>False</useNLST>" + "<deleteAfterDownload>True</deleteAfterDownload>" + "<enableTimeComparison>True</enableTimeComparison>" + "<pollingInterval>2</pollingInterval>" + "<pollingUnitOfMeasure>Minutes</pollingUnitOfMeasure>" + "<redownloadInterval>-1</redownloadInterval>" + "<clientCertificateHash>hash</clientCertificateHash>" + "<ftpsConnMode>Implicit</ftpsConnMode>" + "<useDataProtection>True</useDataProtection>" + "<useSsl>True</useSsl>" + "<receiveDataTimeout>60000</receiveDataTimeout>" + "<spoolingFolder>c:\\windows\\temp</spoolingFolder>" + "</Config>") + "</AdapterConfig>" + "</CustomProps>")); }