2019-11-21 14:27:35 +00:00
|
|
|
|
using System.Linq;
|
2019-12-06 05:29:17 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2019-10-15 23:23:14 +00:00
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
2019-10-16 23:05:51 +00:00
|
|
|
|
using Wabbajack.Lib.Downloaders;
|
2019-10-16 03:10:34 +00:00
|
|
|
|
using Wabbajack.Lib.ModListRegistry;
|
2019-10-15 23:23:14 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Test
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class ModlistMetadataTests
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
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();
|
2019-10-15 23:23:14 +00:00
|
|
|
|
Assert.IsTrue(modlists.Count > 0);
|
|
|
|
|
}
|
2019-10-16 23:05:51 +00:00
|
|
|
|
|
|
|
|
|
[TestMethod]
|
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
|
|
|
|
{
|
2019-10-19 10:55:05 +00:00
|
|
|
|
var logo_state = DownloadDispatcher.ResolveArchive(modlist.ImageUri);
|
2019-10-16 23:05:51 +00:00
|
|
|
|
Assert.IsNotNull(logo_state);
|
2019-12-06 05:29:17 +00:00
|
|
|
|
Assert.IsTrue(await logo_state.Verify(), $"{modlist.ImageUri} is not valid");
|
2019-10-16 23:05:51 +00:00
|
|
|
|
}
|
2019-11-06 13:21:39 +00:00
|
|
|
|
}
|
2019-10-15 23:23:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|