Updated tests

pull/211/head
dahall 2021-02-08 15:33:48 -07:00
parent bf1cbcf3ca
commit c703c450f9
2 changed files with 12 additions and 1 deletions

View File

@ -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)

View File

@ -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}");