Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VSEventsHandler"/> class.
 /// </summary>
 /// <param name="package">The Visual Studio Extension Package.</param>
 public VSEventsHandler(OpenCoverUIPackage package)
 {
     _package                      = package;
     _solutionEvents               = _package.DTE.Events.SolutionEvents;
     _solutionEvents.Opened       += OnSolutionOpened;
     _solutionEvents.AfterClosing += OnSolutionClosing;
 }
Ejemplo n.º 2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="VSEventsHandler"/> class.
		/// </summary>
		/// <param name="package">The Visual Studio Extension Package.</param>
		public VSEventsHandler(OpenCoverUIPackage package)
		{
			_package = package;

			_package.DTE.Events.SolutionEvents.Opened += SolutionOpened;
			_package.DTE.Events.SolutionEvents.AfterClosing += SolutionClosing;
		}
 /// <summary>
 /// Initializes the control by adding handlers to BuildDone, SolutionOpened & SolutionClosing events.
 /// </summary>
 /// <param name="package">The package.</param>
 internal void Initialize(OpenCoverUIPackage package)
 {
     _package = package;
     _package.VSEventsHandler.BuildDone       += DiscoverTests;
     _package.VSEventsHandler.SolutionOpened  += DiscoverTests;
     _package.VSEventsHandler.SolutionClosing += ClearTestsTreeViewChildren;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NUnitTestExecutor"/> class.
        /// </summary>
        /// <param name="package">The package.</param>
        /// <param name="selectedTests">The selected tests.</param>
        internal NUnitTestExecutor(OpenCoverUIPackage package, Tuple <IEnumerable <String>, IEnumerable <String>, IEnumerable <String> > selectedTests)
            : base(package, selectedTests)
        {
            SetNUnitPath();

            _executionStatus = new Dictionary <string, IEnumerable <TestResult> >();
        }
		/// <summary>
		/// Initializes the control by adding handlers to BuildDone, SolutionOpened & SolutionClosing events.
		/// </summary>
		/// <param name="package">The package.</param>
		internal void Initialize(OpenCoverUIPackage package)
		{
			_package = package;
			_package.VSEventsHandler.BuildDone += DiscoverTests;
			_package.VSEventsHandler.SolutionOpened += DiscoverTests;
			_package.VSEventsHandler.SolutionClosing += ClearTestsTreeViewChildren;
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="VSEventsHandler"/> class.
		/// </summary>
		/// <param name="package">The Visual Studio Extension Package.</param>
		public VSEventsHandler(OpenCoverUIPackage package)
		{
			_package = package;
			_solutionEvents = _package.DTE.Events.SolutionEvents;
			_solutionEvents.Opened += OnSolutionOpened;
			_solutionEvents.AfterClosing += OnSolutionClosing;
			_buildSuccessful = true;
		}
Ejemplo n.º 7
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TestExecutor"/> class.
		/// </summary>
		/// <param name="package">The package.</param>
		/// <param name="selectedTests">The selected tests.</param>
		public TestExecutor(OpenCoverUIPackage package, IEnumerable<Test> selectedTests)
		{
			_package = package;
			_selectedTests = selectedTests;
			_openCoverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), 
												@"Apps\OpenCover\OpenCover.Console.exe");
			_vsTestPath = Path.Combine(Path.GetDirectoryName(_package.DTE.FullName), @"CommonExtensions\Microsoft\TestWindow\vstest.console.exe");
		}
