public void Rename(PersonalName newName) { if (newName == null) { throw new ArgumentNullException("newName"); } if (PersonalName == newName) { throw new ArgumentException("The new name must not be equal to the current name", "newName"); } PersonalName = newName; }
public Person(PersonalName personalName, Address address) { if (personalName == null) { throw new ArgumentNullException("personalName"); } if (address == null) { throw new ArgumentException("address"); } PersonalName = personalName; Address = address; }