Added TESAllianceDownload Test

This commit is contained in:
erri120 2020-01-27 14:40:47 +01:00
parent 8b62eb42c3
commit b1bd736d8c
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -335,7 +335,32 @@ namespace Wabbajack.Test
Assert.AreEqual(File.ReadAllText(filename), "Cheese for Everyone!");
}
/* WAITING FOR APPROVAL BY MODERATOR (you need to have your submitted file approved before it goes live)
/* WAITING FOR APPROVAL BY MODERATOR
[TestMethod]
public async Task TESAllianceDownload()
{
await DownloadDispatcher.GetInstance<TESAllianceDownloader>().Prepare();
const string ini = "[General]\n" +
"directURL=http://tesalliance.org/forums/index.php?/files/file/2035-wabbajack-test-file/";
var state = (AbstractDownloadState)await DownloadDispatcher.ResolveArchive(ini.LoadIniString());
Assert.IsNotNull(state);
var converted = await state.RoundTripState();
Assert.IsTrue(await converted.Verify(new Archive{Size = 20}));
var filename = Guid.NewGuid().ToString();
Assert.IsTrue(converted.IsWhitelisted(new ServerWhitelist { AllowedPrefixes = new List<string>() }));
await converted.Download(new Archive { Name = "TESAlliance Test.zip" }, filename);
Assert.AreEqual("eSIyd+KOG3s=", filename.FileHash());
Assert.AreEqual(File.ReadAllText(filename), "Cheese for Everyone!");
}*/
/* WAITING FOR APPROVAL BY MODERATOR
[TestMethod]
public async Task DeadlyStreamDownloader()
{