Ejemplo n.º 1
0
        public void Test_IsEmptyF()
        {
            GDMAddress instance = new GDMAddress(null);

            instance.SetAddressText("blah");
            Assert.AreEqual(false, instance.IsEmpty());
        }
Ejemplo n.º 2
0
        public override void Assign(GDMTag source)
        {
            GDMAddress otherAddr = source as GDMAddress;

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

            base.Assign(source);

            fLines.Assign(otherAddr.fLines);
            fAddressLine1      = otherAddr.fAddressLine1;
            fAddressLine2      = otherAddr.fAddressLine2;
            fAddressLine3      = otherAddr.fAddressLine3;
            fAddressCity       = otherAddr.fAddressCity;
            fAddressState      = otherAddr.fAddressState;
            fAddressPostalCode = otherAddr.fAddressPostalCode;
            fAddressCountry    = otherAddr.fAddressCountry;

            AssignList(otherAddr.fPhoneList, fPhoneList);
            AssignList(otherAddr.fEmailList, fEmailList);
            AssignList(otherAddr.fFaxList, fFaxList);
            AssignList(otherAddr.fWWWList, fWWWList);
        }
Ejemplo n.º 3
0
        public void Test_AddressParse2()
        {
            string     text = "0 @I1@ INDI\n1 FACT\n2 ADDR Institute for Higher\n3 CONT Learning\n3 CONT Novozavodskaya ul., 10\n3 CITY Moskva\n3 CTRY Russia\n3 POST 121309";
            GDMAddress res  = AddrParse(text);

            Assert.AreEqual("Institute for Higher\r\nLearning\r\nNovozavodskaya ul., 10", res.Lines.Text);
        }
Ejemplo n.º 4
0
        public GDMRepositoryRecord(GDMTree tree) : base(tree)
        {
            SetName(GEDCOMTagType.REPO);

            fAddress        = new GDMAddress();
            fRepositoryName = string.Empty;
        }
Ejemplo n.º 5
0
        public void Test_SetAddressCountry()
        {
            string     value    = "Moosylvania";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressCountry = value;
            Assert.AreEqual(value, instance.AddressCountry);
        }
Ejemplo n.º 6
0
        public void Test_SetAddressCity()
        {
            string     value    = "Moskva";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressCity = value;
            Assert.AreEqual(value, instance.AddressCity);
        }
Ejemplo n.º 7
0
        public void Test_SetAddressLine3()
        {
            string     value    = "ALEKSCEVSKTY r-n";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressLine3 = value;
            Assert.AreEqual(value, instance.AddressLine3);
        }
Ejemplo n.º 8
0
        public void Test_SetAddressLine2()
        {
            string     value    = "Novozavodskaya ul., 10";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressLine2 = value;
            Assert.AreEqual(value, instance.AddressLine2);
        }
Ejemplo n.º 9
0
        public void Test_SetAddressLine1()
        {
            string     value    = "1234 Main St";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressLine1 = value;
            Assert.AreEqual(value, instance.AddressLine1);
        }
Ejemplo n.º 10
0
        public void Test_Clear()
        {
            GDMAddress instance = new GDMAddress(null);

            instance.SetAddressText("blah");
            instance.Clear();
            Assert.IsTrue(instance.IsEmpty());
        }
Ejemplo n.º 11
0
        public void Test_PhoneParse()
        {
            string     text = "0 @I1@ INDI\n1 FACT\n2 PHON +7 499 277-71-00\n2 ADDR Institute for Higher\n3 CONT Learning\n2 PHON +7 495 967-77-76\n";
            GDMAddress res  = AddrParse(text);

            Assert.AreEqual(2, res.PhoneNumbers.Count);
            Assert.AreEqual("Institute for Higher\r\nLearning", res.Lines.Text);
        }
Ejemplo n.º 12
0
        public void Test_SetAddressPostalCode()
        {
            string     value    = "1234A567";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressPostalCode = value;
            Assert.AreEqual(value, instance.AddressPostalCode);
        }
Ejemplo n.º 13
0
        public void Test_SetAddressState()
        {
            string     value    = "VORONEJSKAYA obl";
            GDMAddress instance = new GDMAddress(null);

            instance.AddressState = value;
            Assert.AreEqual(value, instance.AddressState);
        }
Ejemplo n.º 14
0
        public void Test_IsMatch()
        {
            var           matchParams = new MatchParams();
            GDMTag        other       = new GDMAddress();
            GDMNoteRecord instance    = new GDMNoteRecord(null);
            float         result      = instance.IsMatch(other, matchParams); // TODO matchParams is not used

            Assert.AreEqual(0.0F, result, 0.0);
        }
Ejemplo n.º 15
0
        public GDMSubmitterRecord(GDMTree tree) : base(tree)
        {
            SetName(GEDCOMTagType.SUBM);

            fAddress             = new GDMAddress();
            fLanguages           = new GDMList <GDMLanguage>();
            fName                = new GDMPersonalName();
            fRegisteredReference = string.Empty;
        }
Ejemplo n.º 16
0
 protected GDMCustomEvent(GDMObject owner) : base(owner)
 {
     fAddress         = new GDMAddress(this);
     fDate            = new GDMDateValue(this);
     fPlace           = new GDMPlace(this);
     fNotes           = new GDMList <GDMNotes>(this);
     fSourceCitations = new GDMList <GDMSourceCitation>(this);
     fMultimediaLinks = new GDMList <GDMMultimediaLink>(this);
 }
Ejemplo n.º 17
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;
        }
