Example #1
0
        public async Task TestPersonEC_New()
        {
            var person = await PersonEC.NewPersonEC();

            Assert.NotNull(person);
            Assert.False(person.IsValid);
        }
Example #2
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);
        }
Example #3
0
        public async Task TestPersonEC_LastUpdatedByRequired()
        {
            var personType = await PersonEC.NewPersonEC();

            await BuildPersonEC(personType);

            var isObjectValidInit = personType.IsValid;

            personType.LastUpdatedBy = string.Empty;

            Assert.NotNull(personType);
            Assert.True(isObjectValidInit);
            Assert.False(personType.IsValid);
            Assert.Equal("LastUpdatedBy", personType.BrokenRulesCollection[0].Property);
        }
Example #4
0
        public async Task TestPersonEC_PersonAddressMaxLengthLessThan50()
        {
            var personType = await PersonEC.NewPersonEC();

            await BuildPersonEC(personType);

            var isObjectValidInit = personType.IsValid;

            personType.LastName = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor " +
                                  "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";

            Assert.NotNull(personType);
            Assert.True(isObjectValidInit);
            Assert.False(personType.IsValid);
            Assert.Equal("LastName", personType.BrokenRulesCollection[0].Property);
        }