public void CreateAccessibleText_QuotedUrlWithPermelinkTest() { var text = "hoge"; var entities = new TwitterEntities(); var quotedStatus = new TwitterStatus { Id = 1234567890L, IdStr = "1234567890", User = new TwitterUser { Id = 1111, IdStr = "1111", ScreenName = "foo", }, FullText = "test", }; var quotedStatusLink = new TwitterQuotedStatusPermalink { Url = "https://t.co/hoge", Display = "twitter.com/hoge/status/1…", Expanded = "https://twitter.com/hoge/status/1234567890", }; var expectedText = "hoge " + string.Format(Properties.Resources.QuoteStatus_AccessibleText, "foo", "test"); Assert.Equal(expectedText, Twitter.CreateAccessibleText(text, entities, quotedStatus, quotedStatusLink)); }
public void CreateHtmlAnchor_QuotedUrlWithPermelinkTest() { var text = "hoge"; var entities = new TwitterEntities(); var quotedStatus = new TwitterStatus { Id = 1234567890L, IdStr = "1234567890", User = new TwitterUser { Id = 1111, IdStr = "1111", ScreenName = "foo", }, FullText = "test", }; var quotedStatusLink = new TwitterQuotedStatusPermalink { Url = "https://t.co/hoge", Display = "twitter.com/hoge/status/1…", Expanded = "https://twitter.com/hoge/status/1234567890", }; var expectedHtml = @"hoge" + @" <a href=""https://t.co/hoge"" title=""https://t.co/hoge"">twitter.com/hoge/status/1…</a>"; Assert.Equal(expectedHtml, Twitter.CreateHtmlAnchor(text, entities, quotedStatusLink)); }
public void GetQuoteTweetStatusIds_QuotedStatusLinkTest() { var entities = new TwitterEntities(); var quotedStatusLink = new TwitterQuotedStatusPermalink { Url = "https://t.co/3HXq0LrbJb", Expanded = "https://twitter.com/kim_upsilon/status/599261132361072640", }; var statusIds = Twitter.GetQuoteTweetStatusIds(entities, quotedStatusLink); Assert.Equal(new[] { 599261132361072640L }, statusIds); }