Ejemplo n.º 18
0
 protected GDMCustomEvent()
 {
     fAddress         = new GDMAddress();
     fDate            = new GDMDateValue();
     fPlace           = new GDMPlace();
     fNotes           = new GDMList <GDMNotes>();
     fSourceCitations = new GDMList <GDMSourceCitation>();
     fMultimediaLinks = new GDMList <GDMMultimediaLink>();
 }
Ejemplo n.º 19
0
        public void Test_SetAddressText()
        {
            string     value    = "this is a test";
            GDMAddress instance = new GDMAddress(null);

            instance.SetAddressText(value);
            StringList val2 = new StringList(value);

            Assert.AreEqual(val2.Text, instance.Lines.Text);
        }
Ejemplo n.º 20
0
        public void Test_AddressParse()
        {
            string     text = "0 @I1@ INDI\n1 FACT\n2 ADDR Institute for Higher\n3 CONT Learning\n3 ADR1 Novozavodskaya ul., 10\n3 CITY Moskva\n3 CTRY Russia\n3 POST 121309";
            GDMAddress res  = AddrParse(text);

            Assert.AreEqual("Moskva", res.AddressCity);
            Assert.AreEqual("Russia", res.AddressCountry);
            Assert.AreEqual("121309", res.AddressPostalCode);
            Assert.AreEqual("", res.AddressState);
        }
Ejemplo n.º 21
0
        public void Test_AddFaxNumber()
        {
            string     value    = "(214) 748-3647";
            GDMAddress instance = new GDMAddress();

            instance.AddFaxNumber(value);
            GDMList <GDMTag> pl = instance.FaxNumbers;

            Assert.AreEqual(1, pl.Count);
            Assert.AreEqual(value, pl.Extract(0).StringValue);
        }
Ejemplo n.º 22
0
        public void Test_AddPhoneNumber()
        {
            string     value    = "(214) 748-3647";
            GDMAddress instance = new GDMAddress(null);

            instance.AddPhoneNumber(value);
            GDMList <GDMTag> pl = instance.PhoneNumbers;

            Assert.AreEqual(1, pl.Count);
            Assert.AreEqual(value, pl[0].StringValue);
        }
Ejemplo n.º 23
0
        public void Test_AddEmailAddress()
        {
            string     value    = "*****@*****.**";
            GDMAddress instance = new GDMAddress(null);

            instance.AddEmailAddress(value);
            GDMList <GDMTag> pl = instance.EmailAddresses;

            Assert.AreEqual(1, pl.Count);
            Assert.AreEqual(value, pl.Extract(0).StringValue);
        }
Ejemplo n.º 24
0
        public void Test_SetAddress()
        {
            var vals = new string[] {
                "Address Line 1",
                "Address Line 2"
            };
            StringList value    = new StringList(vals);
            GDMAddress instance = new GDMAddress(null);

            instance.Lines.AddStrings(value);
            Assert.AreEqual(value.Text, instance.Lines.Text);
        }
Ejemplo n.º 25
0
        public void Test_Assign()
        {
            GDMTag     source   = null;
            GDMAddress instance = new GDMAddress(null);

            Assert.Throws(typeof(ArgumentException), () => {
                instance.Assign(source);
            });

            source = new GDMAddress(null);
            instance.Assign(source);
        }
Ejemplo n.º 26
0
        public void Test_SetAddress()
        {
            var vals = new string[] {
                "Address Line 1",
                "Address Line 2"
            };
            GDMLines   value    = new GDMLines(vals);
            GDMAddress instance = new GDMAddress();

            instance.Lines.AddRange(value);
            Assert.AreEqual(value.Text, instance.Lines.Text);
        }
Ejemplo n.º 27
0
        public void Test_AddWebPage1()
        {
            string     value    = "http://www.bitboost.com/ref/international-address-formats/russia/";
            GDMAddress instance = new GDMAddress(null);

            instance.AddWebPage(value);
            GDMList <GDMTag> wp = instance.WebPages;

            Assert.AreEqual(1, wp.Count);
            string res = wp.Extract(0).StringValue;

            Assert.AreEqual(res, value);
        }
Ejemplo n.º 28
0
        public void Test_SetAddressArray()
        {
            // http://www.bitboost.com/ref/international-address-formats/russia/
            string[] value = new string[] {
                "ul. Lesnaya d. 5",
                "pos. Lesnoe",
                "ALEKSCEVSKTY r-n",
                "VORONEJSKAYA obl",
                "247112",
                "RUSSIAN FEDERATION"
            };
            GDMAddress instance = new GDMAddress(null);

            instance.SetAddressArray(value);
            Assert.AreEqual(new StringList(value).Text, instance.Lines.Text);
        }
Ejemplo n.º 29
0
        public void Test_AddPhoneNumber2()
        {
            string     value1   = "(214) 748-3647";
            string     value2   = "(999) 748-3647";
            GDMAddress instance = new GDMAddress(null);

            instance.AddPhoneNumber(value1);
            instance.AddPhoneNumber(value2);
            GDMList <GDMTag> pl = instance.PhoneNumbers;

            Assert.AreEqual(2, pl.Count);
            string res = pl[0].StringValue;

            Assert.AreEqual(res, value1);
            res = pl[1].StringValue;
            Assert.AreEqual(res, value2);
        }
Ejemplo n.º 30
0
        public void Test_AddWebPage2()
        {
            string     value1   = "http://www.bitboost.com/ref/international-address-formats/russia/";
            string     value2   = "http://google.com/search";
            GDMAddress instance = new GDMAddress(null);

            instance.AddWebPage(value1);
            instance.AddWebPage(value2);
            GDMList <GDMTag> wp = instance.WebPages;

            Assert.AreEqual(2, wp.Count);
            string res1 = wp[0].StringValue;

            Assert.AreEqual(res1, value1);
            string res2 = wp[1].StringValue;

            Assert.AreEqual(res2, value2);
        }