Skip to content

Conversation

@Ameneh-Keshavarz
Copy link

No description provided.

@wai-t wai-t self-requested a review June 30, 2025 14:49

private string _name;
private Gender _gender;
public Gender _gender;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this exercise, I won't allow this to become public. It's possible to pass all the tests without accessing this, or casting IPerson -> Person in the other code. Use the getSisters() and getBrothers() methods to achieve this.

// Brother or Sister
if (IsSibling(person, relative))
{
var personImpl = person as Person;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not going to allow this as we are pretending that we can only access through the IPerson interface from the Relationships class

var siblingsOfMother = GetSiblings(mother);
if (siblingsOfMother.Contains(relative))
{
var personImpl = relative as Person;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

var siblingsOfFather = GetSiblings(father);
if (siblingsOfFather.Contains(relative))
{
var personImpl = relative as Person;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants