public void Exec(EnvDTE.vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var runs = new List <OnDemandRun>();

            foreach (SelectedItem selectedItem in _applicationObject.SelectedItems)
            {
                try
                {
                    if (selectedItem.Project != null)
                    {
                        addItemsFor(runs, selectedItem.Project);
                    }
                    if (selectedItem.ProjectItem != null)
                    {
                        addItemFor(runs, selectedItem.ProjectItem);
                    }
                }
                catch
                {
                }
            }
            try
            {
                _peek(runs);
                if (!_manualBuild() || _buildRunner.Build(_getProjectsForBuild(runs)))
                {
                    _runTests(runs);
                }
            }
            catch (Exception ex)
            {
            }
        }
 public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     if (!_manualBuild() || _buildRunner.Build(_getLastTestRun().Select(x => x.Project)))
     {
         _runTests();
     }
 }
Ejemplo n.º 3
0
 private void manualRunAll()
 {
     if (_buildRunner.Build())
     {
         runTestsForSolution();
     }
 }
Ejemplo n.º 4
0
        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var pos = new OnDemandRunFromCursorPosition(_applicationObject);

            Core.DebugLog.Debug.WriteDebug("Looking for test at current position");
            var types = pos.FromCurrentPosition();

            if (types.Tests.Count() == 1 || types.Members.Count() == 1)
            {
                Core.DebugLog.Debug.WriteDebug("Found 1 test");
                Core.DebugLog.Debug.WriteDebug("Getting assembly for " + _applicationObject.ActiveDocument.ProjectItem.ContainingProject.FullName);
                var assembly = _getAssemblyFromProject(_applicationObject.ActiveDocument.ProjectItem.ContainingProject.FullName);
                if (assembly == null)
                {
                    return;
                }
                var test = types.Tests.Count() > 0 ? types.Tests.ElementAt(0) : types.Members.ElementAt(0);

                var testMessage = new CacheTestMessage(assembly, new Messages.TestResult(Messages.TestRunner.Any, Messages.TestRunStatus.Passed, test));
                Core.DebugLog.Debug.WriteDebug("Peeking at test message");
                _peek(testMessage);
                if (!_manualBuild() || _buildRunner.Build())
                {
                    Core.DebugLog.Debug.WriteDebug("Starting debug");
                    _debug(testMessage);
                }
            }
        }
 public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     if (!_manualBuild() || _buildRunner.Build())
     {
         _debug();
     }
 }
        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var pos   = new OnDemandRunFromCursorPosition(_applicationObject);
            var types = pos.FromCurrentPosition();

            _peek(types);
            if (!_manualBuild() || _buildRunner.Build(new[] { types.Project }))
            {
                _runTests(types);
            }
        }
Ejemplo n.º 7
0
        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var runs = new List <OnDemandRun>();

            foreach (Project project in _applicationObject.Solution.Projects)
            {
                addProjects(runs, project);
            }
            _peek(runs);
            if (!_manualBuild() || _buildRunner.Build())
            {
                _runTests(runs);
            }
        }
Ejemplo n.º 8
0
        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var method = new ElementNameFromCursorPosition(_application).Get();

            if (method == null)
            {
                return;
            }
            Logger.Write("Running tests related to " + method);
            if (_client.IsRunning || _buildRunner.Build())
            {
                _client.RunRelatedTestsFor(method);
            }
        }
Ejemplo n.º 9
0
        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var pos   = new OnDemandRunFromCursorPosition(_applicationObject);
            var types = pos.FromCurrentPosition();

            if (types.Tests.Count() == 1 || types.Members.Count() == 1)
            {
                var assembly = _getAssemblyFromProject(_applicationObject.ActiveDocument.ProjectItem.ContainingProject.FullName);
                if (assembly == null)
                {
                    return;
                }
                var test = types.Tests.Count() > 0 ? types.Tests.ElementAt(0) : types.Members.ElementAt(0);

                var testMessage = new CacheTestMessage(assembly, new Messages.TestResult(Messages.TestRunner.Any, Messages.TestRunStatus.Passed, test));
                _peek(testMessage);
                if (!_manualBuild() || _buildRunner.Build())
                {
                    var debugger = new DebugHandler(_applicationObject);
                    _debug(testMessage);
                }
            }
        }