Example #1
0
        public void Test_GEDCOMFactory()
        {
            TagConstructor tagConst = TagConstructorTest;

            Assert.AreEqual(null, tagConst.Invoke(null, 0, "x"));

            //

            GDMTag tag = GEDCOMProvider.CreateTag(null, (int)GEDCOMTagType.DATE, "");

            Assert.IsNotNull(tag);

            tag = GEDCOMProvider.CreateTag(null, GEDCOMTagsTable.Lookup("TEST"), "");
            Assert.IsNotNull(tag);
            Assert.AreEqual("TEST", tag.GetTagName());
        }
Example #2
0
        public void Test_SetTagStringsL()
        {
            var tag = GDMTag.Create(null, GEDCOMTagsTable.Lookup("TEST"), "");

            Assert.IsNotNull(tag);

            // very long string, 248"A" and " BBB BBBB"
            var strings = new GDMLines("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBB BBBB");

            GEDCOMUtils.SetTagStrings(null, strings);

            GEDCOMUtils.SetTagStrings(tag, strings);

            Assert.AreEqual(248, tag.StringValue.Length);

            var strList = GEDCOMUtils.GetTagStrings(tag);

            Assert.IsNotNull(strList);
            Assert.AreEqual(1, strList.Count);
            Assert.AreEqual(strings.Text, strList.Text);
        }