Ejemplo n.º 8
0
        internal void Initialize(OpenCoverUIPackage package)
        {
            _package = package;
            _package.VSEventsHandler.SolutionClosing += ClearTreeView;
            _package.VSEventsHandler.SolutionOpened  += ClearTreeView;

            _package.Settings.PropertyChanged += PackageSettings_PropertyChanged;
        }
		/// <summary>
		/// Initializes the control by adding handlers to BuildDone, SolutionOpened & SolutionClosing events.
		/// </summary>
		/// <param name="package">The package.</param>
		internal void Initialize(OpenCoverUIPackage package)
		{
			_package = package;
			_package.VSEventsHandler.BuildSucceeded += DiscoverTests;
			_package.VSEventsHandler.BuildFailed += () => { IDEHelper.WriteToOutputWindow("Build failed. Please make sure your solution builds properly before refreshing this window."); };
			_package.VSEventsHandler.SolutionOpened += DiscoverTests;
			_package.VSEventsHandler.SolutionClosing += ClearTestsTreeViewChildren;
		}
 /// <summary>
 /// Initializes the control by adding handlers to BuildDone, SolutionOpened & SolutionClosing events.
 /// </summary>
 /// <param name="package">The package.</param>
 internal void Initialize(OpenCoverUIPackage package)
 {
     _package = package;
     _package.VSEventsHandler.BuildSucceeded  += DiscoverTests;
     _package.VSEventsHandler.BuildFailed     += () => { IDEHelper.WriteToOutputWindow("Build failed. Please make sure your solution builds properly before refreshing this window."); };
     _package.VSEventsHandler.SolutionOpened  += DiscoverTests;
     _package.VSEventsHandler.SolutionClosing += ClearTestsTreeViewChildren;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestExecutor"/> class.
 /// </summary>
 /// <param name="package">The package.</param>
 /// <param name="selectedTests">The selected tests.</param>
 public TestExecutor(OpenCoverUIPackage package, IEnumerable <Test> selectedTests)
 {
     _package       = package;
     _selectedTests = selectedTests;
     _openCoverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                                   @"Apps\OpenCover\OpenCover.Console.exe");
     _vsTestPath = Path.Combine(Path.GetDirectoryName(_package.DTE.FullName), @"CommonExtensions\Microsoft\TestWindow\vstest.console.exe");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExecuteSelectedTestsCommand"/> class.
 /// </summary>
 /// <param name="package">The Visual Studio Extension Package.</param>
 public ExecuteSelectedTestsCommand(OpenCoverUIPackage package, IVsUIShell uiShell)
     : base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCoverWithOpenCover))
 {
     this._package         = package;
     this._uiShell         = uiShell;
     this._testTreeControl = IDEHelper.GetTestTreeControl(_uiShell);
     this._testTreeControl.LayoutUpdated += EnableDisableCommand;
     base.Enabled = false;
 }
Ejemplo n.º 13
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TestExecutor"/> class.
		/// </summary>
		/// <param name="package">The package.</param>
		/// <param name="selectedTests">The selected tests.</param>
		internal TestExecutor(OpenCoverUIPackage package, Tuple<IEnumerable<String>, IEnumerable<String>, IEnumerable<String>> selectedTests)
		{
			_package = package;
			_selectedTests = selectedTests;

            SetOpenCoverPath();

			_executionStatus = new Dictionary<string, IEnumerable<TestResult>>();
		}
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExecuteSelectedTestsCommand" /> class.
        /// </summary>
        /// <param name="package">The Visual Studio Extension Package.</param>
        public ExecuteSelectedTestsCommand(OpenCoverUIPackage package)
            : base(package, new CommandID(GuidList.GuidOpenCoverTestExplorerContextMenuCommandSet, (int)PkgCmdIDList.CommandIDOpenCoverTestExplorerRunTestWithOpenCover))
        {
            _package = package;

            base.Enabled = false;

            TestExplorerControl.TestDiscoveryFinished += OnTestDiscoveryFinished;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestExecutor"/> class.
        /// </summary>
        /// <param name="package">The package.</param>
        /// <param name="selectedTests">The selected tests.</param>
        internal TestExecutor(OpenCoverUIPackage package, Tuple <IEnumerable <String>, IEnumerable <String>, IEnumerable <String> > selectedTests)
        {
            _package       = package;
            _selectedTests = selectedTests;

            SetOpenCoverPath();

            _executionStatus = new Dictionary <string, IEnumerable <TestResult> >();
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="ExecuteSelectedTestsCommand"/> class.
		/// </summary>
		/// <param name="package">The Visual Studio Extension Package.</param>
		public ExecuteSelectedTestsCommand(OpenCoverUIPackage package, IVsUIShell uiShell)
			: base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCoverWithOpenCover))
		{
			this._package = package;
			this._uiShell = uiShell;
			this._testTreeControl = IDEHelper.GetTestTreeControl(_uiShell);
			this._testTreeControl.LayoutUpdated += EnableDisableCommand;
			base.Enabled = false;
		}
Ejemplo n.º 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestExecutor"/> class.
        /// </summary>
        /// <param name="package">The package.</param>
        /// <param name="selectedTests">The selected tests.</param>
        internal TestExecutor(OpenCoverUIPackage package, Tuple <IEnumerable <String>, IEnumerable <String>, IEnumerable <String> > selectedTests)
        {
            _package       = package;
            _selectedTests = selectedTests;

            _openCoverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                                          @"Apps\OpenCover\OpenCover.Console.exe");

            _executionStatus = new Dictionary <string, IEnumerable <TestResult> >();
        }
