Esempio n. 1
0
        public void Test_SetNameParts()
        {
            GDMPersonalName instance = new GDMPersonalName();

            instance.SetNameParts("Ivan Ivanoff", "Fedoroff", "Esquire");
            Assert.AreEqual("Ivan Ivanoff Fedoroff Esquire", instance.FullName);
        }
Esempio n. 2
0
        public void Test_ParseString2()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Pytor /the great");
            Assert.AreEqual("Pytor", instance.FullName);
        }
Esempio n. 3
0
        public void Test_GetFullName()
        {
            GDMPersonalName instance = new GDMPersonalName();

            instance.SetNameParts("Ivan Ivanov", "Fedoroff", "");
            Assert.AreEqual("Ivan Ivanov Fedoroff", instance.FullName);
        }
Esempio n. 4
0
        public void Test_Pack()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.AddTag(new GDMTag(instance, GEDCOMTagsTable.Lookup("BLECH"), null));
            Assert.IsNotNull(instance.FindTag("BLECH", 0));
        }
Esempio n. 5
0
        public void Test_NameType()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.NameType = GDMNameType.ntImmigrant;
            Assert.AreEqual(GDMNameType.ntImmigrant, instance.NameType);
        }
Esempio n. 6
0
        public void Test_ParseString()
        {
            // TODO BUG return value from parsestring has no meaning (all codepaths return same)
            GDMPersonalName instance = new GDMPersonalName(null);

            Assert.AreEqual("", instance.ParseString(""));
        }
Esempio n. 7
0
        public void Test_SetNameType()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.NameType = GDMNameType.ntBirth;
            Assert.AreEqual(GDMNameType.ntBirth, instance.NameType);
        }
Esempio n. 8
0
        public void Test_GetStringValue()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString(" Ivan Ivanoff / Fedoroff / Esquire ");
            Assert.AreEqual("Ivan Ivanoff /Fedoroff/ Esquire", instance.StringValue);
        }
Esempio n. 9
0
        public void Test_GetLastPart()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Ivan/Fedoroff/ Esquire");
            Assert.AreEqual("Esquire", instance.LastPart);
        }
Esempio n. 10
0
        public void Test_ReplaceXRefs()
        {
            GDMXRefReplacer map      = null;
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ReplaceXRefs(map);
        }
Esempio n. 11
0
        public void Test_GetFirstPart()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Ivan/Fedoroff/");
            Assert.AreEqual("Ivan", instance.FirstPart);
        }
Esempio n. 12
0
        public void Test_GetSurname()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Ivan/Fedoroff/");
            Assert.AreEqual("Fedoroff", instance.Surname);
        }
Esempio n. 13
0
        public override void Assign(GDMTag source)
        {
            GDMPersonalName otherName = (source as GDMPersonalName);

            if (otherName == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "source");
            }

            base.Assign(otherName);

            fFirstPart = otherName.fFirstPart;
            fSurname   = otherName.fSurname;
            fLastPart  = otherName.fLastPart;

            fLanguage = otherName.fLanguage;
            fNameType = otherName.fNameType;

            fPieces.Assign(otherName.Pieces);
            if (otherName.fNotes != null)
            {
                AssignList(otherName.fNotes, Notes);
            }
            if (otherName.fSourceCitations != null)
            {
                AssignList(otherName.fSourceCitations, SourceCitations);
            }
        }
Esempio n. 14
0
        public void Test_IsEmptyF()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString(" Ivan Ivanoff / Fedoroff / Esquire ");
            Assert.AreEqual(false, instance.IsEmpty());
        }
Esempio n. 15
0
        public void Test_SetNamePartsNull()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.SetNameParts("Ivan Ivanoff", "Fedoroff", null);
            Assert.AreEqual("Ivan Ivanoff Fedoroff", instance.FullName);
        }
Esempio n. 16
0
        public void Test_SetSurname()
        {
            GDMPersonalName instance = new GDMPersonalName();

            instance.ParseString("Ivan/Fedoroff/");
            instance.Surname = "Yaga";
            Assert.AreEqual("Ivan Yaga", instance.FullName);
        }
Esempio n. 17
0
        public void Test_SetFirstPart()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Ivan/Fedoroff/");
            instance.FirstPart = "Baba Yaga";
            Assert.AreEqual("Baba Yaga Fedoroff", instance.FullName);
        }
