Exemple #1
0
        public void ValidateMaternalAunt()
        {
            Person       father = new Person("King Shan", "Male", ListOfRelations);
            Person       mother = new Person("Queen Anga", "Female", ListOfRelations);
            Relationship spouse = new Relationship(father, mother, "Spouse");

            ListOfRelations.Add(spouse);

            Person       child1    = new Person("Amba", "Female", ListOfRelations);
            Relationship relation1 = new Relationship(mother, child1, "Child");

            ListOfRelations.Add(relation1);

            Person       child2    = new Person("Ish", "Female", ListOfRelations);
            Relationship relation2 = new Relationship(mother, child2, "Child");

            ListOfRelations.Add(relation2);

            Person       wife     = new Person("Chit", "Male", ListOfRelations);
            Relationship relation = new Relationship(child1, wife, "Spouse");

            ListOfRelations.Add(relation);

            Person       child3    = new Person("Dritha", "Female", ListOfRelations);
            Relationship relation3 = new Relationship(child1, child3, "Child");

            ListOfRelations.Add(relation3);

            List <String> aunts = child3.MaternalAunt();

            Assert.AreEqual(aunts[0], "Ish");
        }