Example #1
0
        public void ValidateDoesNotThrow()
        {
            var ipa = new Pop3Adapter.Inbound(
                a => {
                a.MailServer           = "pop3.world.com";
                a.AuthenticationScheme = Pop3Adapter.AuthenticationScheme.SecurePasswordAuthentication;
                a.UserName             = "******";
                a.Password             = "******";
                a.UseSsl = true;
                a.BodyPartContentType = "text/";
                a.ErrorThreshold      = 50;
                a.PollingInterval     = TimeSpan.FromSeconds(15);
            });

            Assert.That(() => ((ISupportValidation)ipa).Validate(), Throws.Nothing);
        }
Example #2
0
        public void ValidateDoesNotThrow()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ipa = new Pop3Adapter.Inbound(
                a => {
                a.MailServer           = "pop3.world.com";
                a.AuthenticationScheme = Pop3Adapter.AuthenticationScheme.SecurePasswordAuthentication;
                a.UserName             = "******";
                a.Password             = "******";
                a.UseSsl = true;
                a.BodyPartContentType = "text/";
                a.ErrorThreshold      = 50;
                a.PollingInterval     = TimeSpan.FromSeconds(15);
            });

            Invoking(() => ((ISupportValidation)ipa).Validate()).Should().NotThrow();
        }
Example #3
0
        public void Validate()
        {
            var ipa = new Pop3Adapter.Inbound(
                a => {
                a.MailServer           = "pop3.world.com";
                a.AuthenticationScheme = Pop3Adapter.AuthenticationScheme.SecurePasswordAuthentication;
                a.UserName             = "******";
                a.Password             = "******";
                a.UseSsl = true;
                a.BodyPartContentType = "text/";
                a.ErrorThreshold      = 50;
                a.PollingInterval     = TimeSpan.FromSeconds(15);
            });

            Assert.That(
                () => ((ISupportValidation)ipa).Validate(),
                Throws.TypeOf <BindingException>()
                .With.Message.EqualTo(
                    @"The format of the user name property is invalid for SPA authentication scheme. Make sure that the user name is specified as either <domain-name>\<user-name> or <machine-name>\<user-name>."));
        }
Example #4
0
        public void Validate()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ipa = new Pop3Adapter.Inbound(
                a => {
                a.MailServer           = "pop3.world.com";
                a.AuthenticationScheme = Pop3Adapter.AuthenticationScheme.SecurePasswordAuthentication;
                a.UserName             = "******";
                a.Password             = "******";
                a.UseSsl = true;
                a.BodyPartContentType = "text/";
                a.ErrorThreshold      = 50;
                a.PollingInterval     = TimeSpan.FromSeconds(15);
            });

            Invoking(() => ((ISupportValidation)ipa).Validate())
            .Should().Throw <BindingException>()
            .WithMessage(
                @"The format of the user name property is invalid for SPA authentication scheme. Make sure that the user name is specified as either <domain-name>\<user-name> or <machine-name>\<user-name>.");
        }
Example #5
0
        public void SerializeToXml()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var ipa = new Pop3Adapter.Inbound(
                a => {
                a.MailServer           = "pop3.world.com";
                a.AuthenticationScheme = Pop3Adapter.AuthenticationScheme.SecurePasswordAuthentication;
                a.UserName             = "******";
                a.Password             = "******";
                a.UseSsl = true;
                a.BodyPartContentType = "text/";
                a.ErrorThreshold      = 50;
                a.PollingInterval     = TimeSpan.FromSeconds(15);
            });
            var xml = ipa.GetAdapterBindingInfoSerializer().Serialize();

            xml.Should().Be(
                "<CustomProps>" +
                "<AdapterConfig vt=\"8\">" + SecurityElement.Escape(
                    "<Config>" +
                    "<uri>POP3://pop3.world.com#domain\\reader/owner</uri>" +
                    "<applyMIME>true</applyMIME>" +
                    "<bodyPartContentType>text/</bodyPartContentType>" +
                    "<bodyPartIndex>0</bodyPartIndex>" +
                    "<mailServer>pop3.world.com</mailServer>" +
                    "<serverPort>0</serverPort>" +
                    "<authenticationScheme>SPA</authenticationScheme>" +
                    "<userName>domain\\reader/owner</userName>" +
                    "<password>p@ssw0rd</password>" +
                    "<sslRequired>true</sslRequired>" +
                    "<errorThreshold>50</errorThreshold>" +
                    "<pollingInterval>15</pollingInterval>" +
                    "<pollingUnitOfMeasure>Seconds</pollingUnitOfMeasure>" +
                    "</Config>") +
                "</AdapterConfig>" +
                "</CustomProps>");
        }