Wrap test in try finally block
MODIFY
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
@@ -19,7 +19,8 @@ namespace WalletWasabi.Tests.UnitTests
public async Task ModifyStartupOnDifferentSystemsTestAsync()
{
UiConfig originalConfig = GetUiConfig();
-
+ try
+ {
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
await StartupHelper.ModifyStartupSettingAsync(true);
@@ -50,10 +51,13 @@ namespace WalletWasabi.Tests.UnitTests
await StartupHelper.ModifyStartupSettingAsync(false);
}
-
+ }
+ finally
+ {
// Restore original setting for devs.
await StartupHelper.ModifyStartupSettingAsync(originalConfig.RunOnSystemStartup);
}
+ }
private UiConfig GetUiConfig()
{

Wrap test in try finally block