Ejemplo n.º 18
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TestExecutor"/> class.
		/// </summary>
		/// <param name="package">The package.</param>
		/// <param name="selectedTests">The selected tests.</param>
		internal TestExecutor(OpenCoverUIPackage package, Tuple<IEnumerable<String>, IEnumerable<String>, IEnumerable<String>> selectedTests)
		{
			_package = package;
			_selectedTests = selectedTests;

			_openCoverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
												@"Apps\OpenCover\OpenCover.Console.exe");

			_executionStatus = new Dictionary<string, IEnumerable<TestResult>>();
		}
Ejemplo n.º 19
0
		internal MSTestExecutor(OpenCoverUIPackage package, Tuple<IEnumerable<String>, IEnumerable<String>, IEnumerable<String>> selectedTests)
			: base(package, selectedTests)
		{
			_vsTestPath = Path.Combine(Path.GetDirectoryName(_package.DTE.FullName), @"CommonExtensions\Microsoft\TestWindow\vstest.console.exe");
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="TestExplorerToolWindowCommand"/> class.
		/// </summary>
		/// <param name="package">The package.</param>
		public TestExplorerToolWindowCommand(OpenCoverUIPackage package)
			: base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCodeCoverageTestWindow))
		{
			this._package = package;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="CodeCoverageToolWindowCommand"/> class.
		/// </summary>
		/// <param name="package">The Visual Studio Extension Package.</param>
		public CodeCoverageToolWindowCommand(OpenCoverUIPackage package)
			: base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCodeCoverageResults))
		{
			this._package = package;
		}
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Command" /> class.
 /// </summary>
 /// <param name="package">The Visual Studio extension package.</param>
 /// <param name="commandID">The command identifier.</param>
 public Command(OpenCoverUIPackage package, CommandID commandID)
     : base(CommandExecuted, commandID)
 {
     this._package   = package;
     this._commandID = commandID;
 }
Ejemplo n.º 23
0
 internal void Initialize(OpenCoverUIPackage package)
 {
     _package = package;
     _package.VSEventsHandler.SolutionClosing += ClearTreeView;
     _package.VSEventsHandler.SolutionOpened  += ClearTreeView;
 }
		internal void Initialize(OpenCoverUIPackage package)
		{
			_package = package;
			_package.VSEventsHandler.SolutionClosing += ClearTreeView;
			_package.VSEventsHandler.SolutionOpened += ClearTreeView;

            _package.Settings.PropertyChanged += PackageSettings_PropertyChanged;

		}
Ejemplo n.º 25
0
 internal MSTestExecutor(OpenCoverUIPackage package, Tuple <IEnumerable <String>, IEnumerable <String>, IEnumerable <String> > selectedTests)
     : base(package, selectedTests)
 {
     _vsTestPath = Path.Combine(Path.GetDirectoryName(_package.DTE.FullName), @"CommonExtensions\Microsoft\TestWindow\vstest.console.exe");
 }
		internal void Initialize(OpenCoverUIPackage package)
		{
			_package = package;
			_package.VSEventsHandler.SolutionClosing += ClearTreeView;
			_package.VSEventsHandler.SolutionOpened += ClearTreeView;
		}
 public MSTestSettingsFileSelectorCommand(OpenCoverUIPackage package)
     : base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.OpenCoverSelectMSTestSettings))
 {
     _package           = package;
     BeforeQueryStatus += OnBeforeQueryStatus;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestExplorerToolWindowCommand"/> class.
 /// </summary>
 /// <param name="package">The package.</param>
 public TestExplorerToolWindowCommand(OpenCoverUIPackage package)
     : base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCodeCoverageTestWindow))
 {
     this._package = package;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeCoverageToolWindowCommand"/> class.
 /// </summary>
 /// <param name="package">The Visual Studio Extension Package.</param>
 public CodeCoverageToolWindowCommand(OpenCoverUIPackage package)
     : base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.CmdidCodeCoverageResults))
 {
     this._package = package;
 }
Ejemplo n.º 30
0
		/// <summary>
		/// Initializes a new instance of the <see cref="Command" /> class.
		/// </summary>
		/// <param name="package">The Visual Studio extension package.</param>
		/// <param name="commandID">The command identifier.</param>
		public Command(OpenCoverUIPackage package, CommandID commandID)
			: base(CommandExecuted, commandID)
		{
			this._package = package;
			this._commandID = commandID;
		}
		public MSTestSettingsFileSelectorCommand(OpenCoverUIPackage package)
			: base(package, new CommandID(GuidList.GuidOpenCoverUICmdSet, (int)PkgCmdIDList.OpenCoverSelectMSTestSettings))
		{
			_package = package;
			BeforeQueryStatus += OnBeforeQueryStatus;
		}