public InheritanceCompositionTest() { var inheritancePerson = new NaturalPerson { Name = "Denis", DateOfBirth = DateTime.Now, Nif = "32165498765" }; var compositionPerson = new NaturalPerson2 { Person = new Person { Name = "Denis", DateOfBirth = DateTime.Now, }, Nif = "32165498765" }; var inheritanceName = inheritancePerson.Name; var compositionName = compositionPerson.Person.Name; }
public InheritanceCompositionTests() { var personInheritance = new NaturalPerson { Name = "João", DateOfBirth = DateTime.Now, Cpf = "32165498765" }; var personComposition = new NaturalPerson2 { Person = new Person { Name = "João", DateOfBirth = DateTime.Now }, Cpf = "32165498765" }; var nameInheritance = personInheritance.Name; var nameComposition = personComposition.Person.Name; }