public void ReceiveFolderIsRequired()
        {
            var ifa = new FileAdapter.Inbound(a => { });

            Assert.That(
                () => ((ISupportValidation)ifa).Validate(),
                Throws.TypeOf <BindingException>().With.Message.EqualTo("Inbound file adapter has no source folder."));
        }
Ejemplo n.º 2
0
        public void ReceiveFolderIsRequired()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ifa = new FileAdapter.Inbound(_ => { });

            Invoking(() => ((ISupportValidation)ifa).Validate())
            .Should().Throw <BindingException>()
            .WithMessage("Inbound file adapter has no source folder.");
        }
        public void CredentialsAreCompatibleWithNetworkFolder()
        {
            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"\\server\folder";
                a.NetworkCredentials.UserName = "******";
                a.NetworkCredentials.Password = "******";
            });

            Assert.That(() => ((ISupportValidation)ifa).Validate(), Throws.Nothing);
        }
        public void FileNameIsRequired()
        {
            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"\\server";
                a.FileMask      = string.Empty;
            });

            Assert.That(
                () => ((ISupportValidation)ifa).Validate(),
                Throws.TypeOf <BindingException>().With.Message.EqualTo("Inbound file adapter has no source file mask."));
        }
        public void CredentialsAreNotCompatibleWithLocalFolder()
        {
            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"c:\files\drops";
                a.NetworkCredentials.UserName = "******";
                a.NetworkCredentials.Password = "******";
            });

            Assert.That(
                () => ((ISupportValidation)ifa).Validate(),
                Throws.TypeOf <BindingException>()
                .With.Message.EqualTo("Alternate credentials to access the file folder cannot be supplied while accessing local drive or a mapped network drive."));
        }
Ejemplo n.º 6
0
        public void FileNameIsRequired()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"\\server";
                a.FileMask      = string.Empty;
            });

            Invoking(() => ((ISupportValidation)ifa).Validate())
            .Should().Throw <BindingException>()
            .WithMessage("Inbound file adapter has no source file mask.");
        }
Ejemplo n.º 7
0
        public void CredentialsAreCompatibleWithNetworkFolder()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"\\server\folder";
                a.NetworkCredentials.UserName = "******";
                a.NetworkCredentials.Password = "******";
            });

            Invoking(() => ((ISupportValidation)ifa).Validate())
            .Should().NotThrow();
        }
Ejemplo n.º 8
0
        public void CredentialsAreNotCompatibleWithLocalFolder()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ifa = new FileAdapter.Inbound(
                a => {
                a.ReceiveFolder = @"c:\file\drops";
                a.NetworkCredentials.UserName = "******";
                a.NetworkCredentials.Password = "******";
            });

            Invoking(() => ((ISupportValidation)ifa).Validate())
            .Should().Throw <BindingException>()
            .WithMessage("Alternate credentials to access the file folder cannot be supplied while accessing local drive or a mapped network drive.");
        }
        public void SerializeToXml()
        {
            var ifa = new FileAdapter.Inbound(a => { a.ReceiveFolder = @"c:\files\drops"; });
            var xml = ((IAdapterBindingSerializerFactory)ifa).GetAdapterBindingSerializer().Serialize();

            Assert.That(
                xml,
                Is.EqualTo(
                    "<CustomProps>" +
                    "<BatchSize vt=\"19\">20</BatchSize>" +
                    "<BatchSizeInBytes vt=\"19\">102400</BatchSizeInBytes>" +
                    "<FileMask vt=\"8\">*.xml</FileMask>" +
                    "<FileNetFailRetryCount vt=\"19\">5</FileNetFailRetryCount>" +
                    "<FileNetFailRetryInt vt=\"19\">5</FileNetFailRetryInt>" +
                    "<PollingInterval vt=\"19\">60000</PollingInterval>" +
                    "<RemoveReceivedFileDelay vt=\"19\">10</RemoveReceivedFileDelay>" +
                    "<RemoveReceivedFileMaxInterval vt=\"19\">300000</RemoveReceivedFileMaxInterval>" +
                    "<RemoveReceivedFileRetryCount vt=\"19\">5</RemoveReceivedFileRetryCount>" +
                    "<RenameReceivedFiles vt=\"11\">-1</RenameReceivedFiles>" +
                    "</CustomProps>"));
        }
Ejemplo n.º 10
0
        public void SerializeToXml()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ifa = new FileAdapter.Inbound(a => { a.ReceiveFolder = @"c:\file\drops"; });
            var xml = ifa.GetAdapterBindingInfoSerializer().Serialize();

            xml.Should().Be(
                "<CustomProps>" +
                "<BatchSize vt=\"19\">20</BatchSize>" +
                "<BatchSizeInBytes vt=\"19\">102400</BatchSizeInBytes>" +
                "<FileMask vt=\"8\">*.xml</FileMask>" +
                "<FileNetFailRetryCount vt=\"19\">5</FileNetFailRetryCount>" +
                "<FileNetFailRetryInt vt=\"19\">5</FileNetFailRetryInt>" +
                "<PollingInterval vt=\"19\">60000</PollingInterval>" +
                "<RemoveReceivedFileDelay vt=\"19\">10</RemoveReceivedFileDelay>" +
                "<RemoveReceivedFileMaxInterval vt=\"19\">300000</RemoveReceivedFileMaxInterval>" +
                "<RemoveReceivedFileRetryCount vt=\"19\">5</RemoveReceivedFileRetryCount>" +
                "<RenameReceivedFiles vt=\"11\">-1</RenameReceivedFiles>" +
                "</CustomProps>");
        }