public static string Serialize(VCard vcard) { var builder = new StringBuilder(); builder.Append(VersionProcessor.Serialize(vcard)); builder.Append(FormattedNameProcessor.Serialize(vcard)); builder.Append(NameProcessor.Serialize(vcard)); builder.Append(BirthDayProcessor.Serialize(vcard)); builder.Append(MailerProcessor.Serialize(vcard)); builder.Append(TitleProcessor.Serialize(vcard)); builder.Append(RoleProcessor.Serialize(vcard)); builder.Append(TimeZoneInfoProcessor.Serialize(vcard)); builder.Append(LogoProcessor.Serialize(vcard)); builder.Append(PhotoProcessor.Serialize(vcard)); builder.Append(NoteProcessor.Serialize(vcard)); builder.Append(LastRevisionProcessor.Serialize(vcard)); builder.Append(UrlProcessor.Serialize(vcard)); builder.Append(UidProcessor.Serialize(vcard)); builder.Append(OrganizationProcessor.Serialize(vcard)); builder.Append(GeographyProcessor.Serialize(vcard)); builder.Append(AddressesProcessor.Serialize(vcard)); builder.Append(DeliveryAddressProcessor.Serialize(vcard)); builder.Append(TelephonesProcessor.Serialize(vcard)); builder.Append(EmailsProcessor.Serialize(vcard)); builder.Append(ExtensionsProcessor.Serialize(vcard)); return(builder.ToString()); }
private static Int32 GetObjectID(String url, data.FeedItemType feedItemType) { switch (feedItemType) { case data.FeedItemType.WallComment: return(data.Member.GetMemberViaNickname(UrlProcessor.ExtractWallName(url)).MemberID); case data.FeedItemType.Video: case data.FeedItemType.BookmarkedVideo: return(data.Video.GetVideoByWebVideoIDWithJoin(UrlProcessor.ExtractWebVideoID(url)).VideoID); case data.FeedItemType.Photo: return(data.PhotoCollection.GetPhotoCollectionByWebPhotoCollectionID(UrlProcessor.ExtractWebPhotoCollectionID(url)).PhotoCollectionID); case data.FeedItemType.BookmarkedPhoto: return(data.Photo.GetPhotoByWebPhotoIDWithJoin(UrlProcessor.ExtractWebPhotoID(url)).PhotoID); case data.FeedItemType.Ask: return(data.AskAFriend.GetAskAFriendByWebAskAFriendID(UrlProcessor.ExtractWebAskID(url)).AskAFriendID); case data.FeedItemType.Blog: return(data.BlogEntry.GetBlogEntryByWebBlogEntryID(UrlProcessor.ExtractWebBlogEntryID(url)).BlogEntryID); default: return(0); } }
public void ExtractWebPhotoIDTest() { Assert.AreEqual("YTRjODRi", UrlProcessor.ExtractWebPhotoID("/gallery/?g=MGY1MWY3&m=NDMxZjA4YTAwOWQ1NDNlOD&wp=YTRjODRi")); }
public void ExtractWebVideoIDTest() { Assert.AreEqual("YjgwMmI4", UrlProcessor.ExtractWebVideoID("/video/pork-and-beans/YjgwMmI4")); Assert.AreEqual("NjczZTRiN2U5MWUyNGFkYm", UrlProcessor.ExtractWebVideoID("/video/lawrence/NjczZTRiN2U5MWUyNGFkYm")); Assert.AreEqual("OTJmN2ZhNWE5OGQ0NGM1OD", UrlProcessor.ExtractWebVideoID("/video/london/OTJmN2ZhNWE5OGQ0NGM1OD")); }
public void ExtractWebPhotoCollectionIDTest() { Assert.AreEqual("YTRjODRi", UrlProcessor.ExtractWebPhotoCollectionID("/gallery/?g=YTRjODRi&m=MWI5OWQ1YmJjYjY5NDEwNm")); }
public void ExtractWebAskIDTest() { Assert.AreEqual("MzBhY2Fl", UrlProcessor.ExtractWebAskID("/ask/MzBhY2Fl")); }
public void ExtractWallNameTest() { Assert.AreEqual("shelton", UrlProcessor.ExtractWallName("/users/shelton/wall")); }
public void Encode_Normal_100() { Assert.AreEqual("bM", UrlProcessor.Encode(100)); }
public void ExtractWebBlogEntryIDTest() { Assert.AreEqual("Yzc4MTk1", UrlProcessor.ExtractWebBlogEntryID("/blog.aspx?m=Y2ZjNDIzMDdiZDE1NDQxM2&b=Yzc4MTk1")); Assert.AreEqual("Mjk5NmU4", UrlProcessor.ExtractWebBlogEntryID("/blog.aspx?m=ZTZlNzE3Y2UzM2U1NGM5OD&b=Mjk5NmU4")); }
public void Decode_Empty() { UrlProcessor.Decode(""); }
public void Decode_Normal_521431() { Assert.AreEqual(521431, UrlProcessor.Decode("clOl")); }
public void Decode_Normal_100() { Assert.AreEqual(100, UrlProcessor.Decode("bM")); }
public void Encode_Normal_521431() { Assert.AreEqual("clOl", UrlProcessor.Encode(521431)); }
public void Encode_NegativeNumber() { string result = UrlProcessor.Encode(-5); }