public void Test_Common() { using (GDMChangeDate cd = new GDMChangeDate(null)) { Assert.IsNotNull(cd); DateTime dtNow = DateTime.Now; dtNow = dtNow.AddTicks(-dtNow.Ticks % 10000000); cd.ChangeDateTime = dtNow; DateTime dtx = cd.ChangeDateTime; Assert.AreEqual(dtNow, dtx); Assert.AreEqual(dtNow.ToString("yyyy.MM.dd HH:mm:ss"), cd.ToString()); cd.ChangeDateTime = TestUtils.ParseDTX("04.01.2013 11:12"); using (GDMChangeDate chd2 = new GDMChangeDate(null)) { Assert.IsNotNull(chd2); Assert.Throws(typeof(ArgumentException), () => { chd2.Assign(null); }); chd2.Assign(cd); string buf = TestUtils.GetTagStreamText(chd2, 1); Assert.AreEqual("1 CHAN\r\n" + "2 DATE 04 JAN 2013\r\n" + "3 TIME 11:12:00\r\n", buf); } Assert.IsFalse(cd.IsEmpty()); cd.Clear(); Assert.IsTrue(cd.IsEmpty()); } }
public GDMRecord(GDMTree tree) { fTree = tree; fXRef = string.Empty; fAutomatedRecordID = string.Empty; fChangeDate = new GDMChangeDate(); }
public GDMRecord(GDMObject owner) : base(owner) { fAutomatedRecordID = string.Empty; fChangeDate = new GDMChangeDate(this); fNotes = new GDMList <GDMNotes>(this); fSourceCitations = new GDMList <GDMSourceCitation>(this); fMultimediaLinks = new GDMList <GDMMultimediaLink>(this); fUserReferences = new GDMList <GDMUserReference>(this); }
public GDMRecord(GDMTree tree) : base() { fTree = tree; fXRef = string.Empty; fAutomatedRecordID = string.Empty; fChangeDate = new GDMChangeDate(); fNotes = new GDMList <GDMNotes>(); fSourceCitations = new GDMList <GDMSourceCitation>(); fMultimediaLinks = new GDMList <GDMMultimediaLink>(); fUserReferences = new GDMList <GDMUserReference>(); }
public override void Assign(GDMTag source) { GDMChangeDate otherChnDate = (source as GDMChangeDate); if (otherChnDate == null) { throw new ArgumentException(@"Argument is null or wrong type", "source"); } base.Assign(otherChnDate); fChangeDateTime = otherChnDate.fChangeDateTime; }