Index Desktop Applications (#4422)

* Added support to index desktop app

* Fixed dedup for url files

* Added internet shortcut scheme for epic games

* Added test for internet shortcut dedup

* Updated hostname for steam game
This commit is contained in:
Divyansh Srivastava
2020-06-22 12:34:57 -07:00
committed by GitHub
parent 73125574e6
commit 196055e50e
3 changed files with 75 additions and 20 deletions

View File

@@ -126,6 +126,24 @@ namespace Wox.Test.Plugins
LnkResolvedPath = "c:\\programdata\\microsoft\\windows\\start menu\\programs\\test proxy.lnk"
};
Win32 dummy_internetShortcut_app = new Win32
{
Name = "Shop Titans",
ExecutableName = "Shop Titans.url",
FullPath = "steam://rungameid/1258080",
ParentDirectory = "C:\\Users\\temp\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Steam",
LnkResolvedPath = null
};
Win32 dummy_internetShortcut_app_duplicate = new Win32
{
Name = "Shop Titans",
ExecutableName = "Shop Titans.url",
FullPath = "steam://rungameid/1258080",
ParentDirectory = "C:\\Users\\temp\\Desktop",
LnkResolvedPath = null
};
[Test]
public void DedupFunction_whenCalled_mustRemoveDuplicateNotepads()
{
@@ -141,6 +159,21 @@ namespace Wox.Test.Plugins
Assert.AreEqual(apps.Length, 1);
}
[Test]
public void DedupFunction_whenCalled_MustRemoveInternetShortcuts()
{
// Arrange
List<Win32> prgms = new List<Win32>();
prgms.Add(dummy_internetShortcut_app);
prgms.Add(dummy_internetShortcut_app_duplicate);
// Act
Win32[] apps = Win32.DeduplicatePrograms(prgms.AsParallel());
// Assert
Assert.AreEqual(apps.Length, 1);
}
[Test]
public void DedupFunction_whenCalled_mustNotRemovelnkWhichdoesNotHaveExe()
{