Exemple #1
0
        public void ToEmail_Internal_CheckFormatExceptions()
        {
            // Arrange
            var inputMail = new ecn.communicator.mvc.Models.Email();

            inputMail.Birthdate      = SampleDummy;
            inputMail.UserEvent1Date = SampleDummy;
            inputMail.UserEvent2Date = SampleDummy;
            var inputUser = new KMPlatform.Entity.User();

            ShimEmail.GetByEmailIDInt32User = (p1, p2) => new Email();

            // Act
            try
            {
                var internalEmail = ConversionMethods.ToEmail_Internal(inputMail, inputUser);

                // Assert
                internalEmail.ShouldBeNull();
            }
            catch (ECNException ex)
            {
                ex.ErrorList.ShouldNotBeNull();
                ex.ErrorList.Count.ShouldBe(4);
                ex.ErrorList[0].ErrorMessage.ShouldBe(ExceptionMessageFormatBirthdate);
                ex.ErrorList[1].ErrorMessage.ShouldBe(ExceptionMessageFormatUserEvent1Date);
                ex.ErrorList[2].ErrorMessage.ShouldBe(ExceptionMessageFormatUserEvent2Date);
                ex.ErrorList[3].ErrorMessage.ShouldBe(ExceptionMessageEmailRequired);
            }
        }
Exemple #2
0
        public void ToEmail_Internal_CheckEmptyMail_NoException()
        {
            // Arrange
            var inputMail = new ecn.communicator.mvc.Models.Email();

            inputMail.EmailAddress = SampleEmailAddress;
            inputMail.EmailID      = SampleEmailId;
            var inputUser = new KMPlatform.Entity.User();

            ShimEmail.GetByEmailIDInt32User = (p1, p2) => new Email();

            // Act
            var internalEmail = ConversionMethods.ToEmail_Internal(inputMail, inputUser);

            // Assert
            internalEmail.ShouldNotBeNull();
        }
Exemple #3
0
        private ecn.communicator.mvc.Models.Email CreateSampleEmail()
        {
            var sampleMail = new ecn.communicator.mvc.Models.Email();

            sampleMail.EmailAddress      = SampleEmailAddress;
            sampleMail.Title             = SampleTitle;
            sampleMail.FirstName         = SampleFirstName;
            sampleMail.LastName          = SampleLastName;
            sampleMail.FullName          = SampleFullName;
            sampleMail.Company           = SampleCompany;
            sampleMail.Occupation        = SampleOccupation;
            sampleMail.Address           = SampleAddress;
            sampleMail.Address2          = SampleAddress2;
            sampleMail.City              = SampleCity;
            sampleMail.State             = SampleState;
            sampleMail.Zip               = SampleZip;
            sampleMail.Country           = SampleCountry;
            sampleMail.Voice             = SampleVoice;
            sampleMail.Mobile            = SampleMobile;
            sampleMail.Fax               = SampleFax;
            sampleMail.Website           = SampleWebsite;
            sampleMail.Age               = SampleAge;
            sampleMail.Income            = SampleIncome;
            sampleMail.Gender            = SampleGender;
            sampleMail.User1             = SampleUser1;
            sampleMail.User2             = SampleUser2;
            sampleMail.User3             = SampleUser3;
            sampleMail.User4             = SampleUser4;
            sampleMail.User5             = SampleUser5;
            sampleMail.User6             = SampleUser6;
            sampleMail.UserEvent1        = SampleUserEvent1;
            sampleMail.UserEvent2        = SampleUserEvent2;
            sampleMail.Password          = SamplePassword;
            sampleMail.Birthdate         = SampleBirthdate;
            sampleMail.UserEvent1Date    = SampleUserEvent1Date;
            sampleMail.UserEvent2Date    = SampleUserEvent2Date;
            sampleMail.FormatTypeCode    = SampleFormatTypeCode;
            sampleMail.SubscribeTypeCode = SampleSubscribeTypeCode;
            sampleMail.Notes             = SampleNotes;
            sampleMail.BounceScore       = SampleBounceScore;
            sampleMail.SoftBounceScore   = SampleSoftBounceScore;
            sampleMail.EmailID           = SampleEmailId;

            return(sampleMail);
        }