Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/UniGetUI.Core.IconEngine.Tests/IconCacheEngineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ namespace UniGetUI.Core.IconEngine.Tests
{
public static class IconCacheEngineTests
{
private const string UniGetUiIconUrl =
"https://raw.githubusercontent.com/Devolutions/UniGetUI/main/src/UniGetUI.Core.IconEngine.Tests/TestData/unigetui.png";

private const string ElevenClockIconUrl =
"https://raw.githubusercontent.com/Devolutions/UniGetUI/main/src/UniGetUI.Core.IconEngine.Tests/TestData/elevenclock.png";

[Fact]
public static void TestCacheEngineForSha256()
{
Uri ICON_1 = new Uri("https://marticliment.com/resources/unigetui.png");
Uri ICON_1 = new Uri(UniGetUiIconUrl);
byte[] HASH_1 =
[
0xB7,
Expand Down Expand Up @@ -43,7 +49,7 @@ public static void TestCacheEngineForSha256()
0xAF,
0xFF,
];
Uri ICON_2 = new Uri("https://marticliment.com/resources/elevenclock.png");
Uri ICON_2 = new Uri(ElevenClockIconUrl);
byte[] HASH_2 =
[
0x9E,
Expand Down Expand Up @@ -134,7 +140,7 @@ public static void TestCacheEngineForSha256()
[Fact]
public static void TestCacheEngineForPackageVersion()
{
Uri URI = new Uri("https://marticliment.com/resources/unigetui.png");
Uri URI = new Uri(UniGetUiIconUrl);
string VERSION = "v3.01";
string MANAGER_NAME = "TestManager";
string PACKAGE_ID = "Package2";
Expand Down Expand Up @@ -189,8 +195,8 @@ public static void TestCacheEngineForPackageVersion()
[Fact]
public static void TestCacheEngineForIconUri()
{
Uri URI_1 = new Uri("https://marticliment.com/resources/unigetui.png");
Uri URI_2 = new Uri("https://marticliment.com/resources/elevenclock.png");
Uri URI_1 = new Uri(UniGetUiIconUrl);
Uri URI_2 = new Uri(ElevenClockIconUrl);
string managerName = "TestManager";
string packageId = "Package12";

Expand Down Expand Up @@ -239,9 +245,9 @@ public static void TestCacheEngineForIconUri()
[Fact]
public static void TestCacheEngineForPackageSize()
{
Uri ICON_1 = new Uri("https://marticliment.com/resources/unigetui.png");
Uri ICON_1 = new Uri(UniGetUiIconUrl);
int ICON_1_SIZE = 19788;
Uri ICON_2 = new Uri("https://marticliment.com/resources/elevenclock.png");
Uri ICON_2 = new Uri(ElevenClockIconUrl);
int ICON_2_SIZE = 19747;
string managerName = "TestManager";
string packageId = "Package3";
Expand Down
2 changes: 1 addition & 1 deletion src/UniGetUI.Core.Tools.Tests/ToolsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void TestRandomStringGenerator(int length)
"https://invalid.url.com/this/is/an/invalid.php?file=to_test&if=the&code_returns=zero",
0
)]
[InlineData("https://marticliment.com/resources/unigetui.png", 19788)]
[InlineData("https://raw.githubusercontent.com/Devolutions/UniGetUI/main/src/UniGetUI.Core.IconEngine.Tests/TestData/unigetui.png", 19788)]
public async Task TestFileSizeLoader(string uri, long expectedSize)
{
long size = await CoreTools.GetFileSizeAsLongAsync(uri != "" ? new Uri(uri) : null);
Expand Down
Loading