public async Task NotMatchTest() { var service = new TestImgAzyobuziNet(); var thumbinfo = await service.GetThumbnailInfoAsync("http://hogehoge.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task Enabled_FalseTest() { var service = new TestImgAzyobuziNet(); service.Enabled = false; var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task MatchTest() { var service = new TestImgAzyobuziNet(); var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.NotNull(thumbinfo); Assert.Equal("http://example.com/abcd", thumbinfo.MediaPageUrl); Assert.Equal("http://img.azyobuzi.net/api/redirect?size=large&uri=http%3A%2F%2Fexample.com%2Fabcd", thumbinfo.ThumbnailImageUrl); Assert.Null(thumbinfo.TooltipText); }
public async Task ServerOutageTest() { var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" }); await service.LoadRegexAsync(); Assert.Null(service.GetApiBase()); var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task DisabledInDM_Test() { var service = new TestImgAzyobuziNet(); service.DisabledInDM = true; var post = new PostClass { TextFromApi = "http://example.com/abcd", IsDm = true, }; var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", post, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task Enabled_FalseTest() { var service = new TestImgAzyobuziNet(); service.Enabled = false; var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task DisabledInDM_Test() { var service = new TestImgAzyobuziNet(); service.DisabledInDM = true; var post = new PostClass { TextFromApi = "http://example.com/abcd", IsDm = true, }; var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", post, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task NotMatchTest() { var service = new TestImgAzyobuziNet(); var thumbinfo = await service.GetThumbnailInfoAsync("http://hogehoge.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }
public async Task MatchTest() { var service = new TestImgAzyobuziNet(); var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.NotNull(thumbinfo); Assert.Equal("http://example.com/abcd", thumbinfo.ImageUrl); Assert.Equal("http://img.azyobuzi.net/api/redirect?size=large&uri=http%3A%2F%2Fexample.com%2Fabcd", thumbinfo.ThumbnailUrl); Assert.Null(thumbinfo.TooltipText); }
public async Task ServerOutageTest() { var service = new TestImgAzyobuziNet(new[] { "http://down.example.com/api/" }); await service.LoadRegexAsync(); Assert.Null(service.GetApiBase()); var thumbinfo = await service.GetThumbnailInfoAsync("http://example.com/abcd", null, CancellationToken.None); Assert.Null(thumbinfo); }