OpenTween.ShortUrl.ExpandUrlHtmlAsync C# (CSharp) Метод

ExpandUrlHtmlAsync() публичный Метод

HTML内に含まれるリンクのURLを非同期に展開する
public ExpandUrlHtmlAsync ( string html ) : Task
html string 処理対象のHTML
Результат Task
        public Task<string> ExpandUrlHtmlAsync(string html)
        {
            return this.ExpandUrlHtmlAsync(html, 10);
        }

Same methods

ShortUrl::ExpandUrlHtmlAsync ( string html, int redirectLimit ) : Task

Usage Example

Пример #1
0
        public async Task ExpandUrlHtmlAsync_RelativeUriTest()
        {
            var handler = new HttpMessageHandlerMock();

            using (var http = new HttpClient(handler))
            {
                var shortUrl = new ShortUrl(http);

                handler.Enqueue(x =>
                {
                    // リクエストは送信されないはず
                    Assert.True(false);
                    return(this.CreateRedirectResponse("http://example.com/hoge"));
                });

                Assert.Equal("<a href=\"./hoge\">hogehoge</a>",
                             await shortUrl.ExpandUrlHtmlAsync("<a href=\"./hoge\">hogehoge</a>"));

                Assert.Equal(1, handler.QueueCount);
            }
        }
All Usage Examples Of OpenTween.ShortUrl::ExpandUrlHtmlAsync