private void CheckSocialProfile(vCardSocialProfileCollection sps, string username, string url, SocialProfileServiceType serviceType) { if (sps == null || sps.Count == 0) { Assert.Fail("sps null or empty"); } var sp = sps.FirstOrDefault(x => x.Username == username && x.ServiceType == serviceType); Assert.IsNotNull(sp, "no match for socialProfile for " + username + " for serviceType " + serviceType.ToString()); Assert.AreEqual(url, sp.ProfileUrl); Assert.AreEqual(username, sp.Username); Assert.AreEqual(serviceType, sp.ServiceType); }
/// <summary> /// Initializes a new instance of the <see cref="vCard"/> class. /// </summary> public vCard() { // Per Microsoft best practices, string properties should // never return null. String properties should always // return String.Empty. this.additionalNames = string.Empty; this.department = string.Empty; this.displayName = string.Empty; this.familyName = string.Empty; this.formattedName = string.Empty; this.givenName = string.Empty; this.mailer = string.Empty; this.namePrefix = string.Empty; this.nameSuffix = string.Empty; this.office = string.Empty; this.organization = string.Empty; this.productId = string.Empty; this.role = string.Empty; this.timeZone = string.Empty; this.title = string.Empty; this.uniqueId = string.Empty; this.assistant = string.Empty; this.spouse = string.Empty; this.manager = string.Empty; this.categories = new StringCollection(); this.certificates = new vCardCertificateCollection(); this.deliveryAddresses = new vCardDeliveryAddressCollection(); this.deliveryLabels = new vCardDeliveryLabelCollection(); this.emailAddresses = new vCardEmailAddressCollection(); this.nicknames = new StringCollection(); this.notes = new vCardNoteCollection(); this.phones = new vCardPhoneCollection(); this.photos = new vCardPhotoCollection(); this.sources = new vCardSourceCollection(); this.websites = new vCardWebsiteCollection(); this.ims = new vCardIMPPCollection(); this.sps = new vCardSocialProfileCollection(); this.members = new vCardMemberCollection(); this.otherProperties = new vCardPropertyCollection(); }
/// <summary> /// Initializes a new instance of the <see cref="vCard"/> class. /// </summary> public vCard() { // Per Microsoft best practices, string properties should // never return null. String properties should always // return String.Empty. this.additionalNames = string.Empty; this.department = string.Empty; this.displayName = string.Empty; this.familyName = string.Empty; this.formattedName = string.Empty; this.givenName = string.Empty; this.mailer = string.Empty; this.namePrefix = string.Empty; this.nameSuffix = string.Empty; this.office = string.Empty; this.organization = string.Empty; this.productId = string.Empty; this.role = string.Empty; this.timeZone = string.Empty; this.title = string.Empty; this.uniqueId = string.Empty; this.categories = new StringCollection(); this.certificates = new vCardCertificateCollection(); this.deliveryAddresses = new vCardDeliveryAddressCollection(); this.deliveryLabels = new vCardDeliveryLabelCollection(); this.emailAddresses = new vCardEmailAddressCollection(); this.nicknames = new StringCollection(); this.notes = new vCardNoteCollection(); this.phones = new vCardPhoneCollection(); this.photos = new vCardPhotoCollection(); this.sources = new vCardSourceCollection(); this.websites = new vCardWebsiteCollection(); this.ims = new vCardIMPPCollection(); this.sps = new vCardSocialProfileCollection(); }
CheckPhone(c.Phones, "(333) 222-2222", vCardPhoneTypes.Home | vCardPhoneTypes.Voice, false); CheckPhone(c.Phones, "(809) 555-6666 x444", vCardPhoneTypes.Work | vCardPhoneTypes.Voice, false); CheckPhone(c.Phones, "(609) 888-7777", vCardPhoneTypes.Main, false); CheckPhone(c.Phones, "(555) 444-4443", vCardPhoneTypes.Home | vCardPhoneTypes.Fax, false); CheckPhone(c.Phones, "33322222222", vCardPhoneTypes.Work | vCardPhoneTypes.Fax, false); CheckPhone(c.Phones, "(999) 777-7999", vCardPhoneTypes.Default, false); //phones and emails are good //need to check the physical address parsing and on down CheckAddress(c.DeliveryAddresses, "8230 Boone Blvd", "Vinna", "VA", "22182", "United States", vCardDeliveryAddressTypes.Home | vCardDeliveryAddressTypes.Preferred, true); CheckIM(c.IMs, "skypeusernameee", IMServiceType.Skype, ItemType.HOME, true); CheckIM(c.IMs, "worksyokeusername", IMServiceType.Skype, ItemType.WORK, false); CheckIM(c.IMs, "msnname", IMServiceType.MSN, ItemType.UNSPECIFIED, false); CheckIM(c.IMs, "aolname", IMServiceType.AIM, ItemType.UNSPECIFIED, false);