예제 #1
0
        /// <summary>
        /// Handler to react to project load/unload events.
        /// </summary>
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            if (e != null)
            {
                string projectPath = VsSolutionHelper.GetProjectPath(e.Project);

                var files = FindPotentialTestFiles(e.Project);
                if (e.ChangedReason == SolutionChangedReason.Load)
                {
                    ChutzpahTracer.TraceInformation("Project Loaded: '{0}'", projectPath);
                    UpdateChutzpahEnvironmentForProject(projectPath);
                    UpdateTestContainersAndFileWatchers(files, true);
                }
                else if (e.ChangedReason == SolutionChangedReason.Unload)
                {
                    ChutzpahTracer.TraceInformation("Project Unloaded: '{0}'", projectPath);
                    RemoveChutzpahEnvironmentForProject(projectPath);
                    UpdateTestContainersAndFileWatchers(files, false);
                }
            }

            // Do not fire OnTestContainersChanged here.
            // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception.
            // The UTE will query all the TestContainerDiscoverers once the solution is loaded.
        }
예제 #2
0
 private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
 {
     if (e.ChangedReason == SolutionChangedReason.Load || e.ChangedReason == SolutionChangedReason.Unload)
     {
         InitializeSettingsFileEnvironments();
     }
 }
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            if (e != null)
            {
                switch (e.ChangedReason)
                {
                case SolutionChangedReason.Load:
                    AddAll(GetTestFiles(e.Project));
                    break;

                case SolutionChangedReason.Unload:
                    RemoveAll(GetTestFiles(e.Project));
                    break;
                }
            }
        }
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            if (e != null)
            {
                var files = FindPs1Files(e.Project);
                if (e.ChangedReason == SolutionChangedReason.Load)
                {
                    UpdateFileWatcher(files, true);
                }
                else if (e.ChangedReason == SolutionChangedReason.Unload)
                {
                    UpdateFileWatcher(files, false);
                }
            }

            // Do not fire OnTestContainersChanged here.
            // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception.
            // The UTE will query all the TestContainerDiscoverers once the solution is loaded.
        }
예제 #5
0
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            _logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer:OnSolutionProjectChanged");
            if (e != null)
            {
                IEnumerable <string> files = FindPowerShellTestFiles(e.Project);
                if (e.ChangedReason == SolutionChangedReason.Load)
                {
                    _logger.Log(MessageLevel.Diagnostic,
                                "PowerShellTestContainerDiscoverer:OnTestContainersChanged - Change reason is load");
                    UpdateFileWatcher(files, true);
                }
                else if (e.ChangedReason == SolutionChangedReason.Unload)
                {
                    _logger.Log(MessageLevel.Diagnostic,
                                "PowerShellTestContainerDiscoverer:OnTestContainersChanged - Change reason is unload");
                    UpdateFileWatcher(files, false);
                }
            }

            // Do not fire OnTestContainersChanged here.
            // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception.
            // The UTE will query all the TestContainerDiscoverers once the solution is loaded.
        }
        /// <summary>
        /// Handler to react to project load/unload events.
        /// </summary>
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            if (e != null)
            {
                var files = FindPotentialTestFiles(e.Project);
                if (e.ChangedReason == SolutionChangedReason.Load)
                {
                    UpdateTestContainersAndFileWatchers(files, true);
                }
                else if (e.ChangedReason == SolutionChangedReason.Unload)
                {
                    UpdateTestContainersAndFileWatchers(files, false);
                }
            }

            // Do not fire OnTestContainersChanged here.
            // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception.
            // The UTE will query all the TestContainerDiscoverers once the solution is loaded.
        }
        /// <summary>
        /// Handler to react to project load/unload events.
        /// </summary>
        private void OnSolutionProjectChanged(object sender, SolutionEventsListenerEventArgs e)
        {
            if (e != null)
            {
                string projectPath = VsSolutionHelper.GetProjectPath(e.Project);

                var files = FindPotentialTestFiles(e.Project);
                if (e.ChangedReason == SolutionChangedReason.Load)
                {
                    ChutzpahTracer.TraceInformation("Project Loaded: '{0}'", projectPath);
                    UpdateChutzpahEnvironmentForProject(projectPath);
                    UpdateTestContainersAndFileWatchers(files, true);
                }
                else if (e.ChangedReason == SolutionChangedReason.Unload)
                {
                    ChutzpahTracer.TraceInformation("Project Unloaded: '{0}'", projectPath);
                    RemoveChutzpahEnvironmentForProject(projectPath);
                    UpdateTestContainersAndFileWatchers(files, false);

                }
            }

            // Do not fire OnTestContainersChanged here.
            // This will cause us to fire this event too early before the UTE is ready to process containers and will result in an exception.
            // The UTE will query all the TestContainerDiscoverers once the solution is loaded.
        }