Skip to content

Instantly share code, notes, and snippets.

@gra-moore
Created July 30, 2012 07:35
Show Gist options
  • Save gra-moore/3205520 to your computer and use it in GitHub Desktop.
Save gra-moore/3205520 to your computer and use it in GitHub Desktop.
GEDCOM Importer Test
[TestMethod]
public void TestImporter()
{
var storeId = Guid.NewGuid().ToString();
GedcomImporter.Import(DataFolder + "simple.ged", "type=embedded;storesdirectory=c:\\brightstar;storename=" + storeId);
var ctx = new GedComContext("type=embedded;storesdirectory=c:\\brightstar;storename=" + storeId);
Assert.AreEqual(3, ctx.Individuals.Count());
Assert.AreEqual(1, ctx.Families.Count());
var family = ctx.Families.ToList()[0];
Assert.IsNotNull(family.Husband);
Assert.AreEqual("1 JAN 1899", family.Husband.BirthEvent.Date);
Assert.AreEqual("M", family.Husband.Sex);
Assert.AreEqual(family, family.Husband.SpouseFamilies().ToList()[0]);
Assert.IsNotNull(family.Wife);
Assert.AreEqual("1 JAN 1899", family.Wife.BirthEvent.Date);
Assert.AreEqual("F", family.Wife.Sex);
Assert.AreEqual(1, family.Children.Count());
Assert.AreEqual("marriage place", family.MarriageEvent.Place);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment