Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Sep 1, 2024
1 parent e9ee264 commit 2a8773a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions Onova.Tests/Extracting/NugetPackageSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public async Task ExtractPackageAsync_Test()
// Arrange
var entries = new Dictionary<string, byte[]>
{
["File1.bin"] = new byte[] { 1, 2, 3 },
["File2.bin"] = new byte[] { 4, 5, 6 },
["SubDir1/"] = new byte[0],
["SubDir1/File3.bin"] = new byte[] { 7, 8, 9 },
["SubDir1/SubDir2/"] = new byte[0],
["SubDir1/SubDir2/File4.bin"] = new byte[] { 10, 11, 12 }
["File1.bin"] = [1, 2, 3],
["File2.bin"] = [4, 5, 6],
["SubDir1/"] = [],
["SubDir1/File3.bin"] = [7, 8, 9],
["SubDir1/SubDir2/"] = [],
["SubDir1/SubDir2/File4.bin"] = [10, 11, 12],
};

var packageFilePath = Path.Combine(TempDirPath, "Package.nupkg");
Expand Down
12 changes: 6 additions & 6 deletions Onova.Tests/Extracting/ZipPackageSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public async Task I_can_configure_packages_to_be_treated_as_zip_archives()
// Arrange
var entries = new Dictionary<string, byte[]>
{
["File1.bin"] = new byte[] { 1, 2, 3 },
["File2.bin"] = new byte[] { 4, 5, 6 },
["SubDir1/"] = new byte[0],
["SubDir1/File3.bin"] = new byte[] { 7, 8, 9 },
["SubDir1/SubDir2/"] = new byte[0],
["SubDir1/SubDir2/File4.bin"] = new byte[] { 10, 11, 12 }
["File1.bin"] = [1, 2, 3],
["File2.bin"] = [4, 5, 6],
["SubDir1/"] = [],
["SubDir1/File3.bin"] = [7, 8, 9],
["SubDir1/SubDir2/"] = [],
["SubDir1/SubDir2/File4.bin"] = [10, 11, 12],
};

var packageFilePath = Path.Combine(TempDirPath, "Package.zip");
Expand Down
8 changes: 4 additions & 4 deletions Onova.Tests/Resolving/AggregateSourceSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public async Task I_can_use_multiple_different_package_sources_at_once()
// Arrange
var availablePackages = new Dictionary<Version, byte[]>
{
[Version.Parse("1.0")] = new byte[] { 1, 2, 3 },
[Version.Parse("2.0")] = new byte[] { 4, 5, 6 },
[Version.Parse("3.0")] = new byte[] { 7, 8, 9 }
[Version.Parse("1.0")] = [1, 2, 3],
[Version.Parse("2.0")] = [4, 5, 6],
[Version.Parse("3.0")] = [7, 8, 9],
};

var resolver = CreateAggregatePackageResolver(availablePackages);
Expand All @@ -97,7 +97,7 @@ public async Task When_using_multiple_different_package_sources_at_once_packages
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

var resolver = CreateAggregatePackageResolver(availableVersions);
Expand Down
8 changes: 4 additions & 4 deletions Onova.Tests/Resolving/LocalSourceSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public async Task I_can_use_a_local_directory_as_a_package_source()
// Arrange
var availablePackages = new Dictionary<Version, byte[]>
{
[Version.Parse("1.0")] = new byte[] { 1, 2, 3 },
[Version.Parse("2.0")] = new byte[] { 4, 5, 6 },
[Version.Parse("3.0")] = new byte[] { 7, 8, 9 }
[Version.Parse("1.0")] = [1, 2, 3],
[Version.Parse("2.0")] = [4, 5, 6],
[Version.Parse("3.0")] = [7, 8, 9],
};

var resolver = CreateLocalPackageResolver(availablePackages);
Expand All @@ -72,7 +72,7 @@ public async Task When_using_a_local_directory_as_a_package_source_packages_are_
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

var resolver = CreateLocalPackageResolver(availableVersions);
Expand Down
12 changes: 6 additions & 6 deletions Onova.Tests/UpdateSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task I_can_check_for_updates_and_get_a_higher_version_if_it_is_avai
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

using var updateManager = new UpdateManager(
Expand Down Expand Up @@ -106,7 +106,7 @@ public async Task I_can_check_for_updates_and_get_nothing_if_there_is_no_higher_
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

using var updateManager = new UpdateManager(
Expand Down Expand Up @@ -183,7 +183,7 @@ public async Task I_can_prepare_an_update_so_that_it_can_be_installed()
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

using var updateManager = new UpdateManager(
Expand Down Expand Up @@ -224,7 +224,7 @@ public async Task I_can_get_a_list_of_updates_which_are_already_prepared_to_inst
{
Version.Parse("1.0"),
Version.Parse("2.0"),
Version.Parse("3.0")
Version.Parse("3.0"),
};

using var manager = new UpdateManager(
Expand Down Expand Up @@ -257,7 +257,7 @@ public async Task I_can_install_an_update_after_preparing_it()
{
Version.Parse("1.0.0.0"),
Version.Parse("2.0.0.0"),
Version.Parse("3.0.0.0")
Version.Parse("3.0.0.0"),
};

var expectedFinalVersion = Version.Parse("3.0.0.0");
Expand Down Expand Up @@ -292,7 +292,7 @@ public async Task I_can_install_an_update_after_preparing_it_and_have_the_applic
{
Version.Parse("1.0.0.0"),
Version.Parse("2.0.0.0"),
Version.Parse("3.0.0.0")
Version.Parse("3.0.0.0"),
};

var expectedFinalVersion = Version.Parse("3.0.0.0");
Expand Down
2 changes: 1 addition & 1 deletion Onova.Tests/Utils/DummyEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void Setup(Version baseVersion, IReadOnlyList<Version> availableVersions)
public string[] GetLastRunArguments(Version version)
{
var filePath = Path.Combine(rootDirPath, $"lastrun-{version}.txt");
return File.Exists(filePath) ? File.ReadAllLines(filePath) : Array.Empty<string>();
return File.Exists(filePath) ? File.ReadAllLines(filePath) : [];
}

public string GetLastUpdaterLogs()
Expand Down
2 changes: 1 addition & 1 deletion Onova.Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void StartUpdatee()
WorkingDirectory = Path.GetDirectoryName(updateeFilePath),
Arguments = routedArgs,
// Don't let the child process inherit the current console window
UseShellExecute = true
UseShellExecute = true,
};

// If the updatee is an .exe file, start it directly.
Expand Down
2 changes: 1 addition & 1 deletion Onova.Updater/Utils/Extensions/DisposableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void DisposeAll(this IEnumerable<IDisposable> disposables)
}
catch (Exception ex)
{
exceptions ??= new List<Exception>();
exceptions ??= [];
exceptions.Add(ex);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Onova/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void LaunchUpdater(Version version, bool restart, string restartArguments
// in case the application is running inside a console window host.
// Also required to run with elevated privileges.
UseShellExecute = true,
Verb = isElevated ? "runas" : ""
Verb = isElevated ? "runas" : "",
};

updaterProcess.Start();
Expand Down

0 comments on commit 2a8773a

Please sign in to comment.