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()); } }
public void Test_SourceEvent() { using (GDMSourceEvent evt = new GDMSourceEvent(null)) { Assert.IsNotNull(evt); Assert.IsNotNull(evt.Date); Assert.IsNotNull(evt.Place); evt.Place.StringValue = "test"; Assert.IsFalse(evt.IsEmpty()); evt.Clear(); Assert.IsTrue(evt.IsEmpty()); } }
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()); } }