public async Task OfficeEC_TestLastUpdatedDateRequired()
        {
            var officeObj = await OfficeEC.GetOfficeEC(BuildOffice());

            var isObjectValidInit = officeObj.IsValid;

            officeObj.LastUpdatedDate = DateTime.MinValue;

            Assert.NotNull(officeObj);
            Assert.True(isObjectValidInit);
            Assert.False(officeObj.IsValid);
            Assert.Equal("LastUpdatedDate", officeObj.BrokenRulesCollection[0].Property);
            Assert.Equal("LastUpdatedDate required", officeObj.BrokenRulesCollection[0].Description);
        }
        public async Task OfficeEC_TestNameRequired()
        {
            var officeObj = await OfficeEC.GetOfficeEC(BuildOffice());

            var isObjectValidInit = officeObj.IsValid;

            officeObj.Name = string.Empty;

            Assert.NotNull(officeObj);
            Assert.True(isObjectValidInit);
            Assert.False(officeObj.IsValid);
            Assert.Equal("Name", officeObj.BrokenRulesCollection[0].Property);
            Assert.Equal("Name required", officeObj.BrokenRulesCollection[0].Description);
        }
        public async Task OfficeEC_TestGetOffice()
        {
            var childData = BuildOffice();
            var officeObj = await OfficeEC.GetOfficeEC(childData);

            Assert.NotNull(officeObj);
            Assert.IsType <OfficeEC>(officeObj);
            Assert.Equal(childData.Appointer, officeObj.Appointer);
            Assert.Equal(childData.Name, officeObj.Name);
            Assert.Equal(childData.Notes, officeObj.Notes);
            Assert.Equal(childData.Term, officeObj.Term);
            Assert.Equal(childData.CalendarPeriod, officeObj.CalendarPeriod);
            Assert.Equal(childData.ChosenHow, officeObj.ChosenHow);
            Assert.Equal(childData.LastUpdatedBy, officeObj.LastUpdatedBy);
            Assert.Equal(new SmartDate(childData.LastUpdatedDate), officeObj.LastUpdatedDate);
        }
        private async Task BuildTermInOffice(TermInOfficeEC termObj)
        {
            termObj.Office = await OfficeEC.GetOfficeEC(new Office()
            {
                Id = 1
            });

            termObj.Person = await PersonEC.GetPersonEC(new Person()
            {
                Id = 1
            });

            termObj.StartDate       = DateTime.Now;
            termObj.LastUpdatedBy   = "edm";
            termObj.LastUpdatedDate = DateTime.Now;
            termObj.Notes           = "notes for doctype";
        }
        public async Task OfficeEC_TestAppointerExceedsMaxLengthOf50()
        {
            var officeObj = await OfficeEC.GetOfficeEC(BuildOffice());

            var isObjectValid = officeObj.IsValid;

            officeObj.Appointer = "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(officeObj);
            Assert.True(isObjectValid);
            Assert.False(officeObj.IsValid);
            Assert.Equal("Appointer", officeObj.BrokenRulesCollection[0].Property);
            Assert.Equal("Appointer can not exceed 50 characters", officeObj.BrokenRulesCollection[0].Description);
        }