VerifyPersonContainersDisplayDirectoryAllFiles,
SaveOne,
SaveParents,
GetRelations,
CleanDisplayDirectoryAllFilesAndWriteTicksGed
This commit is contained in:
2023-07-30 22:53:56 -07:00
parent 9071784255
commit 1594783c7d
15 changed files with 312 additions and 384 deletions

View File

@ -2,7 +2,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Phares.Shared;
using Serilog;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
@ -267,10 +266,9 @@ public partial class UnitTestHardCoded
{
bool first = true;
List<string> mappedLines;
List<PersonContainer> personContainers = new();
ReadOnlyDictionary<string, string[]> individuals;
GenealogicalDataCommunication genealogicalDataCommunication;
GenealogicalDataCommunicationLines genealogicalDataCommunicationLines;
GenealogicalDataCommunicationCollections genealogicalDataCommunicationCollections;
List<(bool, string)> genealogicalDataCommunicationFiles = new()
{
// new(false, Path.Combine(directory, "Ancestry-Roberts/Roberts Family Tree.ged")),
@ -288,15 +286,15 @@ public partial class UnitTestHardCoded
};
foreach ((bool requireNickName, string genealogicalDataCommunicationFile) in genealogicalDataCommunicationFiles)
{
(_, individuals, _, _, _) = IGenealogicalDataCommunication.GetIndividuals(_Configuration.PropertyConfiguration.PersonBirthdayFormat, genealogicalDataCommunicationFile, new(personContainers), requireNickName);
foreach (KeyValuePair<string, string[]> keyValuePair in individuals)
genealogicalDataCommunicationCollections = IGenealogicalDataCommunication.GetIndividuals(genealogicalDataCommunicationFile, requireNickName);
foreach (KeyValuePair<string, string[]> keyValuePair in genealogicalDataCommunicationCollections.Individuals)
{
genealogicalDataCommunicationLines = IGenealogicalDataCommunication.GetGenealogicalDataCommunicationLines(keyValuePair.Value);
Assert.IsNotNull(genealogicalDataCommunicationLines.Name);
genealogicalDataCommunication = IGenealogicalDataCommunication.GetGenealogicalDataCommunication(first, genealogicalDataCommunicationLines);
Assert.IsNotNull(genealogicalDataCommunication.Name);
}
mappedLines = IGenealogicalDataCommunication.GetMappedLines(_Configuration.PropertyConfiguration.PersonBirthdayFormat, genealogicalDataCommunicationFile, new(personContainers), requireNickName);
mappedLines = IGenealogicalDataCommunication.GetMappedLines(genealogicalDataCommunicationFile, requireNickName);
if (IPath.WriteAllText($"{genealogicalDataCommunicationFile}.cln", string.Join(Environment.NewLine, mappedLines), updateDateWhenMatches: false, compareBeforeWrite: true))
continue;
}
@ -320,10 +318,9 @@ public partial class UnitTestHardCoded
PersonName? personName;
string personKeyFormatted;
// bool isDefaultName = false;
List<PersonContainer> personContainers = new();
ReadOnlyDictionary<string, string[]> individuals;
GenealogicalDataCommunication genealogicalDataCommunication;
GenealogicalDataCommunicationLines genealogicalDataCommunicationLines;
GenealogicalDataCommunicationCollections genealogicalDataCommunicationCollections;
List<(bool, bool, string)> genealogicalDataCommunicationFiles = new()
{
// new(false, false, Path.Combine(saveDirectory, "Ancestry-Roberts/Roberts Family Tree.ged.cln")),
@ -342,8 +339,8 @@ public partial class UnitTestHardCoded
foreach ((bool verify, bool requireNickName, string genealogicalDataCommunicationFile) in genealogicalDataCommunicationFiles)
{
fileName = Path.GetFileNameWithoutExtension(genealogicalDataCommunicationFile).Split(' ')[0];
(_, individuals, _, _, _) = IGenealogicalDataCommunication.GetIndividuals(_Configuration.PropertyConfiguration.PersonBirthdayFormat, genealogicalDataCommunicationFile, new(personContainers), requireNickName);
foreach (KeyValuePair<string, string[]> keyValuePair in individuals)
genealogicalDataCommunicationCollections = IGenealogicalDataCommunication.GetIndividuals(genealogicalDataCommunicationFile, requireNickName);
foreach (KeyValuePair<string, string[]> keyValuePair in genealogicalDataCommunicationCollections.Individuals)
{
genealogicalDataCommunicationLines = IGenealogicalDataCommunication.GetGenealogicalDataCommunicationLines(keyValuePair.Value);
Assert.IsNotNull(genealogicalDataCommunicationLines.Name);