2019-11-21 14:27:35 +00:00
|
|
|
|
using System.Linq;
|
2019-12-06 05:29:17 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2020-01-13 22:55:55 +00:00
|
|
|
|
using Wabbajack.Lib;
|
2019-10-16 23:05:51 +00:00
|
|
|
|
using Wabbajack.Lib.Downloaders;
|
2019-10-16 03:10:34 +00:00
|
|
|
|
using Wabbajack.Lib.ModListRegistry;
|
2020-03-26 21:15:44 +00:00
|
|
|
|
using Xunit;
|
2020-03-29 20:42:45 +00:00
|
|
|
|
using Xunit.Abstractions;
|
2019-10-15 23:23:14 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Test
|
|
|
|
|
{
|
2020-03-29 20:42:45 +00:00
|
|
|
|
public class ModlistMetadataTests : ATestBase
|
2019-10-15 23:23:14 +00:00
|
|
|
|
{
|
2020-03-26 21:15:44 +00:00
|
|
|
|
[Fact]
|
2019-12-06 05:59:57 +00:00
|
|
|
|
public async Task TestLoadingModlists()
|
2019-10-15 23:23:14 +00:00
|
|
|
|
{
|
2019-12-06 05:59:57 +00:00
|
|
|
|
var modlists = await ModlistMetadata.LoadFromGithub();
|
2020-03-26 21:15:44 +00:00
|
|
|
|
Assert.True(modlists.Count > 0);
|
2019-10-15 23:23:14 +00:00
|
|
|
|
}
|
2019-10-16 23:05:51 +00:00
|
|
|
|
|
2020-03-26 21:15:44 +00:00
|
|
|
|
[Fact]
|
2019-12-06 05:29:17 +00:00
|
|
|
|
public async Task VerifyLogoURLs()
|
2019-10-16 23:05:51 +00:00
|
|
|
|
{
|
2019-12-06 05:59:57 +00:00
|
|
|
|
var modlists = await ModlistMetadata.LoadFromGithub();
|
2019-10-16 23:05:51 +00:00
|
|
|
|
|
2019-10-19 10:55:05 +00:00
|
|
|
|
foreach (var modlist in modlists.Select(m => m.Links))
|
2019-10-16 23:05:51 +00:00
|
|
|
|
{
|
2020-03-26 21:15:44 +00:00
|
|
|
|
var logoState = DownloadDispatcher.ResolveArchive(modlist.ImageUri);
|
|
|
|
|
Assert.NotNull(logoState);
|
|
|
|
|
Assert.True(await logoState.Verify(new Archive{Size = 0}), $"{modlist.ImageUri} is not valid");
|
2019-10-16 23:05:51 +00:00
|
|
|
|
}
|
2019-11-06 13:21:39 +00:00
|
|
|
|
}
|
2020-03-29 20:42:45 +00:00
|
|
|
|
|
|
|
|
|
public ModlistMetadataTests(ITestOutputHelper output) : base(output)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2019-10-15 23:23:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|