Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 5
0
        public bool IsCampaignValid()
        {
            bool result = Campaign.IsNameValid() && Campaign.IsContentValid() && Campaign.IsSubjectValid();

            return(result);
        }