Ejemplo n.º 1
0
        public void Test_Common()
        {
            using (GDMSourceData data = new GDMSourceData(null)) {
                Assert.IsNotNull(data);

                data.Agency = "test agency";
                Assert.AreEqual("test agency", data.Agency);

                GDMTag evenTag = data.Events.Add(new GDMSourceEvent(data));
                Assert.IsNotNull(evenTag);

                GDMSourceEvent evt = data.Events[0];
                Assert.AreEqual(evenTag, evt);

                evt.StringValue = "BIRT";

                var note = new GDMNotes(data);
                note.Lines.Text = "test sourcedata notes";
                data.Notes.Add(note);

                string buf = TestUtils.GetTagStreamText(data, 0);
                Assert.AreEqual("1 DATA\r\n" +
                                "2 NOTE test sourcedata notes\r\n" +
                                "2 AGNC test agency\r\n" +
                                "2 EVEN BIRT\r\n", buf);

                data.ReplaceXRefs(new GDMXRefReplacer());

                Assert.IsFalse(data.IsEmpty());
                data.Clear();
                Assert.IsTrue(data.IsEmpty());
            }
        }
Ejemplo n.º 2
0
        public GDMSourceRecord(GDMObject owner) : base(owner)
        {
            SetName(GEDCOMTagType.SOUR);

            fData                = new GDMSourceData(this);
            fOriginator          = new GDMTextTag(this, (int)GEDCOMTagType.AUTH);
            fPublication         = new GDMTextTag(this, (int)GEDCOMTagType.PUBL);
            fRepositoryCitations = new GDMList <GDMRepositoryCitation>(this);
            fShortTitle          = string.Empty;
            fText                = new GDMTextTag(this, (int)GEDCOMTagType.TEXT);
            fTitle               = new GDMTextTag(this, (int)GEDCOMTagType.TITL);
        }
Ejemplo n.º 3
0
        public void Test_Common()
        {
            using (GDMSourceData data = new GDMSourceData(null)) {
                Assert.IsNotNull(data);

                data.Agency = "test agency";
                Assert.AreEqual("test agency", data.Agency);

                GDMTag evenTag = data.Events.Add(new GDMSourceEvent(data));
                Assert.IsNotNull(evenTag);

                GDMSourceEvent evt = data.Events[0];
                Assert.AreEqual(evenTag, evt);

                data.ReplaceXRefs(new GDMXRefReplacer());

                Assert.IsFalse(data.IsEmpty());
                data.Clear();
                Assert.IsTrue(data.IsEmpty());
            }
        }