当前位置: 首页>>代码示例>>C#>>正文


C# TaskExecutionNode类代码示例

本文整理汇总了C#中TaskExecutionNode的典型用法代码示例。如果您正苦于以下问题:C# TaskExecutionNode类的具体用法?C# TaskExecutionNode怎么用?C# TaskExecutionNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TaskExecutionNode类属于命名空间,在下文中一共展示了TaskExecutionNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTaskNotification

        public RemoteTaskNotification CreateTaskNotification(TaskExecutionNode node, ICollection<string> contexts)
        {
            var remoteTask = node.RemoteTask;

            if (remoteTask is RunAssemblyTask)
            {
                return new AssemblyRemoteTaskNotification(node);
            }

            if (remoteTask is ContextTask)
            {
                contexts.Add(((ContextTask)remoteTask).ContextTypeName);

                return new ContextRemoteTaskNotification(node);
            }

            if (remoteTask is ContextSpecificationTask)
            {
                return new ContextSpecificationRemoteTaskNotification(node);
            }

            if (remoteTask is BehaviorSpecificationTask)
            {
                return new BehaviorSpecificationRemoteTaskNotification(node);
            }

            return new SilentRemoteTaskNotification();
        }
开发者ID:JAllman,项目名称:machine.specifications.runner.resharper,代码行数:28,代码来源:RemoteTaskNotificationFactory.cs

