Пример #1
0
        public void EmailCampaignDomain_FromEmailIsNotNullOrEmpty_NoException()
        {
            DC.Campaign   campaign      = campaignData.GetCustomCampaign("Test", "Test subject", "test", CampaignTemplate.Blank, 1);
            EmailCampaign emailCampaign = campaignData.GetCustomEmailCampaign(CampaignStatus.Draft, 1, null, campaignData.GetSampleMailingList(3), new DateTime(), new DateTime(), null);

            emailCampaign.Campaign = campaign;
            Assert.IsFalse(emailCampaign.IsFromEmailValid());
        }
Пример #2
0
        public void EmailCampaignDomain_FromEmailIsNullOrEmpty_ThrowException()
        {
            DC.Campaign   campaign      = campaignData.GetCustomCampaign("Test", "Test subject", "test", CampaignTemplate.Blank, 1);
            EmailCampaign emailCampaign = campaignData.GetCustomEmailCampaign(CampaignStatus.Draft, 1, new Email()
            {
                EmailId = "*****@*****.**"
            }, campaignData.GetSampleMailingList(3), new DateTime(), new DateTime(), null);

            emailCampaign.Campaign = campaign;
            Assert.IsTrue(emailCampaign.IsToMailingListValid());
        }
Пример #3
0
        public void EmailCampaignDomain_CampaignStatusIsScheduledAndScheduleTimeIsFutureTime_NoException()
        {
            DC.Campaign   campaign      = campaignData.GetCustomCampaign("Test", "Test subject", "test", CampaignTemplate.Blank, 1);
            EmailCampaign emailCampaign = campaignData.GetCustomEmailCampaign(CampaignStatus.Scheduled, 1, new Email()
            {
                EmailId = "*****@*****.**"
            }, campaignData.GetSampleMailingList(3), new DateTime(2020, 1, 1), new DateTime(), null);

            emailCampaign.Campaign = campaign;
            Assert.IsTrue(emailCampaign.IsScheduleTimeValid());
        }
Пример #4
0
        public void EmailCampaignDomain_CampaignIsNotValidNull_ThrowException()
        {
            DC.Campaign   campaign      = campaignData.GetCustomCampaign(null, null, null, CampaignTemplate.Blank, 1);
            EmailCampaign emailCampaign = campaignData.GetCustomEmailCampaign(CampaignStatus.Draft, 1, new Email()
            {
                EmailId = "*****@*****.**"
            }, campaignData.GetSampleMailingList(3), new DateTime(), new DateTime(), null);

            emailCampaign.Campaign = campaign;
            Assert.IsFalse(emailCampaign.IsCampaignValid());
        }
Пример #5
0
        public bool IsCampaignValid()
        {
            bool result = Campaign.IsNameValid() && Campaign.IsContentValid() && Campaign.IsSubjectValid();

            return(result);
        }