diff --git a/UnitTests/Windows.Forms.App/Form1.cs b/UnitTests/Windows.Forms.App/Form1.cs index 52d1c6ac..f1f9aac9 100644 --- a/UnitTests/Windows.Forms.App/Form1.cs +++ b/UnitTests/Windows.Forms.App/Form1.cs @@ -69,7 +69,7 @@ namespace Windows.Forms.App File.Delete(n); // Unregister app - ProgId.Unregister(appId, true, systemWide); + try { ProgId.Unregister(appId, true, systemWide); } catch { } } private void Form1_Load(object sender, EventArgs e) diff --git a/UnitTests/Windows.Shell/ShellContextMenuTests.cs b/UnitTests/Windows.Shell/ShellContextMenuTests.cs index 306bcc01..378d0d2f 100644 --- a/UnitTests/Windows.Shell/ShellContextMenuTests.cs +++ b/UnitTests/Windows.Shell/ShellContextMenuTests.cs @@ -34,6 +34,17 @@ namespace Vanara.Windows.Shell.Tests ShowMII(items[i], i); } + [Test] + public void TestRepeatFail() + { + for (int i = 0; i < 20; i++) + { + using ShellItem Item = ShellItem.Open(TestCaseSources.ImageFile); + using ShellContextMenu ContextMenu = new ShellContextMenu(Item); + TestContext.WriteLine(ContextMenu.ComInterface.GetType().Name); + } + } + static void ShowMII(ShellContextMenu.MenuItemInfo mii, int c, int indent = 0) { TestContext.WriteLine($"{new string(' ', indent * 3)}{c + 1}) \"{mii.Text}\" (#{mii.Id}) - Type={mii.Type}; State={mii.State}; Verb={mii.Verb}; Tooltip={mii.HelpText}; IconLoc={mii.VerbIconLocation}");