示例2: CreateTaskNotification

    public RemoteTaskNotification CreateTaskNotification(TaskExecutionNode node)
    {
      var remoteTask = node.RemoteTask;

      if (remoteTask is RunAssemblyTask)
      {
        return new AssemblyRemoteTaskNotification(node);
      }
      
      if (remoteTask is ContextTask)
      {
        return new ContextRemoteTaskNotification(node);
      }

      if (remoteTask is ContextSpecificationTask)
      {
        return new ContextSpecificationRemoteTaskNotification(node);
      }

      if (remoteTask is BehaviorSpecificationTask)
      {
        return new BehaviorSpecificationRemoteTaskNotification(node);
      }

      return new SilentRemoteTaskNotification();
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:26,代码来源:RemoteTaskNotificationFactory.cs

示例3: CreateMethodNode

 private TaskExecutionNode CreateMethodNode(TaskExecutionNode classNode, Method method)
 {
     var methodNode = new TaskExecutionNode(classNode, method.Task);
     foreach (var theoryTask in method.TheoryTasks)
         methodNode.Children.Add(new TaskExecutionNode(methodNode, theoryTask));
     return methodNode;
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:7,代码来源:TestRun.cs

示例4: ExecuteRecursiveInternal

        private ExecutionResult ExecuteRecursiveInternal(TaskExecutionNode node)
        {
            Server.TaskStarting(node.RemoteTask);
            ExecutionResult result;
            try
            {
                if (node.RemoteTask is RunProjectTask)
                    SetUpScenarioExecutorForCurrentProject(node);

                if (node.RemoteTask is RunScenarioTask)
                    result = ExecuteScenario(node);
                else
                    result = ExecuteChildTasks(node);
            }
            catch (Exception ex)
            {
                Logger.Log(ex.ToString());
                Server.TaskOutput(node.RemoteTask, ex + "\r\n", TaskOutputType.STDOUT);
                result = new ExecutionResult(TaskResult.Error, ex.ToString());
            }
            if (!(node.RemoteTask is RunProjectTask))
                Server.TaskFinished(node.RemoteTask, result.Message, result.Status);

            return result;
        }
开发者ID:codereflection,项目名称:storevil,代码行数:25,代码来源:StorEvilTaskRunner.cs

示例5: ExecuteRecursive

        public override void ExecuteRecursive(TaskExecutionNode node)
        {
            //Debugger.Break();

            var assemblyProviders = new IAssemblyTaskProvider[]
            {
                new MsTestAssemblyTaskProvider(),
                new NUnitAssemblyTaskProvider(),
                new XUnitAssemblyTaskProvider()
            };
            var classProviders = new IClassTaskProvider[]
            {
                new MsTestClassTaskProvider(),
                new NUnitClassTaskProvider(),
                new XUnitClassTaskProvider()
            };
            var methodProviders = new IMethodTaskProvider[]
            {
                new MsTestMethodTaskProvider(),
                new NUnitMethodTaskProvider(),
                new XUnitMethodTaskProvider()
            };

            var taskEnvironment = new TaskEnvironment(Server, assemblyProviders, classProviders, methodProviders);
            var taskNode = new TaskNode(node, taskEnvironment);

            foreach (var silverlightTaskNode in taskNode.GetSilverlightTasks())
            {
                silverlightTaskNode.Execute(Execute);
            }
        }
开发者ID:tanangular,项目名称:AgUnit,代码行数:31,代码来源:SilverlightUnitTestTaskRunner.cs

示例6: GetName

        private static string GetName(TaskExecutionNode node)
        {
            var test = node.RemoteTask as TestTask;
            if (test != null) return test.Name;

            return null;
        }
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:7,代码来源:JUnitReporter.cs

示例7: TryRegisterSpecifications

 void TryRegisterSpecifications(TaskExecutionNode node)
 {
   if (node.RemoteTask is ContextSpecificationTask)
   {
     _listener.RegisterSpecification(new ExecutableSpecificationInfo(node));
   }
 }
开发者ID:benlovell,项目名称:machine.specifications,代码行数:7,代码来源:RecursiveMSpecTaskRunner.cs

示例8: Report

        public static void Report(XDocument doc, IRemoteTaskServer server, TaskExecutionNode node)
        {
            var testCases = Parse(doc);
            if (testCases == null) return;

            var testNodes = from n in node.Flatten(x => x.Children)
                where n.RemoteTask is TestTask
                select n;

            foreach (var testNode in testNodes)
            {
                var key = GetFullName(testNode);
                if (!testCases.ContainsKey(key)) continue;

                var testCase = testCases[key];
                var task = testNode.RemoteTask;

            #if RESHARPER_8
                if (testCase.Duration != null)
                {
                    server.TaskDuration(task, testCase.Duration.Value);
                }
            #endif

                server.TaskFinished(task, testCase.Error, testCase.TaskResult);
            }
        }
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:27,代码来源:JUnitReporter.cs

示例9: Start

    public override TaskResult Start(TaskExecutionNode node)
    {
      ContextTask task = (ContextTask) node.RemoteTask;
      
      _contextAssembly = LoadContextAssembly(task);
      if (_contextAssembly == null)
      {
        return TaskResult.Error;
      }

      _contextClass = _contextAssembly.GetType(task.ContextTypeName);
      if (_contextClass == null)
      {
        Server.TaskExplain(node.RemoteTask,
                           String.Format("Could not load type '{0}' from assembly {1}.",
                                         task.ContextTypeName,
                                         task.AssemblyLocation));
        Server.TaskError(node.RemoteTask, "Could not load context");
        return TaskResult.Error;
      }

      _listener = new PerContextRunListener(Server, node.RemoteTask);
      _runner = new DefaultRunner(_listener, RunOptions.Default);

      return TaskResult.Success;
    }
开发者ID:nieve,项目名称:machine.specifications,代码行数:26,代码来源:RecursiveMSpecTaskRunner.cs

示例10: Start

    public override TaskResult Start(TaskExecutionNode node)
    {
      var task = (RunAssemblyTask) node.RemoteTask;

      _contextAssembly = LoadContextAssembly(task);
      if (_contextAssembly == null)
      {
        return TaskResult.Error;
      }

      var result = VersionCompatibilityChecker.Check(_contextAssembly);
      if (!result.Success)
      {
        Server.TaskExplain(task, result.Explanation);
        Server.TaskError(task, result.ErrorMessage);

        return TaskResult.Error;
      }

      _listener = new PerAssemblyRunListener(Server, task);

      _runner = new DefaultRunner(_listener, RunOptions.Default, false);

      return TaskResult.Success;
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:25,代码来源:RecursiveMSpecTaskRunner.cs

示例11: ExecuteRecursive

        public override void ExecuteRecursive(TaskExecutionNode node)
        {
            var task = (RunAssemblyTask)node.RemoteTask;

            var priorCurrentDirectory = Environment.CurrentDirectory;
            try
            {
                // Use the assembly in the folder that the user has specified, or, if not, use the assembly location
                var assemblyFolder = GetAssemblyFolder(TaskExecutor.Configuration, task);
                var assemblyPath = new AssemblyPath(Path.Combine(assemblyFolder, GetFileName(task.AssemblyLocation)));

                Environment.CurrentDirectory = assemblyFolder;

                var listener = new PerAssemblyRunListener(Server, task);
                var contextList = new List<string>();
                node.Flatten(x => x.Children).Each(children => RegisterRemoteTaskNotifications(listener, children, contextList));

                var runOptions = RunOptions.Custom.FilterBy(contextList);
                var appDomainRunner = new AppDomainRunner(listener, runOptions);

                if (TaskExecutor.Configuration.ShadowCopy)
                {
                    string cachePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

                    runOptions.ShadowCopyTo(cachePath);
                    this.Server.SetTempFolderPath(cachePath);
                }

                appDomainRunner.RunAssembly(assemblyPath);
            }
            finally
            {
                Environment.CurrentDirectory = priorCurrentDirectory;
            }
        }
开发者ID:JAllman,项目名称:machine.specifications.runner.resharper,代码行数:35,代码来源:RecursiveMSpecTaskRunner.cs

示例12: CreateTaskNodes

 private TaskExecutionNode CreateTaskNodes()
 {
     var assemblyNode = new TaskExecutionNode(null, null);
     foreach (var @class in Classes)
         assemblyNode.Children.Add(CreateClassNode(assemblyNode, @class));
     return assemblyNode;
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:7,代码来源:TestRun.cs

示例13: CreateIntent

    private IIntent CreateIntent (TaskExecutionNode node)
    {
      var task = (Task) node.RemoteTask;
      var intent = Intent.Create(task.Identity);

      node.Children.Select(CreateIntent).ForEach(intent.AddIntent);

      return intent;
    }
开发者ID:igor-toporet,项目名称:TestFx,代码行数:9,代码来源:RecursiveRemoteTaskRunner.cs

示例14: ExecuteRecursive

 public override void ExecuteRecursive(TaskExecutionNode node)
 {
     try
     {
         _result = ExecuteRecursiveInternal(node).Status;
     }
     catch (Exception ex)
     {
         Logger.Log(ex.ToString());
     }
 }
开发者ID:codereflection,项目名称:storevil,代码行数:11,代码来源:StorEvilTaskRunner.cs

示例15: CreateClassNode

        private TaskExecutionNode CreateClassNode(TaskExecutionNode assemblyNode, Class @class)
        {
            var classNode = new TaskExecutionNode(assemblyNode, @class.ClassTask);

            if (ShouldAddMethods(@class))
            {
                foreach (var method in @class.Methods)
                    classNode.Children.Add(CreateMethodNode(classNode, method));
            }
            return classNode;
        }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:11,代码来源:TestRun.cs


注:本文中的TaskExecutionNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。