Пример #1
0
        public static GEDCOMFamilyRecord CreateFamilyRecord(int recordNo)
        {
            var                  family = new GEDCOMFamilyRecord(recordNo);
            GEDCOMRecord         childRecord;
            GEDCOMEventStructure marrEvent;

            switch (recordNo)
            {
            case 1:
                childRecord = new GEDCOMRecord(family.Level + 1, "", "@I1@", "HUSB", "");
                family.ChildRecords.Add(childRecord);
                childRecord = new GEDCOMRecord(family.Level + 1, "", "@I2@", "WIFE", "");
                family.ChildRecords.Add(childRecord);
                marrEvent = new GEDCOMEventStructure(family.Level + 1, "MARR", "11 JUN 1988", "MyTown");
                family.ChildRecords.Add(marrEvent);
                break;

            case 2:
                childRecord = new GEDCOMRecord(family.Level + 1, "", "@I3@", "HUSB", "");
                family.ChildRecords.Add(childRecord);
                childRecord = new GEDCOMRecord(family.Level + 1, "", "@I2@", "WIFE", "");
                family.ChildRecords.Add(childRecord);
                marrEvent = new GEDCOMEventStructure(family.Level + 1, "MARR", "09 APR 2001", "MyTown");
                family.ChildRecords.Add(marrEvent);
                break;
            }

            return(family);
        }
Пример #2
0
        public static GEDCOMIndividualRecord CreateIndividualRecord(int recordNo)
        {
            var individual = new GEDCOMIndividualRecord(recordNo);
            GEDCOMNameStructure  name;
            GEDCOMEventStructure birthEvent;
            GEDCOMEventStructure deathEvent;

            switch (recordNo)
            {
            case 1:
                name            = new GEDCOMNameStructure("John /Smith/", individual.Level + 1);
                individual.Name = name;
                individual.Sex  = Sex.Male;
                birthEvent      = new GEDCOMEventStructure(individual.Level + 1, "BIRT", "10 Apr 1964", "AnyTown");
                individual.ChildRecords.Add(birthEvent);
                deathEvent = new GEDCOMEventStructure(individual.Level + 1, "DEAT", "15 May 1998", "AnyTown");
                individual.ChildRecords.Add(deathEvent);
                break;

            case 2:
                name            = new GEDCOMNameStructure("Jane /Doe/", individual.Level + 1);
                individual.Name = name;
                individual.Sex  = Sex.Female;
                birthEvent      = new GEDCOMEventStructure(individual.Level + 1, "BIRT", "25 May 1967", "MyTown");
                individual.ChildRecords.Add(birthEvent);
                break;

            case 3:
                name            = new GEDCOMNameStructure("William /Jones/", individual.Level + 1);
                individual.Name = name;
                individual.Sex  = Sex.Male;
                birthEvent      = new GEDCOMEventStructure(individual.Level + 1, "BIRT", "31 Mar 1964", "MyTown");
                individual.ChildRecords.Add(birthEvent);
                break;

            default:
                string firstName = String.Format(IND_FirstName, recordNo);
                string lastName  = (recordNo < 5) ? IND_LastName : IND_AltLastName;
                name            = new GEDCOMNameStructure(String.Format("{0} /{1}/", firstName, lastName), individual.Level + 1);
                individual.Name = name;
                break;
            }

            return(individual);
        }
Пример #3
0
 public static void EventStructureIsEqual(GEDCOMEventStructure expectedEventStructure, GEDCOMEventStructure actualEventStructure)
 {
     Assert.AreEqual(expectedEventStructure.Date, actualEventStructure.Date);
     Assert.IsInstanceOf(typeof(GEDCOMPlaceStructure), actualEventStructure.Place);
     Assert.AreEqual(expectedEventStructure.Place.Place, actualEventStructure.Place.Place);
 }