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 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 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 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 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 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);
        }
Пример #10
0
        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);
        }
Пример #11
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);
        }
Пример #12
0
        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);
        }
Пример #13
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);
        }