예제 #1
0
        private async Task <PersonEC> BuildNewPersonEC()
        {
            var newPerson = await PersonEC.NewPersonEC();

            newPerson.Title = await TitleEC.GetTitleEC(new Title()
            {
                Id = 1
            });

            newPerson.LastName           = "Jones";
            newPerson.MiddleName         = String.Empty;
            newPerson.FirstName          = "Jack";
            newPerson.DateOfFirstContact = new SmartDate(DateTime.Now);
            newPerson.BirthDate          = new SmartDate(DateTime.Now);
            newPerson.LastUpdatedBy      = "markk";
            newPerson.LastUpdatedDate    = new SmartDate(DateTime.Now);
            newPerson.Code  = "new code";
            newPerson.Notes = "new notes";
            newPerson.EMail = await EMailEC.GetEMailEC(new EMail()
            {
                Id = 1
            });

            return(newPerson);
        }
예제 #2
0
        public async Task TestEMailEC_NewEMailEC()
        {
            var eMail = await EMailEC.NewEMailEC();

            Assert.NotNull(eMail);
            Assert.IsType <EMailEC>(eMail);
            Assert.False(eMail.IsValid);
        }
예제 #3
0
        public async Task TestEMailEC_GetEMailEC()
        {
            var eMailToLoad = BuildEMail();
            var eMail       = await EMailEC.GetEMailEC(eMailToLoad);

            Assert.NotNull(eMail);
            Assert.IsType <EMailEC>(eMail);
            Assert.Equal(eMailToLoad.Id, eMail.Id);
            Assert.Equal(eMailToLoad.LastUpdatedBy, eMail.LastUpdatedBy);
            Assert.Equal(new SmartDate(eMailToLoad.LastUpdatedDate), eMail.LastUpdatedDate);
            Assert.Equal(eMailToLoad.Notes, eMail.Notes);
            Assert.Equal(eMailToLoad.RowVersion, eMail.RowVersion);
            Assert.True(eMail.IsValid);
        }
예제 #4
0
        public async Task TestEMailEC_LastUpdatedByRequired()
        {
            var eMailToTest = BuildEMail();
            var eMail       = await EMailEC.GetEMailEC(eMailToTest);

            var isObjectValidInit = eMail.IsValid;

            eMail.LastUpdatedBy = string.Empty;

            Assert.NotNull(eMail);
            Assert.True(isObjectValidInit);
            Assert.False(eMail.IsValid);
            Assert.Equal("LastUpdatedBy", eMail.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedBy required", eMail.BrokenRulesCollection[0].Description);
        }
예제 #5
0
        private async Task BuildEMail(EMailEC eMail)
        {
            eMail.EMailAddress = "*****@*****.**";
            eMail.EMailType    = await EMailTypeEC.GetEMailTypeEC(
                new EMailType()
            {
                Id          = 1,
                Notes       = "EMailType notes",
                Description = "Email description"
            }
                );

            eMail.Notes           = "document type notes";
            eMail.LastUpdatedBy   = "edm";
            eMail.LastUpdatedDate = DateTime.Now;
        }
예제 #6
0
        public async Task TestEMailEC_EMailAddressGreaterThan255Chars()
        {
            var eMailToTest = BuildEMail();
            var eMail       = await EMailEC.GetEMailEC(eMailToTest);

            var isObjectValidInit = eMail.IsValid;

            eMail.EMailAddress = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo" +
                                 "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud" +
                                 "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure" +
                                 "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.";
            Assert.NotNull(eMail);
            Assert.True(isObjectValidInit);
            Assert.False(eMail.IsValid);
            Assert.Equal("EMailAddress", eMail.BrokenRulesCollection[0].Property);
            Assert.Equal("EMailAddress can not exceed 255 characters", eMail.BrokenRulesCollection[0].Description);
        }
        private async Task BuildPersonEC(PersonEC personToBuild)
        {
            personToBuild.LastName           = "lastname";
            personToBuild.MiddleName         = "A";
            personToBuild.FirstName          = "Joe";
            personToBuild.DateOfFirstContact = DateTime.Now;
            personToBuild.BirthDate          = DateTime.Now;
            personToBuild.LastUpdatedDate    = DateTime.Now;
            personToBuild.LastUpdatedBy      = "edm";
            personToBuild.Code  = "code";
            personToBuild.Notes = "Notes";
            personToBuild.EMail = await EMailEC.GetEMailEC(new EMail()
            {
                Id = 1
            });

            personToBuild.Title = await TitleEC.GetTitleEC(new Title()
            {
                Id = 1
            });
        }