mirror of
https://github.com/bitwarden/server.git
synced 2024-12-10 15:13:29 +01:00
b42ebe6f1b
* Updated test domain from ameritrade.com to tdameritrade.com to fix failing test * Added a skip attribute
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using Bit.Icons.Services;
|
|
using Xunit;
|
|
|
|
namespace Bit.Icons.Test.Services;
|
|
|
|
public class IconFetchingServiceTests : ServiceTestBase<IconFetchingService>
|
|
{
|
|
[Theory(Skip = "Run ad-hoc")]
|
|
[InlineData("www.twitter.com")] // https site
|
|
[InlineData("www.google.com")] // https site
|
|
[InlineData("neverssl.com")] // http site
|
|
[InlineData("neopets.com")] // uses favicon.ico
|
|
[InlineData("hopin.com")] // uses svg+xml format
|
|
[InlineData("tdameritrade.com")]
|
|
[InlineData("icloud.com")]
|
|
public async Task GetIconAsync_Success(string domain)
|
|
{
|
|
var sut = BuildSut();
|
|
var result = await sut.GetIconAsync(domain);
|
|
|
|
Assert.NotNull(result);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("1.1.1.1")]
|
|
[InlineData("")]
|
|
[InlineData("localhost")]
|
|
public async Task GetIconAsync_ReturnsNull(string domain)
|
|
{
|
|
var sut = BuildSut();
|
|
var result = await sut.GetIconAsync(domain);
|
|
|
|
Assert.Null(result);
|
|
}
|
|
|
|
private IconFetchingService BuildSut() =>
|
|
GetService<IconFetchingService>();
|
|
}
|