1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
bitwarden-server/test/Icons.Test/Services/IconFetchingServiceTests.cs
Conner Turnbull b42ebe6f1b
Fix Broken Icon Unit Test (#4151)
* Updated test domain from ameritrade.com to tdameritrade.com to fix failing test

* Added a skip attribute
2024-06-03 09:58:53 -04:00

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>();
}