wabbajack/Wabbajack.Test/ModlistMetadataTests.cs

39 lines
1.0 KiB
C#
Raw Normal View History

2019-11-21 14:27:35 +00:00
using System.Linq;
using System.Threading.Tasks;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
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
}
2020-03-26 21:15:44 +00:00
[Fact]
public async Task VerifyLogoURLs()
{
2019-12-06 05:59:57 +00:00
var modlists = await ModlistMetadata.LoadFromGithub();
foreach (var modlist in modlists.Select(m => m.Links))
{
2020-03-26 21:15:44 +00:00
var logoState = DownloadDispatcher.ResolveArchive(modlist.ImageUri);
Assert.NotNull(logoState);
2020-04-10 01:29:53 +00:00
Assert.True(await logoState.Verify(new Archive(state: null){Size = 0}), $"{modlist.ImageUri} is not valid");
}
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
}
}