mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
[Launcher] Categorize Lnk files in program plugin correctly as per the target file type (#6348)
* Updated UnregisteredApps code * Added file type checking code and Folder and File classifications * Added more file formats * Removed run as admin for lnk folders * Added script files as executable and changed hashset to case insensitive * Removed runasadmin for generic files * Removed FileTypes enum * Extended ApplicationTypes enum * Fix file format error * Cleaned use of ApplicationType enum to public and match AppType and used ApplicationType in OnAppRenamed * Modify tests to use ApplicationType enum * Added tests for new App types * Modified dummy appref * Mock Directory.Exists and add tests for GetAppTypeFromPath * Combined tests
This commit is contained in:
@@ -84,7 +84,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, 2);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.ApprefApplication);
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.appref-ms")]
|
||||
@@ -145,7 +145,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, 2);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.Win32Application);
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.exe")]
|
||||
@@ -216,7 +216,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, 1); // Internet Shortcut Application
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.InternetShortcutApplication); // Internet Shortcut Application
|
||||
}
|
||||
|
||||
[TestCase("path.url")]
|
||||
@@ -336,7 +336,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, 2);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.Win32Application);
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.lnk")]
|
||||
|
||||
Reference in New Issue
Block a user