public void testReplaceXRefs() { XRefReplacer map = null; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ReplaceXRefs(map); }
public void testPack() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.AddTag("BLECH", null, null); instance.Pack(); Assert.IsNull(instance.FindTag("BLECH", 0)); }
public void testGetNameType() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); GEDCOMNameType expResult = GEDCOMNameType.ntNone; GEDCOMNameType result = instance.NameType; Assert.AreEqual(expResult, result); }
public void testIsEmpty() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); bool expResult = true; bool result = instance.IsEmpty(); Assert.AreEqual(expResult, result); }
public GEDCOMPersonalName AddPersonalName(GEDCOMPersonalName value) { if (value != null) { value.SetLevel(Level + 1); fPersonalNames.Add(value); } return(value); }
public void testResetOwner() { GEDCOMTree newOwner = new GEDCOMTree(); GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ResetOwner(newOwner); Assert.AreEqual(newOwner, instance.Owner); }
public void testSaveToStream() { StreamWriter stream = null; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); Assert.Throws(typeof(NullReferenceException), () => { instance.SaveToStream(stream); }); }
public void testAssign() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); GEDCOMTag source = null; Assert.Throws(typeof(ArgumentException), () => { instance.Assign(source); }); }
public void testAddTag() { string tagName = "TYPE"; string tagValue = "gibber"; TagConstructor tagConstructor = null; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.AddTag(tagName, tagValue, tagConstructor); Assert.IsNotNull(instance.FindTag(tagName, 0)); }
public void testParseString() { // TODO BUG return value from parsestring has no meaning (all codepaths return same) string strValue = ""; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); string expResult = ""; string result = instance.ParseString(strValue); Assert.AreEqual(expResult, result); }
public void testGetStringValue() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString(" Ivan Ivanoff / Fedoroff / Esquire "); string expResult = "Ivan Ivanoff /Fedoroff/ Esquire"; Assert.AreEqual(expResult, instance.StringValue); }
public void testSetNameType() { GEDCOMNameType value = GEDCOMNameType.ntBirth; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.NameType = value; GEDCOMNameType result = instance.NameType; Assert.AreEqual(value, result); }
public void testIsEmptyF() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString(" Ivan Ivanoff / Fedoroff / Esquire "); bool expResult = false; bool result = instance.IsEmpty(); Assert.AreEqual(expResult, result); }
public void testGetLastPart() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString("Ivan/Fedoroff/ Esquire"); string expResult = "Esquire"; string result = instance.LastPart; Assert.AreEqual(expResult, result); }
public void testGetSurname() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString("Ivan/Fedoroff/"); string expResult = "Fedoroff"; string result = instance.Surname; Assert.AreEqual(expResult, result); }
public void testGetFullName() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.SetNameParts("Ivan Ivanov", "Fedoroff", ""); string expResult = "Ivan Ivanov Fedoroff"; string result = instance.FullName; Assert.AreEqual(expResult, result); }
public void testCreate() { GEDCOMTree owner = null; GEDCOMObject parent = null; string tagName = ""; string tagValue = ""; GEDCOMTag expResult = null; GEDCOMTag result = GEDCOMPersonalName.Create(owner, parent, tagName, tagValue); Assert.IsNotNull(result); }
public void testIsMatch5() { GEDCOMPersonalName instance1 = new GEDCOMPersonalName(null, null, "", ""); instance1.ParseString("Ivan Ivanoff /Fedoroff/"); bool onlyFirstPart = false; float expResult = 0.0F; float result = instance1.IsMatch(null, onlyFirstPart); Assert.AreEqual(expResult, result, 0.0); }
public void testParseString2() { string strValue = "Pytor /the great"; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); string expResult = "Pytor"; instance.ParseString(strValue); string result = instance.FullName; Assert.AreEqual(expResult, result); }
public void testSetNamePartsNull() { string firstPart = "Ivan Ivanoff"; string surname = "Fedoroff"; string lastPart = null; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.SetNameParts(firstPart, surname, lastPart); Assert.AreEqual("Ivan Ivanoff Fedoroff", instance.FullName); }
public void testSetLastPart() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString("Ivan/Fedoroff/ Esquire"); string value = "the III"; instance.LastPart = value; string result = instance.LastPart; Assert.AreEqual(value, result); }
public void testSetSurname() { GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.ParseString("Ivan/Fedoroff/"); string value = "Yaga"; instance.Surname = value; string result = instance.FullName; string expResult = "Ivan Yaga"; Assert.AreEqual(expResult, result); }
public void testSetNameParts() { string firstPart = "Ivan Ivanoff"; string surname = "Fedoroff"; string lastPart = "Esquire"; GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", ""); instance.SetNameParts(firstPart, surname, lastPart); string result = instance.FullName; string expResult = "Ivan Ivanoff Fedoroff Esquire"; Assert.AreEqual(expResult, result); }
public void testIsMatch9() { GEDCOMPersonalName instance1 = new GEDCOMPersonalName(null, null, "", ""); instance1.ParseString("Vasiliy Pupkin"); GEDCOMPersonalName instance2 = new GEDCOMPersonalName(null, null, "", ""); instance2.SetNameParts("Vasiliy Pupkin", "", ""); bool onlyFirstPart = false; float expResult = 100.0F; float result = instance1.IsMatch(instance2, onlyFirstPart); Assert.AreEqual(expResult, result, 0.0); }
public void testIsMatch4() { GEDCOMPersonalName instance1 = new GEDCOMPersonalName(null, null, "", ""); instance1.ParseString("Ivan Ivanoff /Fedoroff/"); GEDCOMPersonalName instance2 = new GEDCOMPersonalName(null, null, "", ""); instance2.SetNameParts("Pyotr", "Fedoroff", "Esquire"); bool onlyFirstPart = false; float expResult = 100.0F; float result = instance1.IsMatch(instance2, onlyFirstPart); Assert.AreNotEqual(expResult, result); }
public void testIsMatch8() { GEDCOMPersonalName instance1 = new GEDCOMPersonalName(null, null, "", ""); instance1.ParseString("Ivan Ivanoff /?/"); GEDCOMPersonalName instance2 = new GEDCOMPersonalName(null, null, "", ""); instance2.SetNameParts("Ivan Ivanoff", "Unknown", ""); bool onlyFirstPart = false; float result = instance1.IsMatch(instance2, onlyFirstPart); Assert.AreEqual(100.0f, result, 0.0); }
public void testIsMatch1() { GEDCOMPersonalName instance1 = new GEDCOMPersonalName(null, null, "", ""); instance1.ParseString("Ivan Ivanoff /Fedoroff/"); GEDCOMPersonalName instance2 = new GEDCOMPersonalName(null, null, "", ""); instance2.ParseString("Ivan Ivanoff"); bool onlyFirstPart = true; float result = instance1.IsMatch(instance2, onlyFirstPart); Assert.AreEqual(100.0f, result, 0.0); }
public override void Assign(GEDCOMTag source) { GEDCOMPersonalName otherName = (source as GEDCOMPersonalName); 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; fPieces.Assign(otherName.Pieces); }
public override void Assign(GEDCOMTag source) { GEDCOMIndividualRecord sourceRec = source as GEDCOMIndividualRecord; if (sourceRec == null) { throw new ArgumentException(@"Argument is null or wrong type", "source"); } base.Assign(source); foreach (GEDCOMPersonalName srcName in sourceRec.fPersonalNames) { GEDCOMPersonalName copyName = (GEDCOMPersonalName)GEDCOMPersonalName.Create(Owner, this, "", ""); copyName.Assign(srcName); AddPersonalName(copyName); } }
private string GetComparableName(bool onlyFirstPart) { string resName; if (fPersonalNames.Count > 0) { GEDCOMPersonalName np = fPersonalNames[0]; if (onlyFirstPart) { resName = np.FirstPart; } else { resName = np.StringValue; } } else { resName = ""; } return(resName); }