Example #1
0
        public void TestReadPersonWithRelationships()
        {
            var father = (FamilyTreePersonState)tree.AddPerson(TestBacking.GetCreateMalePerson()).Get();

            cleanup.Add(father);
            var son = tree.AddPerson(TestBacking.GetCreateMalePerson());

            cleanup.Add(son);
            var chapr = tree.AddChildAndParentsRelationship(TestBacking.GetCreateChildAndParentsRelationship(father, null, son));

            cleanup.Add(chapr);
            var state = tree.ReadPersonWithRelationshipsById(father.Person.Id);

            Assert.DoesNotThrow(() => state.IfSuccessful());
            Assert.IsNotNull(state.Person);
            Assert.IsNotNull(state.ChildAndParentsRelationships);
            Assert.Greater(state.ChildAndParentsRelationships.Count, 0);
        }