Example #1
0
        public StudentBuilder WithParent(Parent parent=null, bool livesWith = true)
        {
            if (parent == null)
                parent = new ParentBuilder().WithAddress().WithPhoneNumber().Build();

            var studentParentAssociation = new StudentParentAssociation
            {
                RelationTypeId = PrimaryParentRelationType,
                LivesWith = livesWith,
                Parent = parent,
            };

            _studentParentAssociations.Add(studentParentAssociation);
            parent.StudentParentAssociations.Add(studentParentAssociation);
            return this;
        }
        private static void ParentAddressShouldBeMapped(Parent parent, ProfileModel profileModel)
        {
            var profileParentAddressModel = profileModel.EditProfileParentModel.EditableParentAddressModel;
            var parentHomeAddress = parent.ParentAddresses.First();

            profileParentAddressModel.Address.ShouldBe(parentHomeAddress.StreetNumberName);
            profileParentAddressModel.Address2.ShouldBe(parentHomeAddress.ApartmentRoomSuiteNumber);
            profileParentAddressModel.City.ShouldBe(parentHomeAddress.City);
            profileParentAddressModel.StateForDisplay.ShouldBe(
                ((StateAbbreviationTypeEnum)parentHomeAddress.StateAbbreviationTypeId).Humanize());
            profileParentAddressModel.PostalCode.ShouldBe(parentHomeAddress.PostalCode);
        }
 private static void NativeParentPropertiesShouldBeMapped(Parent parent, EditProfileParentModel editProfileParentModel)
 {
     editProfileParentModel.FirstName.ShouldBe(parent.FirstName);
     editProfileParentModel.LastName.ShouldBe(parent.LastSurname);
     editProfileParentModel.Sex.ShouldBe(((SexTypeEnum) parent.SexTypeId.GetValueOrDefault()));
     editProfileParentModel.TelephoneNumber.ShouldBe(parent.ParentTelephones.First().TelephoneNumber);
 }