diff --git a/UnitystationLauncher.Tests/MocksRepository/InstallationService/MockNoActiveDownloads.cs b/UnitystationLauncher.Tests/MocksRepository/InstallationService/MockNoActiveDownloads.cs index 37913dd8..8bc1b538 100644 --- a/UnitystationLauncher.Tests/MocksRepository/InstallationService/MockNoActiveDownloads.cs +++ b/UnitystationLauncher.Tests/MocksRepository/InstallationService/MockNoActiveDownloads.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using UnitystationLauncher.Models; using UnitystationLauncher.Models.Api; using UnitystationLauncher.Services.Interface; @@ -22,7 +23,7 @@ public List GetInstallations() return null; } - public (Download?, string) DownloadInstallation(Server server) + public Task<(Download?, string)> DownloadInstallationAsync(Server server) { throw new NotImplementedException(); } diff --git a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingReturnsNull.cs b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingReturnsNull.cs index d663586b..3b78a109 100644 --- a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingReturnsNull.cs +++ b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingReturnsNull.cs @@ -6,7 +6,7 @@ namespace UnitystationLauncher.Tests.MocksRepository.PingService; public class MockPingReturnsNull : IPingService { - public Task GetPing(Server server) + public Task GetPingAsync(Server server) { return Task.FromResult(null as string)!; } diff --git a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingStaticPingTime.cs b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingStaticPingTime.cs index e53b7133..9b510e7a 100644 --- a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingStaticPingTime.cs +++ b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingStaticPingTime.cs @@ -12,7 +12,7 @@ public MockPingStaticPingTime(int pingInMilliseconds) { _pingTime = $"{pingInMilliseconds}ms"; } - public Task GetPing(Server server) + public Task GetPingAsync(Server server) { return Task.FromResult(_pingTime); } diff --git a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingThrowsException.cs b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingThrowsException.cs index 16df33c8..af3017b2 100644 --- a/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingThrowsException.cs +++ b/UnitystationLauncher.Tests/MocksRepository/PingService/MockPingThrowsException.cs @@ -6,7 +6,7 @@ namespace UnitystationLauncher.Tests.MocksRepository.PingService; public class MockPingThrowsException : IPingService { - public Task GetPing(Server server) + public Task GetPingAsync(Server server) { throw new(); } diff --git a/UnitystationLauncher/Constants/ApiUrls.cs b/UnitystationLauncher/Constants/ApiUrls.cs index b45dac1c..30ca5437 100644 --- a/UnitystationLauncher/Constants/ApiUrls.cs +++ b/UnitystationLauncher/Constants/ApiUrls.cs @@ -2,20 +2,20 @@ namespace UnitystationLauncher.Constants; public static class ApiUrls { - private const string ApiBaseUrl = "https://api.unitystation.org"; - public const string ServerListUrl = $"{ApiBaseUrl}/serverlist"; - public const string ValidateUrl = $"{ApiBaseUrl}/validatehubclient"; - public const string ValidateTokenUrl = $"{ApiBaseUrl}/validatetoken?data="; - public const string SignOutUrl = $"{ApiBaseUrl}/signout?data="; + private static string ApiBaseUrl => "https://api.unitystation.org"; + public static string ServerListUrl => $"{ApiBaseUrl}/serverlist"; + public static string ValidateUrl => $"{ApiBaseUrl}/validatehubclient"; + public static string ValidateTokenUrl => $"{ApiBaseUrl}/validatetoken?data="; + public static string SignOutUrl => $"{ApiBaseUrl}/signout?data="; - private const string ChangelogBaseUrl = "https://changelog.unitystation.org"; - public const string Latest10VersionsUrl = $"{ChangelogBaseUrl}/all-changes?format=json&limit=10"; - public const string LatestBlogPosts = $"{ChangelogBaseUrl}/posts/?format=json"; + private static string ChangelogBaseUrl => "https://changelog.unitystation.org"; + public static string Latest10VersionsUrl => $"{ChangelogBaseUrl}/all-changes?format=json&limit=10"; + public static string LatestBlogPosts => $"{ChangelogBaseUrl}/posts/?format=json"; - private const string CdnBaseUrl = "https://unitystationfile.b-cdn.net"; - public const string GoodFilesBaseUrl = $"{CdnBaseUrl}/GoodFiles"; - public const string AllowedGoodFilesUrl = $"{GoodFilesBaseUrl}/AllowGoodFiles.json"; + private static string CdnBaseUrl => "https://unitystationfile.b-cdn.net"; + public static string GoodFilesBaseUrl => $"{CdnBaseUrl}/GoodFiles"; + public static string AllowedGoodFilesUrl => $"{GoodFilesBaseUrl}/AllowGoodFiles.json"; - private const string RawGitHubFileBaseUrl = "https://raw.githubusercontent.com/unitystation/unitystation/develop"; - public const string CodeScanListUrl = $"{RawGitHubFileBaseUrl}/CodeScanList.json"; + private static string RawGitHubFileBaseUrl => "https://raw.githubusercontent.com/unitystation/unitystation/develop"; + public static string CodeScanListUrl => $"{RawGitHubFileBaseUrl}/CodeScanList.json"; } \ No newline at end of file