LinuxStartupHelper added
ADD
WalletWasabi.Tests/Helpers/LinuxStartupHelper.cs
+using System;
+using System.IO;
+using WalletWasabi.Helpers;
+
+namespace WalletWasabi.Tests.Helpers
+{
+ public static class LinuxStartupHelper
+ {
+ public static readonly string FilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config", "autostart", "Wasabi.desktop");
+
+ public static readonly string ExpectedDesktopFileContent = string.Join(
+ "\n",
+ "[Desktop Entry]",
+ $"Name={Constants.AppName}",
+ "Type=Application",
+ $"Exec={EnvironmentHelpers.GetExecutablePath()}",
+ "Hidden=false",
+ "Terminal=false",
+ "X-GNOME-Autostart-enabled=true");
+
+ public static string GetFileContent()
+ {
+ return string.Join("\n", File.ReadAllLines(FilePath));
+ }
+ }
+}

MODIFY
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
WalletWasabi.Tests/UnitTests/StartWasabiOnSystemStartupTests.cs
@@ -40,12 +40,12 @@ namespace WalletWasabi.Tests.UnitTests
{
await StartupHelper.ModifyStartupSettingAsync(true);
- //Assert.True(File.Exists(_linuxHelper.FilePath));
- //Assert.Equal(_linuxHelper.ExpectedDesktopFileContent, _linuxHelper.GetFileContent());
+ Assert.True(File.Exists(LinuxStartupHelper.FilePath));
+ Assert.Equal(LinuxStartupHelper.ExpectedDesktopFileContent, LinuxStartupHelper.GetFileContent());
await StartupHelper.ModifyStartupSettingAsync(false);
- //Assert.False(File.Exists(_linuxHelper.FilePath));
+ Assert.False(File.Exists(LinuxStartupHelper.FilePath));
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{

LinuxStartupHelper added