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 void CheckBasicParentInfo(StudentParentAssociation studentParentAssociation) { var parent = studentParentAssociation.Parent; studentParentAssociation.RelationTypeId.ShouldBe((int)RelationTypeEnum.Mother); studentParentAssociation.PrimaryContactStatus.ShouldBe(true); parent.FirstName.ShouldBe("Mari"); parent.LastSurname.ShouldBe("Chavez"); parent.SexTypeId.ShouldBe((int) SexTypeEnum.Female); var parentTelephone = parent.ParentTelephones.First(); parentTelephone.TelephoneNumberTypeId.ShouldBe((int) TelephoneNumberTypeEnum.Emergency1); parentTelephone.TelephoneNumber.ShouldBe("555-5555"); var parentEmail = parent.ParentElectronicMails.First(); parentEmail.ElectronicMailAddress.ShouldBe("*****@*****.**"); parentEmail.ElectronicMailTypeId.ShouldBe((int) ElectronicMailTypeEnum.HomePersonal); }