Restore original setting for devs in test
MODIFY
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
using System;
+using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Fluent.Helpers;
+using WalletWasabi.Gui;
+using WalletWasabi.Helpers;
using Xunit;
namespace WalletWasabi.Tests.UnitTests
@@ -11,6 +14,8 @@ namespace WalletWasabi.Tests.UnitTests
[Fact]
public async Task ModifyStartupOnDifferentSystemsTestAsync()
{
+ UiConfig originalConfig = GetUiConfig();
+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
await StartupHelper.ModifyStartupSettingAsync(true);
@@ -26,6 +31,18 @@ namespace WalletWasabi.Tests.UnitTests
await StartupHelper.ModifyStartupSettingAsync(true);
await StartupHelper.ModifyStartupSettingAsync(false);
}
+
+ // Restore original setting for devs.
+ await StartupHelper.ModifyStartupSettingAsync(originalConfig.RunOnSystemStartup);
+ }
+
+ private UiConfig GetUiConfig()
+ {
+ string dataDir = EnvironmentHelpers.GetDataDir(Path.Combine("WalletWasabi", "Client"));
+ UiConfig uiConfig = new(Path.Combine(dataDir, "UiConfig.json"));
+ uiConfig.LoadOrCreateDefaultFile();
+
+ return uiConfig;
}
}
}

Restore original setting for devs in test