Esempio n. 18
0
 public GDMPersonalName AddPersonalName(GDMPersonalName value)
 {
     if (value != null)
     {
         fPersonalNames.Add(value);
     }
     return(value);
 }
Esempio n. 19
0
        public void Test_Clear()
        {
            GDMPersonalName instance = new GDMPersonalName();

            instance.ParseString(" Ivan Ivanoff / Fedoroff / Esquire ");
            instance.Clear();
            Assert.AreEqual(true, instance.IsEmpty());
        }
Esempio n. 20
0
        public void Test_IsMatch5()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("Ivan Ivanoff /Fedoroff/");

            Assert.AreEqual(0.0F, instance1.IsMatch(null, false), 0.0);
        }
Esempio n. 21
0
        public GDMSubmitterRecord(GDMObject owner) : base(owner)
        {
            SetName(GEDCOMTagType.SUBM);

            fAddress             = new GDMAddress(this);
            fLanguages           = new GDMList <GDMLanguage>(this);
            fName                = new GDMPersonalName(this);
            fRegisteredReference = string.Empty;
        }
Esempio n. 22
0
        public GDMSubmitterRecord(GDMTree tree) : base(tree)
        {
            SetName(GEDCOMTagType.SUBM);

            fAddress             = new GDMAddress();
            fLanguages           = new GDMList <GDMLanguage>();
            fName                = new GDMPersonalName();
            fRegisteredReference = string.Empty;
        }
Esempio n. 23
0
        public void Test_SetLastPart()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            instance.ParseString("Ivan/Fedoroff/ Esquire");
            string value = "the III";

            instance.LastPart = value;
            Assert.AreEqual(value, instance.LastPart);
        }
Esempio n. 24
0
        public void Test_Assign()
        {
            GDMPersonalName instance = new GDMPersonalName(null);

            GDMTag source = null;

            Assert.Throws(typeof(ArgumentException), () => {
                instance.Assign(source);
            });
        }
Esempio n. 25
0
        public void Test_IsMatch9()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("Vasiliy Pupkin");

            GDMPersonalName instance2 = new GDMPersonalName(null);

            instance2.SetNameParts("Vasiliy Pupkin", "", "");

            Assert.AreEqual(100.0F, instance1.IsMatch(instance2, false), 0.0);
        }
Esempio n. 26
0
        public void Test_IsMatch8()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("Ivan Ivanoff /?/");

            GDMPersonalName instance2 = new GDMPersonalName(null);

            instance2.SetNameParts("Ivan Ivanoff", "Unknown", "");

            Assert.AreEqual(100.0f, instance1.IsMatch(instance2, false), 0.0);
        }
Esempio n. 27
0
        public void Test_IsMatch7()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("/Federoff/");

            GDMPersonalName instance2 = new GDMPersonalName(null);

            instance2.SetNameParts("", "Federoff", "");

            Assert.AreEqual(100.0F, instance1.IsMatch(instance2, false), 0.0);
        }
Esempio n. 28
0
        public void Test_IsMatch4()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("Ivan Ivanoff /Fedoroff/");

            GDMPersonalName instance2 = new GDMPersonalName(null);

            instance2.SetNameParts("Pyotr", "Fedoroff", "Esquire");

            Assert.AreNotEqual(100.0F, instance1.IsMatch(instance2, false));
        }
Esempio n. 29
0
        public void Test_IsMatch2()
        {
            GDMPersonalName instance1 = new GDMPersonalName(null);

            instance1.ParseString("Ivan Ivanoff /Fedoroff/");

            GDMPersonalName instance2 = new GDMPersonalName(null);

            instance2.ParseString("Pyotr Ivanoff");

            Assert.AreEqual(0.0F, instance1.IsMatch(instance2, true), 0.0);
        }
Esempio n. 30
0
        public override void Assign(GDMTag source)
        {
            GDMIndividualRecord sourceRec = source as GDMIndividualRecord;

            if (sourceRec == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "source");
            }

            base.Assign(source);

            fSex = sourceRec.fSex;

            foreach (GDMPersonalName srcName in sourceRec.fPersonalNames)
            {
                GDMPersonalName copyName = new GDMPersonalName(this);
                copyName.Assign(srcName);
                AddPersonalName(copyName);
            }
        }