diff --git a/VisualCard.Tests/ContactData.cs b/VisualCard.Tests/ContactData.cs index 47315d4..06543a5 100644 --- a/VisualCard.Tests/ContactData.cs +++ b/VisualCard.Tests/ContactData.cs @@ -64,10 +64,10 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Rick", "Hood", [], [], []) - }, + ], ContactFullName = "Rick Hood" }; @@ -77,10 +77,10 @@ public static class ContactData "2.1" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Rick", "Hood", [], [], []) - }, + ], ContactFullName = "Rick Hood" }; #endregion @@ -102,10 +102,10 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Rick", "Hood", [], [], []) - }, + ], ContactFullName = "Rick Hood" }; #endregion @@ -127,10 +127,10 @@ public static class ContactData "4.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Rick", "Hood", [], [], []) - }, + ], ContactFullName = "Rick Hood" }; #endregion @@ -163,24 +163,24 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "John", "Sanders", [], [], []) - }, + ], ContactFullName = "John Sanders", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "CELL" }, "495-522-3560") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "HOME" }, "", "", "Los Angeles", "", "", "", "USA") - }, + ContactTelephones = + [ + new TelephoneInfo(0, [], ["CELL"], "495-522-3560") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["HOME"], "", "", "Los Angeles", "", "", "", "USA") + ], ContactNotes = "Note test for VisualCard", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "john.s@acme.co") - } + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "john.s@acme.co") + ] }; private static readonly string singleVcardTwoContact = @@ -209,39 +209,39 @@ public static class ContactData "2.1" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "John", "Sanders", [], [], []) - }, + ], ContactFullName = "John Sanders", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "CELL" }, "495-522-3560") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "HOME" }, "", "", "Los Angeles, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Acme Co.", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["CELL"], "495-522-3560") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["HOME"], "", "", "Los Angeles, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Acme Co.", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Product Manager") - }, + ], ContactNotes = "Note test for VisualCard", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "john.s@acme.co") - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "PHONETIC-FIRST-NAME", new string[] { "Saunders" }, []), - new XNameInfo(0, [], "PHONETIC-LAST-NAME", new string[] { "John" }, []), - new XNameInfo(0, [], "ANDROID-CUSTOM", new string[] { "vnd.android.cursor.item/nickname", "JS", "1", "", "", "", "", "", "", "", "", "", "", "", "", "" }, []), - new XNameInfo(0, [], "AIM", new string[] { "john.s" }, []), - } + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "john.s@acme.co") + ], + ContactXNames = + [ + new XNameInfo(0, [], "PHONETIC-FIRST-NAME", ["Saunders"], []), + new XNameInfo(0, [], "PHONETIC-LAST-NAME", ["John"], []), + new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "JS", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), + new XNameInfo(0, [], "AIM", ["john.s"], []), + ] }; #endregion @@ -272,42 +272,42 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "John", "Sanders", [], [], []) - }, + ], ContactFullName = "John Sanders", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "cell" }, "495-522-3560") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "home" }, "", "", "Los Angeles, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Acme Co.", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["cell"], "495-522-3560") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["home"], "", "", "Los Angeles, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Acme Co.", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Product Manager") - }, + ], ContactNotes = "Note test for VisualCard", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "home" }, "john.s@acme.co") - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "PHONETIC-FIRST-NAME", new string[] { "Saunders" }, []), - new XNameInfo(0, [], "PHONETIC-LAST-NAME", new string[] { "John" }, []), - new XNameInfo(0, [], "AIM", new string[] { "john.s" }, []), - }, - ContactNicknames = new NicknameInfo[] - { - new NicknameInfo(0, [], "JS", new string[] { "HOME" }) - } + ContactMails = + [ + new EmailInfo(0, [], ["home"], "john.s@acme.co") + ], + ContactXNames = + [ + new XNameInfo(0, [], "PHONETIC-FIRST-NAME", ["Saunders"], []), + new XNameInfo(0, [], "PHONETIC-LAST-NAME", ["John"], []), + new XNameInfo(0, [], "AIM", ["john.s"], []), + ], + ContactNicknames = + [ + new NicknameInfo(0, [], "JS", ["HOME"]) + ] }; #endregion @@ -338,42 +338,42 @@ public static class ContactData "4.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "John", "Sanders", [], [], []) - }, + ], ContactFullName = "John Sanders", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "cell" }, "495-522-3560") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "home" }, "", "", "Los Angeles, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Acme Co.", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["cell"], "495-522-3560") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["home"], "", "", "Los Angeles, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Acme Co.", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Product Manager") - }, + ], ContactNotes = "Note test for VisualCard", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "john.s@acme.co") - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "ANDROID-CUSTOM", new string[] { "vnd.android.cursor.item/nickname", "JS", "1", "", "", "", "", "", "", "", "", "", "", "", "", "" }, []), - new XNameInfo(0, [], "PHONETIC-FIRST-NAME", new string[] { "Saunders" }, []), - new XNameInfo(0, [], "PHONETIC-LAST-NAME", new string[] { "John" }, []) - }, - ContactImpps = new ImppInfo[] - { - new ImppInfo(0, [], "aim:john.s", new string[] { "HOME" }) - } + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "john.s@acme.co") + ], + ContactXNames = + [ + new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "JS", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), + new XNameInfo(0, [], "PHONETIC-FIRST-NAME", ["Saunders"], []), + new XNameInfo(0, [], "PHONETIC-LAST-NAME", ["John"], []) + ], + ContactImpps = + [ + new ImppInfo(0, [], "aim:john.s", ["HOME"]) + ] }; #endregion @@ -446,37 +446,37 @@ public static class ContactData "2.1" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Sarah", "Santos", [], [], []) - }, + ], ContactFullName = "Sarah Santos", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "CELL" }, "589-210-1059") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "HOME" }, "", "", "New York, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["CELL"], "589-210-1059") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["HOME"], "", "", "New York, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Chief Executive Officer") - }, + ], ContactURL = "https://sso.org/", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "sarah.s@gmail.com"), - new EmailInfo(0, [], new string[] { "WORK" }, "sarah.s@sso.org"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "SIP", new string[] { "sip test" }, []), - } + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "sarah.s@gmail.com"), + new EmailInfo(0, [], ["WORK"], "sarah.s@sso.org"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "SIP", ["sip test"], []), + ] }; private static readonly Card multipleVcardTwoContactsInstanceThree = new ( @@ -484,44 +484,44 @@ public static class ContactData "2.1" ) { - ContactNames = new NameInfo[] - { - new NameInfo(0, [], "Neville", "Navasquillo", new string[] { "Neville", "Nevile" }, new string[] { "Mr." }, new string[] { "Jr." }) - }, + ContactNames = + [ + new NameInfo(0, [], "Neville", "Navasquillo", ["Neville", "Nevile"], ["Mr."], ["Jr."]) + ], ContactFullName = "Neville Navasquillo", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "CELL" }, "1-234-567-890"), - new TelephoneInfo(0, [], new string[] { "WORK" }, "098-765-4321"), - new TelephoneInfo(0, [], new string[] { "VOICE" }, "078-494-6434"), - new TelephoneInfo(0, [], new string[] { "HOME" }, "348-404-8404"), - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "WORK" }, "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), - new AddressInfo(0, [], new string[] { "HOME" }, "", "", "Street Address", "", "", "", ""), - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["CELL"], "1-234-567-890"), + new TelephoneInfo(0, [], ["WORK"], "098-765-4321"), + new TelephoneInfo(0, [], ["VOICE"], "078-494-6434"), + new TelephoneInfo(0, [], ["HOME"], "348-404-8404"), + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["WORK"], "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), + new AddressInfo(0, [], ["HOME"], "", "", "Street Address", "", "", "", ""), + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Title") - }, + ], ContactNotes = "Notes", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "neville.nvs@gmail.com"), - new EmailInfo(0, [], new string[] { "WORK" }, "neville.nvs@nvsc.com"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "ANDROID-CUSTOM", new string[] { "vnd.android.cursor.item/nickname", "NVL.N", "1", "", "", "", "", "", "", "", "", "", "", "", "", "" }, []), - new XNameInfo(0, [], "AIM", new string[] { "IM" }, new string[] { "HOME" }), - new XNameInfo(0, [], "MSN", new string[] { "Windows LIVE" }, new string[] { "HOME" }), - new XNameInfo(0, [], "YAHOO", new string[] { "Yahoo" }, new string[] { "HOME" }), - } + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "neville.nvs@gmail.com"), + new EmailInfo(0, [], ["WORK"], "neville.nvs@nvsc.com"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "NVL.N", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), + new XNameInfo(0, [], "AIM", ["IM"], ["HOME"]), + new XNameInfo(0, [], "MSN", ["Windows LIVE"], ["HOME"]), + new XNameInfo(0, [], "YAHOO", ["Yahoo"], ["HOME"]), + ] }; private static readonly Card multipleVcardTwoContactsInstanceFour = singleVcardTwoContactShortInstance; #endregion @@ -595,37 +595,37 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Sarah", "Santos", [], [], []) - }, + ], ContactFullName = "Sarah Santos", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "cell" }, "589-210-1059") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "home" }, "", "", "New York, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["cell"], "589-210-1059") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["home"], "", "", "New York, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Chief Executive Officer") - }, + ], ContactURL = "https://sso.org/", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "home" }, "sarah.s@gmail.com"), - new EmailInfo(0, [], new string[] { "work" }, "sarah.s@sso.org"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "SIP", new string[] { "sip test" }, []), - } + ContactMails = + [ + new EmailInfo(0, [], ["home"], "sarah.s@gmail.com"), + new EmailInfo(0, [], ["work"], "sarah.s@sso.org"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "SIP", ["sip test"], []), + ] }; private static readonly Card multipleVcardThreeContactsInstanceThree = new ( @@ -633,47 +633,47 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { - new NameInfo(0, [], "Neville", "Navasquillo", new string[] { "Neville", "Nevile" }, new string[] { "Mr." }, new string[] { "Jr." }) - }, + ContactNames = + [ + new NameInfo(0, [], "Neville", "Navasquillo", ["Neville", "Nevile"], ["Mr."], ["Jr."]) + ], ContactFullName = "Neville Navasquillo", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "cell" }, "1-234-567-890"), - new TelephoneInfo(0, [], new string[] { "work" }, "098-765-4321"), - new TelephoneInfo(0, [], new string[] { "voice" }, "078-494-6434"), - new TelephoneInfo(0, [], new string[] { "home" }, "348-404-8404"), - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "work" }, "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), - new AddressInfo(0, [], new string[] { "home" }, "", "", "Street Address", "", "", "", ""), - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["cell"], "1-234-567-890"), + new TelephoneInfo(0, [], ["work"], "098-765-4321"), + new TelephoneInfo(0, [], ["voice"], "078-494-6434"), + new TelephoneInfo(0, [], ["home"], "348-404-8404"), + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["work"], "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), + new AddressInfo(0, [], ["home"], "", "", "Street Address", "", "", "", ""), + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Title") - }, + ], ContactNotes = "Notes", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "home" }, "neville.nvs@gmail.com"), - new EmailInfo(0, [], new string[] { "work" }, "neville.nvs@nvsc.com"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "AIM", new string[] { "IM" }, new string[] { "HOME" }), - new XNameInfo(0, [], "MSN", new string[] { "Windows LIVE" }, new string[] { "HOME" }), - new XNameInfo(0, [], "YAHOO", new string[] { "Yahoo" }, new string[] { "HOME" }), - }, - ContactNicknames = new NicknameInfo[] - { - new NicknameInfo(0, [], "NVL.N", new string[] { "HOME" }) - } + ContactMails = + [ + new EmailInfo(0, [], ["home"], "neville.nvs@gmail.com"), + new EmailInfo(0, [], ["work"], "neville.nvs@nvsc.com"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "AIM", ["IM"], ["HOME"]), + new XNameInfo(0, [], "MSN", ["Windows LIVE"], ["HOME"]), + new XNameInfo(0, [], "YAHOO", ["Yahoo"], ["HOME"]), + ], + ContactNicknames = + [ + new NicknameInfo(0, [], "NVL.N", ["HOME"]) + ] }; private static readonly Card multipleVcardThreeContactsInstanceFour = singleVcardThreeContactShortInstance; #endregion @@ -749,48 +749,48 @@ public static class ContactData "4.0" ) { - ContactNames = new NameInfo[] - { - new NameInfo(0, [], "Neville", "Navasquillo", new string[] { "Neville", "Nevile" }, new string[] { "Mr." }, new string[] { "Jr." }), - new NameInfo(0, new string[] { "LANGUAGE=de" }, "Neville", "NAVASQUILLO", new string[] { "Neville", "Nevile" }, new string[] { "Mr." }, new string[] { "Jr." }) - }, + ContactNames = + [ + new NameInfo(0, [], "Neville", "Navasquillo", ["Neville", "Nevile"], ["Mr."], ["Jr."]), + new NameInfo(0, ["LANGUAGE=de"], "Neville", "NAVASQUILLO", ["Neville", "Nevile"], ["Mr."], ["Jr."]) + ], ContactFullName = "Neville Navasquillo", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "work" }, "098-765-4321"), - new TelephoneInfo(0, [], new string[] { "cell" }, "1-234-567-890"), - new TelephoneInfo(0, [], new string[] { "voice" }, "078-494-6434"), - new TelephoneInfo(0, [], new string[] { "home" }, "348-404-8404"), - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "work" }, "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), - new AddressInfo(0, [], new string[] { "home" }, "", "", "Street Address", "", "", "", ""), - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["work"], "098-765-4321"), + new TelephoneInfo(0, [], ["cell"], "1-234-567-890"), + new TelephoneInfo(0, [], ["voice"], "078-494-6434"), + new TelephoneInfo(0, [], ["home"], "348-404-8404"), + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["work"], "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), + new AddressInfo(0, [], ["home"], "", "", "Street Address", "", "", "", ""), + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Title") - }, + ], ContactNotes = "Notes", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "neville.nvs@gmail.com"), - new EmailInfo(0, [], new string[] { "WORK" }, "neville.nvs@nvsc.com"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "ANDROID-CUSTOM", new string[] { "vnd.android.cursor.item/nickname", "NVL.N", "1", "", "", "", "", "", "", "", "", "", "", "", "", "" }, []), - }, - ContactImpps = new ImppInfo[] - { - new ImppInfo(0, [], "aim:IM", new string[] { "HOME" }), - new ImppInfo(0, [], "msn:Windows LIVE", new string[] { "HOME" }), - new ImppInfo(0, [], "ymsgr:Yahoo", new string[] { "HOME" }) - }, + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "neville.nvs@gmail.com"), + new EmailInfo(0, [], ["WORK"], "neville.nvs@nvsc.com"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "NVL.N", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), + ], + ContactImpps = + [ + new ImppInfo(0, [], "aim:IM", ["HOME"]), + new ImppInfo(0, [], "msn:Windows LIVE", ["HOME"]), + new ImppInfo(0, [], "ymsgr:Yahoo", ["HOME"]) + ], }; private static readonly Card multipleVcardFourContactsInstanceThree = new ( @@ -798,37 +798,37 @@ public static class ContactData "4.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Sarah", "Santos", [], [], []) - }, + ], ContactFullName = "Sarah Santos", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "cell" }, "589-210-1059") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "home" }, "", "", "New York, USA", "", "", "", "") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", new string[] { "WORK" }) - }, - ContactTitles = new TitleInfo[] - { + ContactTelephones = + [ + new TelephoneInfo(0, [], ["cell"], "589-210-1059") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["home"], "", "", "New York, USA", "", "", "", "") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", ["WORK"]) + ], + ContactTitles = + [ new TitleInfo(0, [], "Chief Executive Officer") - }, + ], ContactURL = "https://sso.org/", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "HOME" }, "sarah.s@gmail.com"), - new EmailInfo(0, [], new string[] { "WORK" }, "sarah.s@sso.org"), - }, - ContactXNames = new XNameInfo[] - { - new XNameInfo(0, [], "SIP-SIP", new string[] { "sip test" }, []), - }, + ContactMails = + [ + new EmailInfo(0, [], ["HOME"], "sarah.s@gmail.com"), + new EmailInfo(0, [], ["WORK"], "sarah.s@sso.org"), + ], + ContactXNames = + [ + new XNameInfo(0, [], "SIP-SIP", ["sip test"], []), + ], ContactBirthdate = new DateTime(1989, 2, 22), }; private static readonly Card multipleVcardFourContactsInstanceFour = singleVcardFourContactInstance; @@ -872,28 +872,28 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Derik", "Stenerson", [], [], []) - }, + ], ContactFullName = "Derik Stenerson", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "WORK", "MSG" }, "+1-425-936-5522"), - new TelephoneInfo(0, [], new string[] { "WORK", "FAX" }, "+1-425-936-7329") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "WORK", "POSTAL", "PARCEL" }, "", "", "One Microsoft Way", "Redmond", "WA", "98052-6399", "USA") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], "Microsoft Corporation", "", "", new string[] { "WORK" }) - }, - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "INTERNET" }, "deriks@Microsoft.com") - }, + ContactTelephones = + [ + new TelephoneInfo(0, [], ["WORK", "MSG"], "+1-425-936-5522"), + new TelephoneInfo(0, [], ["WORK", "FAX"], "+1-425-936-7329") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["WORK", "POSTAL", "PARCEL"], "", "", "One Microsoft Way", "Redmond", "WA", "98052-6399", "USA") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], "Microsoft Corporation", "", "", ["WORK"]) + ], + ContactMails = + [ + new EmailInfo(0, [], ["INTERNET"], "deriks@Microsoft.com") + ], ContactBirthdate = new DateTime(1963, 9, 21), }; private static readonly Card vcardThreeOldSampleInstanceTwo = new @@ -902,27 +902,27 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Anik", "Ganguly", [], [], []) - }, + ], ContactFullName = "Anik Ganguly", - ContactTelephones = new TelephoneInfo[] - { - new TelephoneInfo(0, [], new string[] { "WORK", "MSG" }, "+1-734-542-5955") - }, - ContactAddresses = new AddressInfo[] - { - new AddressInfo(0, [], new string[] { "WORK", "POSTAL", "PARCEL" }, "", "Suite 101", "38777 West Six Mile Road", "Livonia", "MI", "48152", "USA") - }, - ContactOrganizations = new OrganizationInfo[] - { - new OrganizationInfo(0, [], " Open Text Inc.", "", "", new string[] { "WORK" }) - }, - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "INTERNET" }, "ganguly@acm.org") - } + ContactTelephones = + [ + new TelephoneInfo(0, [], ["WORK", "MSG"], "+1-734-542-5955") + ], + ContactAddresses = + [ + new AddressInfo(0, [], ["WORK", "POSTAL", "PARCEL"], "", "Suite 101", "38777 West Six Mile Road", "Livonia", "MI", "48152", "USA") + ], + ContactOrganizations = + [ + new OrganizationInfo(0, [], " Open Text Inc.", "", "", ["WORK"]) + ], + ContactMails = + [ + new EmailInfo(0, [], ["INTERNET"], "ganguly@acm.org") + ] }; private static readonly Card vcardThreeOldSampleInstanceThree = new ( @@ -930,15 +930,15 @@ public static class ContactData "3.0" ) { - ContactNames = new NameInfo[] - { + ContactNames = + [ new NameInfo(0, [], "Robert", "Moskowitz", [], [], []) - }, + ], ContactFullName = "Robert Moskowitz", - ContactMails = new EmailInfo[] - { - new EmailInfo(0, [], new string[] { "INTERNET" }, "rgm-ietf@htt-consult.com") - } + ContactMails = + [ + new EmailInfo(0, [], ["INTERNET"], "rgm-ietf@htt-consult.com") + ] }; #endregion @@ -946,63 +946,63 @@ public static class ContactData /// Test VCard single contact contents (shorts) /// public static readonly string[] singleVcardContactShorts = - { + [ singleVcardTwoContactShort, singleVcardThreeContactShort, singleVcardFourContactShort, - }; + ]; /// /// Test VCard single contact contents /// public static readonly string[] singleVcardContacts = - { + [ singleVcardTwoContact, singleVcardThreeContact, singleVcardFourContact, - }; + ]; /// /// Test VCard multiple contact contents /// public static readonly string[] multipleVcardContacts = - { + [ multipleVcardTwoContacts, multipleVcardThreeContacts, multipleVcardFourContacts, - }; + ]; /// /// Test MeCard contacts /// public static readonly string[] meCardContacts = - { + [ singleMeCardContactShort, singleMeCardContact, - }; + ]; /// /// Test MeCard contacts /// public static readonly (string, string)[] vCardFromMeCardContacts = - { + [ (singleMeCardContactShort, singleVcardContactShortFromMeCard), (singleMeCardContact, singleVcardContactFromMeCard), - }; + ]; /// /// All the remaining valid contacts /// public static readonly string[] remainingContacts = - { + [ vcardThreeOldSample, - }; + ]; /// /// VCard instances for equality check /// public static readonly Card[] vCardContactsInstances = - { + [ singleVcardTwoContactShortInstance, singleVcardThreeContactShortInstance, singleVcardFourContactShortInstance, @@ -1026,6 +1026,6 @@ public static readonly (string, string)[] vCardFromMeCardContacts = vcardThreeOldSampleInstanceThree, singleVcardContactInstanceFromMeCard, singleVcardContactShortFromMeCardInstance, - }; + ]; } } diff --git a/VisualCard.Tests/ContactDataBogus.cs b/VisualCard.Tests/ContactDataBogus.cs index 1786fb6..bf05730 100644 --- a/VisualCard.Tests/ContactDataBogus.cs +++ b/VisualCard.Tests/ContactDataBogus.cs @@ -92,30 +92,30 @@ public static class ContactDataBogus /// function. /// public static readonly string[] invalidContacts = - { + [ vcardZeroByte, vcardNonexistentVersion, - }; + ]; /// /// All of the contacts in this field with invalid syntax or omitted requirements may be accepted by the /// function. /// public static readonly string[] seemsValidContacts = - { + [ vcardTwoNoFullName, - }; + ]; /// /// All of the contacts in this field should fail immediately upon calling . /// These usually resemble contacts with invalid syntax. /// public static readonly string[] invalidContactsParser = - { + [ vcardThreeNoFullName, vcardTwoBarren, vcardThreeBarren, vcardFourBarren, - }; + ]; } } diff --git a/VisualCard/Parsers/VcardParserTools.cs b/VisualCard/Parsers/VcardParserTools.cs index 141e177..c8d7e07 100644 --- a/VisualCard/Parsers/VcardParserTools.cs +++ b/VisualCard/Parsers/VcardParserTools.cs @@ -92,10 +92,10 @@ internal static string[] GetValues(string[] args, string @default, string argSpe internal static string[] SplitToKeyAndValueFromString(string line) { if (line.IndexOf(':') < 0) - return new[] { line, "" }; + return [line, ""]; string key = line.Substring(0, line.IndexOf(':')); string value = line.Substring(line.IndexOf(':')); - return new[] { key, value }; + return [key, value]; } internal static IEnumerable GetDigits(int num) diff --git a/VisualCard/Parts/AddressInfo.cs b/VisualCard/Parts/AddressInfo.cs index 0bc436f..a0b5169 100644 --- a/VisualCard/Parts/AddressInfo.cs +++ b/VisualCard/Parts/AddressInfo.cs @@ -192,7 +192,7 @@ internal static AddressInfo FromStringVcardTwo(string value) throw new InvalidDataException("Address information must specify exactly seven values (P.O. Box, extended address, street address, locality, region, postal code, and country)"); // Populate the fields - string[] _addressTypes = new string[] { "HOME" }; + string[] _addressTypes = ["HOME"]; string _addressPOBox = Regex.Unescape(splitAddressValues[0]); string _addressExtended = Regex.Unescape(splitAddressValues[1]); string _addressStreet = Regex.Unescape(splitAddressValues[2]); @@ -242,7 +242,7 @@ internal static AddressInfo FromStringVcardThree(string value) throw new InvalidDataException("Address information must specify exactly seven values (P.O. Box, extended address, street address, locality, region, postal code, and country)"); // Populate the fields - string[] _addressTypes = new string[] { "HOME" }; + string[] _addressTypes = ["HOME"]; string _addressPOBox = Regex.Unescape(splitAddressValues[0]); string _addressExtended = Regex.Unescape(splitAddressValues[1]); string _addressStreet = Regex.Unescape(splitAddressValues[2]); @@ -292,7 +292,7 @@ internal static AddressInfo FromStringVcardFour(string value, int altId) throw new InvalidDataException("Address information must specify exactly seven values (P.O. Box, extended address, street address, locality, region, postal code, and country)"); // Populate the fields - string[] _addressTypes = new string[] { "HOME" }; + string[] _addressTypes = ["HOME"]; string _addressPOBox = Regex.Unescape(splitAddressValues[0]); string _addressExtended = Regex.Unescape(splitAddressValues[1]); string _addressStreet = Regex.Unescape(splitAddressValues[2]); diff --git a/VisualCard/Parts/EmailInfo.cs b/VisualCard/Parts/EmailInfo.cs index 488bba2..999f53e 100644 --- a/VisualCard/Parts/EmailInfo.cs +++ b/VisualCard/Parts/EmailInfo.cs @@ -143,7 +143,7 @@ internal static EmailInfo FromStringVcardTwo(string value) } // Populate the fields - string[] _emailTypes = new string[] { "HOME" }; + string[] _emailTypes = ["HOME"]; string _emailAddress = mail.Address; EmailInfo _email = new(0, [], _emailTypes, _emailAddress); return _email; @@ -193,7 +193,7 @@ internal static EmailInfo FromStringVcardThree(string value) } // Populate the fields - string[] _emailTypes = new string[] { "HOME" }; + string[] _emailTypes = ["HOME"]; string _emailAddress = mail.Address; EmailInfo _email = new(0, [], _emailTypes, _emailAddress); return _email; @@ -243,7 +243,7 @@ internal static EmailInfo FromStringVcardFour(string value, int altId) } // Populate the fields - string[] _emailTypes = new string[] { "HOME" }; + string[] _emailTypes = ["HOME"]; string _emailAddress = mail.Address; EmailInfo _email = new(altId, [], _emailTypes, _emailAddress); return _email; diff --git a/VisualCard/Parts/GeoInfo.cs b/VisualCard/Parts/GeoInfo.cs index adc74cb..736086f 100644 --- a/VisualCard/Parts/GeoInfo.cs +++ b/VisualCard/Parts/GeoInfo.cs @@ -154,7 +154,7 @@ internal static GeoInfo FromStringVcardThree(string value) string geoValue = value.Substring(VcardConstants._geoSpecifier.Length + 1); // Populate the fields - string[] _geoTypes = new string[] { "uri" }; + string[] _geoTypes = ["uri"]; string _geoNumber = Regex.Unescape(geoValue); GeoInfo _geo = new(0, [], _geoTypes, _geoNumber); return _geo; @@ -183,7 +183,7 @@ internal static GeoInfo FromStringVcardFour(string value, int altId) string geoValue = value.Substring(VcardConstants._geoSpecifier.Length + 1); // Populate the fields - string[] _geoTypes = new string[] { "uri" }; + string[] _geoTypes = ["uri"]; string _geoNumber = Regex.Unescape(geoValue); GeoInfo _geo = new(altId, [], _geoTypes, _geoNumber); return _geo; diff --git a/VisualCard/Parts/ImppInfo.cs b/VisualCard/Parts/ImppInfo.cs index c792072..e6a201a 100644 --- a/VisualCard/Parts/ImppInfo.cs +++ b/VisualCard/Parts/ImppInfo.cs @@ -132,7 +132,7 @@ internal string ToStringVcardFour() internal static ImppInfo FromStringVcardTwo(string value) { string imppValue = value.Substring(VcardConstants._imppSpecifier.Length + 1); - string[] _imppTypes = new string[] { "HOME" }; + string[] _imppTypes = ["HOME"]; string _impp = Regex.Unescape(imppValue); ImppInfo _imppInstance = new(0, [], _impp, _imppTypes); return _imppInstance; @@ -158,7 +158,7 @@ internal static ImppInfo FromStringVcardThree(string value) string imppValue = value.Substring(VcardConstants._imppSpecifier.Length + 1); // Populate the fields - string[] _imppTypes = new string[] { "HOME" }; + string[] _imppTypes = ["HOME"]; string _impp = Regex.Unescape(imppValue); ImppInfo _imppInstance = new(0, [], _impp, _imppTypes); return _imppInstance; @@ -185,7 +185,7 @@ internal static ImppInfo FromStringVcardFour(string value, int altId) string imppValue = value.Substring(VcardConstants._imppSpecifier.Length + 1); // Populate the fields - string[] _imppTypes = new string[] { "HOME" }; + string[] _imppTypes = ["HOME"]; string _impp = Regex.Unescape(imppValue); ImppInfo _imppInstance = new(altId, [], _impp, _imppTypes); return _imppInstance; diff --git a/VisualCard/Parts/LabelAddressInfo.cs b/VisualCard/Parts/LabelAddressInfo.cs index 167fde9..34c2346 100644 --- a/VisualCard/Parts/LabelAddressInfo.cs +++ b/VisualCard/Parts/LabelAddressInfo.cs @@ -128,7 +128,7 @@ internal static LabelAddressInfo FromStringVcardTwo(string value) throw new InvalidDataException("Label address information must specify exactly one value (address label)"); // Populate the fields - string[] _addressTypes = new string[] { "HOME" }; + string[] _addressTypes = ["HOME"]; string _addressLabel = Regex.Unescape(splitAddressValues[0]); LabelAddressInfo _address = new(0, [], _addressTypes, _addressLabel); return _address; @@ -166,7 +166,7 @@ internal static LabelAddressInfo FromStringVcardThree(string value) throw new InvalidDataException("Label address information must specify exactly one value (address label)"); // Populate the fields - string[] _addressTypes = new string[] { "HOME" }; + string[] _addressTypes = ["HOME"]; string _addressLabel = Regex.Unescape(splitAddressValues[0]); LabelAddressInfo _address = new(0, [], _addressTypes, _addressLabel); return _address; diff --git a/VisualCard/Parts/NicknameInfo.cs b/VisualCard/Parts/NicknameInfo.cs index 5ad02a6..bd09d46 100644 --- a/VisualCard/Parts/NicknameInfo.cs +++ b/VisualCard/Parts/NicknameInfo.cs @@ -130,7 +130,7 @@ internal static NicknameInfo FromStringVcardThree(string value) string nickValue = value.Substring(VcardConstants._nicknameSpecifier.Length + 1); // Populate the fields - string[] _nicknameTypes = new string[] { "HOME" }; + string[] _nicknameTypes = ["HOME"]; string _nick = Regex.Unescape(nickValue); NicknameInfo _nickInstance = new(0, [], _nick, _nicknameTypes); return _nickInstance; @@ -157,7 +157,7 @@ internal static NicknameInfo FromStringVcardFour(string value, int altId) string nickValue = value.Substring(VcardConstants._nicknameSpecifier.Length + 1); // Populate the fields - string[] _nicknameTypes = new string[] { "HOME" }; + string[] _nicknameTypes = ["HOME"]; string _nick = Regex.Unescape(nickValue); NicknameInfo _nickInstance = new(altId, [], _nick, _nicknameTypes); return _nickInstance; diff --git a/VisualCard/Parts/OrganizationInfo.cs b/VisualCard/Parts/OrganizationInfo.cs index 19b954f..f16e669 100644 --- a/VisualCard/Parts/OrganizationInfo.cs +++ b/VisualCard/Parts/OrganizationInfo.cs @@ -154,7 +154,7 @@ internal static OrganizationInfo FromStringVcardTwo(string value) string[] splitOrg = orgValue.Split(VcardConstants._fieldDelimiter); // Populate the fields - string[] splitTypes = new string[] { "WORK" }; + string[] splitTypes = ["WORK"]; string _orgName = Regex.Unescape(splitOrg[0]); string _orgUnit = Regex.Unescape(splitOrg.Length >= 2 ? splitOrg[1] : ""); string _orgUnitRole = Regex.Unescape(splitOrg.Length >= 3 ? splitOrg[2] : ""); @@ -191,7 +191,7 @@ internal static OrganizationInfo FromStringVcardThree(string value) string[] splitOrg = orgValue.Split(VcardConstants._fieldDelimiter); // Populate the fields - string[] splitTypes = new string[] { "WORK" }; + string[] splitTypes = ["WORK"]; string _orgName = Regex.Unescape(splitOrg[0]); string _orgUnit = Regex.Unescape(splitOrg.Length >= 2 ? splitOrg[1] : ""); string _orgUnitRole = Regex.Unescape(splitOrg.Length >= 3 ? splitOrg[2] : ""); @@ -228,7 +228,7 @@ internal static OrganizationInfo FromStringVcardFour(string value, int altId) string[] splitOrg = orgValue.Split(VcardConstants._fieldDelimiter); // Populate the fields - string[] splitTypes = new string[] { "WORK" }; + string[] splitTypes = ["WORK"]; string _orgName = Regex.Unescape(splitOrg[0]); string _orgUnit = Regex.Unescape(splitOrg.Length >= 2 ? splitOrg[1] : ""); string _orgUnitRole = Regex.Unescape(splitOrg.Length >= 3 ? splitOrg[2] : ""); diff --git a/VisualCard/Parts/TelephoneInfo.cs b/VisualCard/Parts/TelephoneInfo.cs index f2f5898..5d3fd91 100644 --- a/VisualCard/Parts/TelephoneInfo.cs +++ b/VisualCard/Parts/TelephoneInfo.cs @@ -132,7 +132,7 @@ internal static TelephoneInfo FromStringVcardTwo(string value) string telValue = value.Substring(VcardConstants._telephoneSpecifier.Length + 1); // Populate the fields - string[] _telephoneTypes = new string[] { "CELL" }; + string[] _telephoneTypes = ["CELL"]; string _telephoneNumber = Regex.Unescape(telValue); TelephoneInfo _telephone = new(0, [], _telephoneTypes, _telephoneNumber); return _telephone; @@ -159,7 +159,7 @@ internal static TelephoneInfo FromStringVcardThree(string value) string telValue = value.Substring(VcardConstants._telephoneSpecifier.Length + 1); // Populate the fields - string[] _telephoneTypes = new string[] { "CELL" }; + string[] _telephoneTypes = ["CELL"]; string _telephoneNumber = Regex.Unescape(telValue); TelephoneInfo _telephone = new(0, [], _telephoneTypes, _telephoneNumber); return _telephone; @@ -186,7 +186,7 @@ internal static TelephoneInfo FromStringVcardFour(string value, int altId) string telValue = value.Substring(VcardConstants._telephoneSpecifier.Length + 1); // Populate the fields - string[] _telephoneTypes = new string[] { "CELL" }; + string[] _telephoneTypes = ["CELL"]; string _telephoneNumber = Regex.Unescape(telValue); TelephoneInfo _telephone = new(altId, [], _telephoneTypes, _telephoneNumber); return _telephone; diff --git a/VisualCard/Parts/TimeZoneInfo.cs b/VisualCard/Parts/TimeZoneInfo.cs index c603e59..2b7d07d 100644 --- a/VisualCard/Parts/TimeZoneInfo.cs +++ b/VisualCard/Parts/TimeZoneInfo.cs @@ -154,7 +154,7 @@ internal static TimeZoneInfo FromStringVcardThree(string value) string tzValue = value.Substring(VcardConstants._timeZoneSpecifier.Length + 1); // Populate the fields - string[] _timeZoneTypes = new string[] { "uri-offset" }; + string[] _timeZoneTypes = ["uri-offset"]; string _timeZoneNumber = Regex.Unescape(tzValue); TimeZoneInfo _timeZone = new(0, [], _timeZoneTypes, _timeZoneNumber); return _timeZone; @@ -183,7 +183,7 @@ internal static TimeZoneInfo FromStringVcardFour(string value, int altId) string tzValue = value.Substring(VcardConstants._timeZoneSpecifier.Length + 1); // Populate the fields - string[] _timeZoneTypes = new string[] { "uri-offset" }; + string[] _timeZoneTypes = ["uri-offset"]; string _timeZoneNumber = Regex.Unescape(tzValue); TimeZoneInfo _timeZone = new(altId, [], _timeZoneTypes, _timeZoneNumber); return _timeZone;