• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TaskExecutionNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CanExecuteRecursive

        private void CanExecuteRecursive()
        {
            var remoteTaskServer = Substitute.For<IRemoteTaskServer>();

            var taskRunner = new TaskRunner(remoteTaskServer);
            var remoteTask = Substitute.For<RemoteTask>("RemoteTask");
            var node = new TaskExecutionNode(null, remoteTask);
            taskRunner.ExecuteRecursive(node);

            remoteTaskServer.Received().TaskStarting(Arg.Any<RemoteTask>());
            remoteTaskServer.Received().TaskFinished(Arg.Any<RemoteTask>(), Arg.Any<string>(), TaskResult.Success);
        }
开发者ID:TylerCarlson1,项目名称:ReSharperFixieRunner,代码行数:12,代码来源:TaskRunnerTests.cs


示例17: CreateRunIntent

    private IRunIntent CreateRunIntent (TaskExecutionNode node)
    {
      var configuration = TaskExecutor.Configuration;

      var runTask = (RunTask) node.RemoteTask;
      var runIntent = RunIntent.Create(configuration.SeparateAppDomain, configuration.ShadowCopy, runTask.VisualStudioProcessId);
      _cancellationTokenSource = runIntent.CancellationTokenSource;

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

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


示例18: Execute

        public override TaskResult Execute(TaskExecutionNode node)
        {
            if (node.RemoteTask is RunScenarioTask)
            {
                var result = ExecuteScenario(node);
                if (result.Status != TaskResult.Success)
                    _result = result.Status;
                return result.Status;
            }

            return TaskResult.Success;
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:12,代码来源:StorEvilTaskRunner.cs


示例19: FlattenChildren

    static IEnumerable<TaskExecutionNode> FlattenChildren(TaskExecutionNode node)
    {
      foreach (var child in node.Children)
      {
        yield return child;

        foreach (var descendant in child.Children)
        {
          yield return descendant;
        }
      }
    }
开发者ID:nieve,项目名称:machine.specifications,代码行数:12,代码来源:RecursiveMSpecTaskRunner.cs


示例20: ExecuteRecursive

        public override void ExecuteRecursive(TaskExecutionNode node)
        {
            var asm = node.RemoteTask as NBehaveAssemblyTask;
            if (asm == null)
                return;
            Initialize(node);

            var featureTasks = GetFeatureTasks(node);
            NotifyTasksStarting(featureTasks.ToList());
            var runner = new TextRunner(config);
            runner.Run();
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:12,代码来源:NBehaveTaskRunner.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TaskFactory类代码示例发布时间:2022-05-24
下一篇:
C# TaskEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap