Added some missing refactors on some projects that were unloaded

This commit is contained in:
Justin Swanson 2020-04-27 23:03:57 -05:00
parent 2b0866b4f3
commit 7a2f47a8c4
4 changed files with 13 additions and 13 deletions

View File

@ -191,7 +191,7 @@ namespace Wabbajack.Test
public async Task FolderIfNotEmptyCheck_Exists()
{
var vm = new FilePickerVM();
await using (CreateSetFolder(vm))
await using (await CreateSetFolder(vm))
{
vm.PathType = FilePickerVM.PathTypeOptions.Folder;
vm.ExistCheckOption = FilePickerVM.CheckOptions.IfPathNotEmpty;
@ -220,7 +220,7 @@ namespace Wabbajack.Test
public async Task FolderOnExistsCheck_Exists()
{
var vm = new FilePickerVM();
await using (CreateSetFolder(vm))
await using (await CreateSetFolder(vm))
{
vm.PathType = FilePickerVM.PathTypeOptions.Folder;
vm.ExistCheckOption = FilePickerVM.CheckOptions.On;
@ -275,7 +275,7 @@ namespace Wabbajack.Test
public async Task FolderExistsButSetToFile()
{
var vm = new FilePickerVM();
await using (CreateSetFolder(vm))
await using (await CreateSetFolder(vm))
{
vm.PathType = FilePickerVM.PathTypeOptions.File;
vm.ExistCheckOption = FilePickerVM.CheckOptions.On;
@ -353,9 +353,9 @@ namespace Wabbajack.Test
Assert.True(string.IsNullOrEmpty(vm.ErrorTooltip));
}
private static TempFolder CreateSetFolder(FilePickerVM vm)
private static async Task<TempFolder> CreateSetFolder(FilePickerVM vm)
{
var temp = new TempFolder();
var temp = await TempFolder.Create();
vm.TargetPath = temp.Dir;
return temp;
}

View File

@ -21,7 +21,7 @@ namespace Wabbajack.BuildServer.Test
private CancellationTokenSource _token;
private Task _task;
public readonly TempFolder _severTempFolder = new TempFolder();
public readonly TempFolder _severTempFolder = TempFolder.Create().Result;
private bool _disposed = false;
public AbsolutePath ServerTempFolder => _severTempFolder.Dir;

View File

@ -531,7 +531,7 @@ namespace Wabbajack.Test
[Fact]
public async Task TestUpgrading()
{
await using var folder = new TempFolder();
await using var folder = await TempFolder.Create();
var dest = folder.Dir.Combine("Cori.7z");
var archive = new Archive(
new NexusDownloader.State

View File

@ -12,21 +12,21 @@ namespace Wabbajack.Test
[Fact]
public async Task CheckValidInstallPath_Empty()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
Assert.True(MO2Installer.CheckValidInstallPath(tempDir.Dir, downloadFolder: null).Succeeded);
}
[Fact]
public async Task CheckValidInstallPath_DoesNotExist()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
Assert.True(MO2Installer.CheckValidInstallPath(tempDir.Dir.Combine("Subfolder"), downloadFolder: null).Succeeded);
}
[Fact]
public async Task CheckValidInstallPath_HasModlist()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
await using var mo2 = tempDir.Dir.Combine("ModOrganizer.exe").Create();
await using var molist = tempDir.Dir.Combine(((RelativePath)"modlist")).WithExtension(Consts.ModListExtension).Create();
Assert.False(MO2Installer.CheckValidInstallPath(tempDir.Dir, downloadFolder: null).Succeeded);
@ -35,7 +35,7 @@ namespace Wabbajack.Test
[Fact]
public async Task CheckValidInstallPath_ProperOverwrite()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
await using var tmp = tempDir.Dir.Combine(Consts.ModOrganizer2Exe).Create();
Assert.True(MO2Installer.CheckValidInstallPath(tempDir.Dir, downloadFolder: null).Succeeded);
}
@ -43,7 +43,7 @@ namespace Wabbajack.Test
[Fact]
public async Task CheckValidInstallPath_ImproperOverwrite()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
await tempDir.Dir.DeleteDirectory();
tempDir.Dir.CreateDirectory();
await using var tmp = tempDir.Dir.Combine($"someFile.txt").Create();
@ -53,7 +53,7 @@ namespace Wabbajack.Test
[Fact]
public async Task CheckValidInstallPath_OverwriteFilesInDownloads()
{
await using var tempDir = new TempFolder();
await using var tempDir = await TempFolder.Create();
var downloadsFolder = tempDir.Dir.Combine("downloads");
downloadsFolder.CreateDirectory();
await using var tmp = tempDir.Dir.Combine($"downloads/someFile.txt").Create();