public void Partial1() { var txt = "0 @I1@".ToCharArray(); GEDSplitter gs = new GEDSplitter(10); Assert.AreEqual(2, gs.Split(txt, ' ')); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual("I1", gs.Ident(txt)); }
public void LongerDefault() { var txt = "1 Page According to his death certificate, John McGinnis was born in 1776 a real life nephew".ToCharArray(); GEDSplitter gs = new GEDSplitter(5); gs.Split(txt, ' '); Assert.AreEqual('1', gs.Level(txt)); Assert.AreEqual("Page", gs.Tag(txt)); }
public void BadId() { var txt = "0 @I1 FAM".ToCharArray(); GEDSplitter gs = new GEDSplitter(5); gs.Split(txt, ' '); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual("FAM", gs.Tag(txt)); Assert.AreEqual("I1", gs.Ident(txt)); }
public void Longer() { var txt = "1 Page According to his death certificate, John McGinnis was bor".ToCharArray(); GEDSplitter gs = new GEDSplitter(20); Assert.AreEqual(11, gs.Split(txt, ' ')); Assert.AreEqual('1', gs.Level(txt)); Assert.AreEqual("Page", gs.Tag(txt)); Assert.AreEqual("According to his death certificate, John McGinnis was bor", gs.Remain(txt)); }
public void ExtraSpaces() { var txt = "0 @I1@ INDI".ToCharArray(); GEDSplitter gs = new GEDSplitter(10); Assert.AreEqual(3, gs.Split(txt, ' ')); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual("I1", gs.Ident(txt)); Assert.AreEqual("INDI", gs.Tag(txt)); }
public void Partial2() { var txt = "0".ToCharArray(); GEDSplitter gs = new GEDSplitter(10); Assert.AreEqual(1, gs.Split(txt, ' ')); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual(null, gs.Tag(txt)); Assert.AreEqual(null, gs.Remain(txt)); }
public void MissTag() { var txt = "0 @Z1@ ".ToCharArray(); GEDSplitter gs = new GEDSplitter(5); gs.Split(txt, ' '); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual("Z1", gs.Ident(txt)); Assert.AreEqual("", gs.Tag(txt)); }
public void BadId2() { // See V208252.ged var txt = "0 @ 11@ FAM".ToCharArray(); GEDSplitter gs = new GEDSplitter(5); gs.Split(txt, ' '); Assert.AreEqual('0', gs.Level(txt)); Assert.AreEqual("FAM", gs.Tag(txt)); Assert.AreEqual("11", gs.Ident(txt)); }