Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }
Пример #6
0
        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));
        }
Пример #7
0
        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));
        }
Пример #8
0
        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));
        }