Exemple #1
0
        public void Email_Disabled_Post_Disabled_No_Captcha()
        {
            var contact         = ContactModelBuilder.GetContactNoCaptcha();
            var contactSettings = new ContactSettings {
                EmailSettings     = EmailSettingsBuilder.GetDisabled(),
                PostSettings      = PostSettingsBuilder.GetDisabled(),
                RecaptchaSettings = RecaptchaSettingsBuilder.GetDisabled()
            };

            var result = contactService.Submit(contact, contactSettings);

            Assert.True(result.Success);
        }
Exemple #2
0
        public void Email_Disabled_Post_Enabled_Json_No_Captcha()
        {
            var contactSettings = new ContactSettings
            {
                EmailSettings     = EmailSettingsBuilder.GetDisabled(),
                PostSettings      = PostSettingsBuilder.GetEnabled(PostEncType.JSON, 0),
                RecaptchaSettings = RecaptchaSettingsBuilder.GetDisabled()
            };

            var result = contactService.Submit(contact, contactSettings);

            Assert.Equal(ServiceResultType.Success, result.PostResult.ServiceResultType);
        }
        public void Email_Disabled_Post_Disabled_Captcha_Bad()
        {
            var contact         = ContactModelBuilder.GetContactNoCaptcha();
            var contactSettings = new ContactSettings
            {
                EmailSettings     = EmailSettingsBuilder.GetDisabled(),
                PostSettings      = PostSettingsBuilder.GetDisabled(),
                RecaptchaSettings = RecaptchaSettingsBuilder.GetEnabledBad()
            };

            var result = contactService.Submit(contact, contactSettings);

            Assert.False(result.Success);
            Assert.Equal(ServiceResultType.Error, result.RecaptchaResult.ServiceResultType);
        }