From aaba7267bd3b7f40a302bd721fcf87302c5b9267 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 2 Apr 2020 15:46:11 -0600 Subject: [PATCH] Fix a few tests --- Wabbajack.Common/Paths.cs | 11 ++--------- Wabbajack.Lib/Downloaders/NexusDownloader.cs | 8 +++----- Wabbajack.Test/DownloaderTests.cs | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Wabbajack.Common/Paths.cs b/Wabbajack.Common/Paths.cs index 3b24aa36..70884203 100644 --- a/Wabbajack.Common/Paths.cs +++ b/Wabbajack.Common/Paths.cs @@ -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> ReadAllLinesAsync() diff --git a/Wabbajack.Lib/Downloaders/NexusDownloader.cs b/Wabbajack.Lib/Downloaders/NexusDownloader.cs index c7b8d7ce..4f9184ba 100644 --- a/Wabbajack.Lib/Downloaders/NexusDownloader.cs +++ b/Wabbajack.Lib/Downloaders/NexusDownloader.cs @@ -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) { diff --git a/Wabbajack.Test/DownloaderTests.cs b/Wabbajack.Test/DownloaderTests.cs index 405fb043..bb8c0636 100644 --- a/Wabbajack.Test/DownloaderTests.cs +++ b/Wabbajack.Test/DownloaderTests.cs @@ -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()); }