Fix a few tests

This commit is contained in:
Timothy Baldridge 2020-04-02 15:46:11 -06:00
parent 55fb7e1467
commit aaba7267bd
3 changed files with 6 additions and 15 deletions

View File

@ -295,16 +295,9 @@ namespace Wabbajack.Common
File.AppendAllText(_path, text);
}
public void CopyTo(AbsolutePath dest, bool useMove = false)
public void CopyTo(AbsolutePath dest)
{
if (useMove)
{
File.Move(_path, dest._path, MoveOptions.ReplaceExisting);
}
else
{
File.Copy(_path, dest._path);
}
File.Copy(_path, dest._path);
}
public async Task<IEnumerable<string>> ReadAllLinesAsync()

View File

@ -57,14 +57,12 @@ namespace Wabbajack.Lib.Downloaders
if (general.modID != null && general.fileID != null && general.gameName != null)
{
var name = (string)general.gameName;
var gameMeta = GameRegistry.GetByMO2ArchiveName(name);
var game = gameMeta != null ? GameRegistry.GetByMO2ArchiveName(name).Game : GameRegistry.GetByNexusName(name).Game;
var game = GameRegistry.GetByFuzzyName((string)general.gameName).Game;
var client = await NexusApiClient.Get();
dynamic info;
ModInfo info;
try
{
info = await client.GetModInfo(game, general.modID);
info = await client.GetModInfo(game, long.Parse((string)general.modID));
}
catch (Exception)
{

View File

@ -469,7 +469,7 @@ namespace Wabbajack.Test
using var tempFile = new TempFile();
await converted.Download(new Archive {Name = "yt_test.zip"}, tempFile.Path);
Assert.Equal(Hash.FromBase64("H166oHG0wpY="), await tempFile.Path.FileHashAsync());
Assert.Equal(Hash.FromBase64("kD36zbA2X9Q="), await tempFile.Path.FileHashAsync());
}