Пример #1
0
        public void ConvertGender_GenderTypeProvided_ProperGender(GenderType gender, Gender expected)
        {
            var converter       = new GedcomXToDomainGenderConverter();
            var convertedGender = converter.ConvertGender(gender);

            Assert.Equal(expected, convertedGender);
        }
Пример #2
0
        public void ConvertRelationType_CoupleRelation_RelationIsConvertedToSpouse(Gender gender)
        {
            var converter = new GedcomXToDomainRelationTypeConverter();
            var person    = Person.CreateNewPerson(null !, "Name", "LastName", gender,
                                                   DateTime.Parse("10.10.1998"), null, "", "");
            var people = new List <Person> {
                person
            };
            var relationType = converter.ConvertRelationType(XmlQNameEnumUtil.GetNameValue(RelationshipType.Couple), people, person.Id);

            Assert.Equal(RelationType.Spouse, relationType);
        }
Пример #3
0
        public void ConvertRelationType_ParentChildRelation_CannotSpecifyRelationOnGender(Gender gender, RelationType expectedRelationType)
        {
            var converter = new GedcomXToDomainRelationTypeConverter();
            var person    = Person.CreateNewPerson(null !, "Name", "LastName", gender,
                                                   DateTime.Parse("10.10.1998"), null, "", "");
            var people = new List <Person> {
                person
            };
            var relationType = converter.ConvertRelationType(XmlQNameEnumUtil.GetNameValue(RelationshipType.ParentChild), people, new PersonId(Guid.NewGuid()));

            Assert.Equal(expectedRelationType, relationType);
        }