public IList <UnitTestTask> GetTaskSequence(ICollection <IUnitTestElement> explicitElements, IUnitTestLaunch launch) #endif { // Add the run task. Must always be first. var tasks = new List <UnitTestTask> { new UnitTestTask(null, FacadeTaskFactory.CreateRootTask()) }; // Add the test case branch. AddTestTasksFromRootToLeaf(tasks, this); // Now that we're done with the critical parts of the task tree, we can add other // arbitrary elements. We don't care about the structure of the task tree beyond this depth. // Add the assembly location. tasks.Add(new UnitTestTask(null, new AssemblyLoadTask(GetAssemblyLocation()))); tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateAssemblyTaskFrom(this))); if (explicitElements.Count() != 0) { // Add explicit element markers. foreach (GallioTestElement explicitElement in explicitElements) { tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateExplicitTestTaskFrom(explicitElement))); } } else { // No explicit elements but we must have at least one to filter by, so we consider // the top test explicitly selected. tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateExplicitTestTaskFrom(this))); } return(tasks); }
/// <summary> /// Gets task information for <see cref="T:JetBrains.ReSharper.TaskRunnerFramework.RemoteTaskRunner" /> from element. /// </summary> public IList <UnitTestTask> GetTaskSequence(UnitTestElement element, IList <UnitTestElement> explicitElements) { if (element == null) { throw new ArgumentNullException("element"); } if (explicitElements == null) { throw new ArgumentNullException("explicitElements"); } GallioTestElement topElement = (GallioTestElement)element; List <UnitTestTask> tasks = new List <UnitTestTask>(); // Add the run task. Must always be first. tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateRootTask())); // Add the test case branch. AddTestTasksFromRootToLeaf(tasks, topElement); // Now that we're done with the critical parts of the task tree, we can add other // arbitrary elements. We don't care about the structure of the task tree beyond this depth. // Add the assembly location. tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateAssemblyTaskFrom(topElement))); if (explicitElements.Count != 0) { // Add explicit element markers. foreach (GallioTestElement explicitElement in explicitElements) { tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateExplicitTestTaskFrom(explicitElement))); } } else { // No explicit elements but we must have at least one to filter by, so we consider // the top test explicitly selected. tasks.Add(new UnitTestTask(null, FacadeTaskFactory.CreateExplicitTestTaskFrom(topElement))); } return(tasks); }