public void Should_Throw_UserFriendlyException_If_Person_Assigned_Family_Father_Is_Not_A_Male() { var family = new Family { Id = 1 }; var women = new Person { Id = 1, Gender = Gender.Female }; Should.Throw <UserFriendlyException>(() => _familyManager.AssignFamilyFather(family, women)) .Message.ShouldBe("The family father must be a male"); }
private void GetAndAssignFamilyParents(Family family) { if (family.FatherId.HasValue) { var father = _personRepository.Get(family.FatherId.Value); _familyManager.AssignFamilyFather(family, father); } if (family.MotherId.HasValue) { var mother = _personRepository.Get(family.MotherId.Value); _familyManager.AssignFamilyMother(family, mother); } }