-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store the record change dates that are read in from GED file (#126)
* 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
- Loading branch information
Showing
4 changed files
with
146 additions
and
0 deletions.
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,87 @@ | ||
0 HEAD | ||
1 CHAR ASCII | ||
1 SOUR ID_OF_CREATING_FILE | ||
1 GEDC | ||
2 VERS 5.5 | ||
2 FORM Lineage-Linked | ||
1 SUBM @SUBMITTER@ | ||
1 NOTE Small example file containing all types of records, each with a CHANge date | ||
0 @SUBMISSION@ SUBN | ||
1 SUBM @SUBMITTER@ | ||
1 FAMF NameOfFamilyFile | ||
1 TEMP Abreviated temple code | ||
1 ANCE 1 | ||
1 DESC 1 | ||
1 ORDI yes | ||
1 CHAN | ||
2 DATE 01 JUN 2023 | ||
3 TIME 10:11:11 | ||
0 @SUBMITTER@ SUBM | ||
1 NAME /Submitter/ | ||
1 ADDR Submitters address | ||
2 CONT address continued here | ||
1 CHAN | ||
2 DATE 02 JUN 2023 | ||
3 TIME 10:11:12 | ||
0 @FATHER@ INDI | ||
1 NAME /Father/ | ||
1 SEX M | ||
1 BIRT | ||
2 PLAC birth place | ||
2 DATE 1 JAN 1899 | ||
1 DEAT | ||
2 PLAC death place | ||
2 DATE 31 DEC 1990 | ||
1 FAMS @FAMILY@ | ||
2 SOUR @SOURCE1@ | ||
3 PAGE 42 | ||
1 CHAN | ||
2 DATE 03 JUN 2023 | ||
3 TIME 10:11:13 | ||
0 @MOTHER@ INDI | ||
1 NAME /Mother/ | ||
1 SEX F | ||
1 BIRT | ||
2 PLAC birth place | ||
2 DATE 1 JAN 1899 | ||
1 DEAT | ||
2 PLAC death place | ||
2 DATE 31 DEC 1990 | ||
1 FAMS @FAMILY@ | ||
0 @FAMILY@ FAM | ||
1 HUSB @FATHER@ | ||
1 WIFE @MOTHER@ | ||
1 CHAN | ||
2 DATE 04 JUN 2023 | ||
3 TIME 10:11:14 | ||
0 @SOURCE1@ SOUR | ||
1 TITL Some source | ||
1 CHAN | ||
2 DATE 05 JUN 2023 | ||
3 TIME 10:11:15 | ||
0 @R1@ REPO | ||
1 NAME Some repository | ||
1 PHON +1-800-000-0000 | ||
1 CHAN | ||
2 DATE 06 JUN 2023 | ||
3 TIME 10:11:16 | ||
0 @N1@ NOTE | ||
1 CONC Some note | ||
1 CHAN | ||
2 DATE 07 JUN 2023 | ||
3 TIME 10:11:17 | ||
0 @M1@ OBJE | ||
1 TITL Some multimedia | ||
1 FORM PICT | ||
1 BLOB | ||
2 CONT .HM.......k.1..F.jwA.Dzzzzw............A....1.........0U.66..E.8 | ||
2 CONT .......A..k.a6.A.......A..k.........../6....G.......0../..U..... | ||
2 CONT .w1/m........HC0..../...zzzzzzzz..5zzk..AnA..U..W6U....2rRrRrRrR | ||
2 CONT .Dw...............k.1.......1..A...5ykE/zzzx/.g//.Hxzk6/.Tzy/.k1 | ||
2 CONT /Dw/.Tvz.E5zzUE9/kHz.Tw2/DzzzEEA.kE2zk5yzk2/zzs21.U2/Dw/.Tw/.Tzy | ||
2 CONT /.fy/.HzzkHzzzo21Ds00.E2.UE2.U62/.k./Ds0.UE0/Do0..E8/UE2.U62.U9w | ||
2 CONT /.Tx/.20.jg2/jo2..9u/.0U.6A.zk | ||
1 CHAN | ||
2 DATE 08 JUN 2023 | ||
3 TIME 10:11:18 | ||
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
48 changes: 48 additions & 0 deletions
48
GeneGenie.Gedcom.Tests/RecordReaderTests/GedcomChangeDateReadTest.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,48 @@ | ||
// <copyright file="GedcomChangeDateReadTest.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 | ||
{ | ||
using System; | ||
using System.Linq; | ||
using GeneGenie.Gedcom.Parser; | ||
using Xunit; | ||
|
||
/// <summary> | ||
/// Tests that the change dates are read in for the varying record types. | ||
/// </summary> | ||
public class GedcomChangeDateReadTest | ||
{ | ||
[Fact] | ||
private void Read_sample_and_check_changed_dates() | ||
{ | ||
var reader = GedcomRecordReader.CreateReader("./Data/changedate.ged"); | ||
|
||
// TODO: Submission records are parsed but not stored in the DataBase, so can't check this currently | ||
|
||
GedcomChangeDate Submitter_ChangeDate = reader.Database.Submitters.Single().ChangeDate; | ||
Assert.Equal("02 JUN 2023 10:11:12", Submitter_ChangeDate?.DateString); | ||
|
||
var father = reader.Database.Individuals.SingleOrDefault(x => x.GetName().Name == "/Father/"); | ||
Assert.Equal("03 JUN 2023 10:11:13", father?.ChangeDate?.DateString); | ||
|
||
GedcomChangeDate Family_ChangeDate = reader.Database.Families.Single().ChangeDate; | ||
Assert.Equal("04 JUN 2023 10:11:14", Family_ChangeDate?.DateString); | ||
|
||
GedcomChangeDate Source_ChangeDate = reader.Database.Sources.Single().ChangeDate; | ||
Assert.Equal("05 JUN 2023 10:11:15", Source_ChangeDate?.DateString); | ||
|
||
GedcomChangeDate Repository_ChangeDate = reader.Database.Repositories.Single().ChangeDate; | ||
Assert.Equal("06 JUN 2023 10:11:16", Repository_ChangeDate?.DateString); | ||
|
||
GedcomChangeDate Note_ChangeDate = reader.Database.Notes.Single().ChangeDate; | ||
Assert.Equal("07 JUN 2023 10:11:17", Note_ChangeDate?.DateString); | ||
|
||
GedcomChangeDate Media_ChangeDate = reader.Database.Media.Single().ChangeDate; | ||
Assert.Equal("08 JUN 2023 10:11:18", Media_ChangeDate?.DateString); | ||
} | ||
} | ||
} |
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