using System.Threading;
using System.Threading.Tasks;
using Moq;
+using OpenTween.Models;
using Xunit;
using Xunit.Extensions;
{
class TestMetaThumbnailService : MetaThumbnailService
{
- public string FakeHtml { get; set; }
+ public string FakeHtml { get; set; } = "";
public TestMetaThumbnailService(string urlPattern)
: base(null, urlPattern)
</body>
</html>
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.NotNull(thumbinfo);
- Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl);
+ Assert.Equal("http://example.com/abcd", thumbinfo!.MediaPageUrl);
Assert.Equal("http://img.example.com/abcd", thumbinfo.ThumbnailImageUrl);
Assert.Null(thumbinfo.TooltipText);
}
<p>hogehoge
";
- var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None);
+ var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", new PostClass(), CancellationToken.None);
Assert.Null(thumbinfo);
}