-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom records on event records. (#144)
* Fixed some typos in comments and strings. * Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated. * Store the record change dates that are read in from GED file * Fix exception when reading ChangeDate when file contains bad submitter reference. * Add support for custom records on event records.
- Loading branch information
Showing
5 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
0 HEAD | ||
1 SOUR PhpGedView | ||
2 NAME PhpGedView Online Genealogy | ||
2 VERS 3.3.8 final | ||
1 DATE 1 Apr 2006 | ||
0 @I1@ INDI | ||
1 _UID A5A812A4C0FE44C9A98F8D4627073B69AB88 | ||
1 NAME TestGivenName /TestSurname/ | ||
2 SURN TestSurname | ||
2 GIVN TestGivenName | ||
1 SEX M | ||
1 BIRT | ||
2 DATE 9 OCT 1990 | ||
2 _BURG unbekannt | ||
1 CHAN | ||
2 DATE 28 DEC 2023 | ||
3 TIME 11:21:46 | ||
0 @SUBM@ SUBM | ||
1 NAME Test for GeneGenie | ||
0 TRLR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
GeneGenie.Gedcom.Tests/RecordReaderTests/GecomCustomRecordTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// <copyright file="GedcomCustomRecordTest.cs" company="GeneGenie.com"> | ||
// Copyright (c) GeneGenie.com. All Rights Reserved. | ||
// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information. | ||
// </copyright> | ||
// <author> Copyright (C) 2023 Herbert Oppmann gith@memotech.franken.de </author> | ||
|
||
|
||
namespace GeneGenie.Gedcom.Tests.RecordReaderTests | ||
{ | ||
using GeneGenie.Gedcom.Parser; | ||
using System; | ||
using Xunit; | ||
|
||
/// <summary> | ||
/// Tests to ensure that custom records are correctly read in. | ||
/// </summary> | ||
public class GedcomCustomRecordTest | ||
{ | ||
/// <summary> | ||
/// Test for custom record '_UID' in individual record. | ||
/// </summary> | ||
[Fact] | ||
public void Record_UID() | ||
{ | ||
var reader = GedcomRecordReader.CreateReader("./Data/UidAndBurg.ged"); | ||
GedcomIndividualRecord indi = reader.Database.Individuals[0]; | ||
GedcomCustomRecord cr = indi.Custom[0]; | ||
Assert.Equal("_UID", cr.Tag); | ||
Assert.Equal("A5A812A4C0FE44C9A98F8D4627073B69AB88", cr.Classification); | ||
} | ||
|
||
/// <summary> | ||
/// Test for custom record '_BURG' in event record. | ||
/// </summary> | ||
[Fact] | ||
public void Record_BURG() | ||
{ | ||
var reader = GedcomRecordReader.CreateReader("./Data/UidAndBurg.ged"); | ||
GedcomIndividualRecord indi = reader.Database.Individuals[0]; | ||
GedcomEvent er = indi.Events[0]; | ||
GedcomCustomRecord cr = er.Custom[0]; | ||
Assert.Equal("_BURG", cr.Tag); | ||
Assert.Equal("unbekannt", cr.Classification); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters