public void Test_Common() { GDMSubmissionRecord submRec = fContext.Tree.AddRecord(new GDMSubmissionRecord(fContext.Tree)) as GDMSubmissionRecord; GDMRecord sbmrRec = fContext.Tree.AddRecord(new GDMSubmitterRecord(fContext.Tree)); fContext.Tree.NewXRef(sbmrRec); string submitterXRef = sbmrRec.XRef; submRec.FamilyFileName = "FamilyFileName"; Assert.AreEqual("FamilyFileName", submRec.FamilyFileName); submRec.TempleCode = "TempleCode"; Assert.AreEqual("TempleCode", submRec.TempleCode); submRec.GenerationsOfAncestors = 11; Assert.AreEqual(11, submRec.GenerationsOfAncestors); submRec.GenerationsOfDescendants = 77; Assert.AreEqual(77, submRec.GenerationsOfDescendants); submRec.OrdinanceProcessFlag = GDMOrdinanceProcessFlag.opYes; Assert.AreEqual(GDMOrdinanceProcessFlag.opYes, submRec.OrdinanceProcessFlag); submRec.Submitter.XRef = submitterXRef; GDMSubmitterRecord subr = fContext.Tree.GetPtrValue <GDMSubmitterRecord>(submRec.Submitter); Assert.IsNotNull(subr); submRec.ReplaceXRefs(new GDMXRefReplacer()); Assert.IsFalse(submRec.IsEmpty()); submRec.Clear(); Assert.IsTrue(submRec.IsEmpty()); }
public void Test_Common() { using (GDMSubmitterRecord subrRec = new GDMSubmitterRecord(fContext.Tree)) { subrRec.Name.StringValue = "Test Submitter"; Assert.AreEqual("Test Submitter", subrRec.Name.StringValue); subrRec.RegisteredReference = "regref"; Assert.AreEqual("regref", subrRec.RegisteredReference); var lang = new GDMLanguage(subrRec); lang.ParseString("Russian"); subrRec.Languages.Add(lang); Assert.AreEqual("Russian", subrRec.Languages[0].StringValue); subrRec.SetLanguage(0, "nothing"); // return without exceptions subrRec.SetLanguage(1, "English"); Assert.AreEqual("English", subrRec.Languages[1].StringValue); Assert.IsNotNull(subrRec.Address); subrRec.ReplaceXRefs(new GDMXRefReplacer()); Assert.IsFalse(subrRec.IsEmpty()); subrRec.Clear(); Assert.IsTrue(subrRec.IsEmpty()); subrRec.ResetOwner(fContext.Tree); Assert.AreEqual(fContext.Tree, subrRec.GetTree()); } }
public void Test_SetLanguage() { var inst = new GDMSubmitterRecord(fContext.Tree); inst.SetLanguage(-1, "nothing test"); Assert.AreEqual(0, inst.Languages.Count); inst.SetLanguage(0, "test"); Assert.AreEqual(1, inst.Languages.Count); }
public GDMSubmitterRecord GetSubmitter() { GDMSubmitterRecord submitter = fHeader.Submitter.Value as GDMSubmitterRecord; if (submitter == null) { submitter = new GDMSubmitterRecord(this); submitter.InitNew(); AddRecord(submitter); fHeader.Submitter.Value = submitter; } return(submitter); }
public GDMSubmitterRecord GetSubmitter() { GDMSubmitterRecord submitter = GetPtrValue <GDMSubmitterRecord>(fHeader.Submitter); if (submitter == null) { submitter = new GDMSubmitterRecord(this); NewXRef(submitter); AddRecord(submitter); SetPtrValue(fHeader.Submitter, submitter); } return(submitter); }