Commit
This commit is contained in:
parent
8b61ca41fa
commit
17883e16e1
41 changed files with 3173 additions and 0 deletions
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.ComponentModel.Design;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.VisualStudio.OLE.Interop;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using Microsoft.VisualStudio.Shell;
|
||||
using Microsoft.VsSDK.IntegrationTestLibrary;
|
||||
using Microsoft.VSSDK.Tools.VsIdeTesting;
|
||||
|
||||
namespace VSPackageInstall_IntegrationTests
|
||||
{
|
||||
[TestClass()]
|
||||
public class MenuItemTest
|
||||
{
|
||||
private delegate void ThreadInvoker();
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///A test for lauching the command and closing the associated dialogbox
|
||||
///</summary>
|
||||
[TestMethod()]
|
||||
[HostType("VS IDE")]
|
||||
public void LaunchCommand()
|
||||
{
|
||||
UIThreadInvoker.Invoke((ThreadInvoker)delegate()
|
||||
{
|
||||
CommandID menuItemCmd = new CommandID(VitaliiGanzha.VSPackageInstall.GuidList.guidVSPackageInstallCmdSet, (int)VitaliiGanzha.VSPackageInstall.PkgCmdIDList.cmdidVsDing);
|
||||
|
||||
// Create the DialogBoxListener Thread.
|
||||
string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "VSPackageInstall", "VitaliiGanzha.VSPackageInstall.VSPackageInstallPackage");
|
||||
DialogBoxPurger purger = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText);
|
||||
|
||||
try
|
||||
{
|
||||
purger.Start();
|
||||
|
||||
TestUtils testUtils = new TestUtils();
|
||||
testUtils.ExecuteCommand(menuItemCmd);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue