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

C# Runner.SpecificationInfo类代码示例

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

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



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

示例1: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            var formatter = resultFormatterFactory.GetResultFormatterFor(result);
            testListener.WriteLine(formatter.FormatResult(specification), Category.Output);

            var testResult = new TestResult();
            testResult.Name = specification.Name;
            if (result.Passed)
                testResult.State = TestState.Passed;
            else if (result.Status == Status.Ignored)
            {
                testResult.State = TestState.Ignored;
                testResult.Message = "Ignored";
            }
            else if (result.Status == Status.NotImplemented)
            {
                testResult.State = TestState.Ignored;
                testResult.Message = "Not Implemented";
            }
            else
            {
                testResult.State = TestState.Failed;
                if (result.Exception != null)
                    testResult.StackTrace = result.Exception.ToString();
            }

            testResults.Add(testResult);
        }
开发者ID:jayhill,项目名称:machine.specifications,代码行数:28,代码来源:TDNetRunListener.cs


示例2: OnSpecificationStart

        public void OnSpecificationStart(SpecificationInfo specification)
        {
            if (listenFor != null && !listenFor.Equals(specification.ToVisualStudioTestIdentifier(currentContext)))
                return;

            runListener.OnSpecificationStart(specification);
        }
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:7,代码来源:SingleBehaviorTestRunListenerWrapper.cs


示例3: OnSpecificationStart

 public void OnSpecificationStart(SpecificationInfo specification)
 {
     if (!_specificationTimer.IsRunning)
     {
         _specificationTimer.Restart();
     }
 }
开发者ID:machine,项目名称:machine.specifications,代码行数:7,代码来源:TimingRunListener.cs


示例4: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            if (listenFor != null && !listenFor.Equals(specification.ToVisualStudioTestIdentifier(currentContext)))
                return;

            runListener.OnSpecificationEnd(specification, result);
        }
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:7,代码来源:SingleBehaviorTestRunListenerWrapper.cs


示例5: OnSpecificationEnd

 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
   switch (result.Status)
   {
     case Status.Passing:
       _writer.WriteTestFinished(GetSpecificationName(specification), TimeSpan.Zero);
       break;
     case Status.NotImplemented:
       _writer.WriteTestIgnored(GetSpecificationName(specification), "(Not Implemented)");
       break;
     case Status.Ignored:
       _writer.WriteTestIgnored(GetSpecificationName(specification), "(Ignored)");
       break;
     default:
       if (result.Exception != null)
       {
         _writer.WriteTestFailed(GetSpecificationName(specification), 
           result.Exception.Message, result.Exception.StackTrace);
       }
       else
       {
         _writer.WriteTestFailed(GetSpecificationName(specification), "FAIL", "");
       }
       _failureOccured = true;
       break;
   }
 }
开发者ID:benlovell,项目名称:machine.specifications,代码行数:27,代码来源:TeamCityReporter.cs


示例6: OnSpecificationStart

    public void OnSpecificationStart(SpecificationInfo specification)
    {
      _specifications += 1;

      var notify = CreateTaskNotificationFor(specification);
      notify(task => _server.TaskStarting(task));
    }
开发者ID:ptomasroos,项目名称:machine.specifications,代码行数:7,代码来源:PerAssemblyRunListener.cs


示例7: OnSpecificationStart

    public void OnSpecificationStart(SpecificationInfo specification)
    {
      var notify = CreateTaskNotificationFor(specification);

      notify(task => _server.TaskStarting(task));
      notify(task => _server.TaskProgress(task, "Running specification"));
    }
开发者ID:bmavity,项目名称:machine.specifications,代码行数:7,代码来源:PerContextRunListener.cs


示例8: OnSpecificationEnd

    public void OnSpecificationEnd(SpecificationInfo specification, Result result)
    {
      switch (result.Status)
      {
        case Status.Passing:
          break;
        case Status.NotImplemented:
          _writer.WriteTestIgnored(GetSpecificationName(specification), "(Not Implemented)");
          break;
        case Status.Ignored:
          _writer.WriteTestIgnored(GetSpecificationName(specification), "(Ignored)");
          break;
        default:
          if (result.Exception != null)
          {
            _writer.WriteTestFailed(GetSpecificationName(specification),
                                    result.Exception.Message,
                                    result.Exception.ToString());
          }
          else
          {
            _writer.WriteTestFailed(GetSpecificationName(specification), "FAIL", "");
          }
          _failureOccurred = true;
          break;
      }
      var duration = TimeSpan.FromMilliseconds(_timingListener.GetSpecificationTime(specification));

      _writer.WriteTestFinished(GetSpecificationName(specification), duration);
    }
开发者ID:agross,项目名称:machine.specifications,代码行数:30,代码来源:TeamCityReporter.cs


示例9: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            string specName = GetContextSpecName(_currentContext, specification);

            switch (result.Status)
            {
                case Status.Passing:
                    break;
                case Status.Failing:
                    _messageProvider.TestFailed(specName,
                                                result.Exception.Message,
                                                result.Exception.StackTrace,
                                                result.Exception.FullTypeName);
                    break;
                case Status.Ignored:
                    _messageProvider.TestIgnored(specName, null);
                    break;
                case Status.NotImplemented:
                    _messageProvider.TestIgnored(specName, "Not implemented");
                    break;
                default:
                    break;
            }

            _messageProvider.TestFinished(specName);
        }
开发者ID:stephen-czetty,项目名称:nant-extensions,代码行数:26,代码来源:TeamCityRunListener.cs


示例10: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            _specificationRunCounter.IncrementSpecificationCount();
            if(result.Supplements.Any())
            {
                _outputAction(IndicateSupplement.ToString());
                return;
            }

            switch (result.Status)
            {
                case Status.Passing:
                    _specificationRunCounter.IncrementPasses();
                    _outputAction(IndicatePass.ToString());
                    break;
                case Status.Ignored:
                    _outputAction(IndicateIgnored.ToString());
                    break;
                case Status.NotImplemented:
                    _outputAction(IndicateNotImplemented.ToString());
                    break;
                default:
                    if(!_contextMap.ContainsKey(_currentContextName))
                    {
                        _contextMap.Add(_currentContextName, new List<SpecificationFailureDetails>());
                    }

                    var failedSpecName = specification != null ? specification.Name : "UNDEFINED SPECIFICATION";
                    var details = new SpecificationFailureDetails(failedSpecName, result.Exception.Message);
                    _specificationRunCounter.IncrementFailures();
                    _outputAction(IndicateFailure.ToString());
                    _contextMap[_currentContextName].Add(details);
                    break;
            }
        }
开发者ID:Huddle,项目名称:machine.specifications,代码行数:35,代码来源:TerseSpecFormatter.cs


示例11: ConvertSpecificationToTestCase

        private TestCase ConvertSpecificationToTestCase(SpecificationInfo specification, Settings settings)
        {
            VisualStudioTestIdentifier vsTestId = specification.ToVisualStudioTestIdentifier(currentContext);

            return new TestCase(vsTestId.FullyQualifiedName, this.executorUri, this.assemblyPath) {
                DisplayName = settings.DisableFullTestNameInOutput ? specification.Name : $"{this.currentContext?.TypeName}.{specification.FieldName}",
            };
        }
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:8,代码来源:VSProxyAssemblySpecificationRunListener.cs


示例12: Failed

 public void Failed(SpecificationInfo specification, Result result)
 {
   Color(ConsoleColor.Red, () =>
   {
     _inner.SpecificationStart(specification);
     _inner.Failed(specification, result);
   });
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:ColorOutput.cs


示例13: Ignored

 public void Ignored(SpecificationInfo specification)
 {
   Color(ConsoleColor.Yellow, () =>
   {
     _inner.SpecificationStart(specification);
     _inner.Ignored(specification);
   });
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:ColorOutput.cs


示例14: NotImplemented

 public void NotImplemented(SpecificationInfo specification)
 {
   Color(ConsoleColor.Gray, () =>
   {
     _inner.SpecificationStart(specification);
     _inner.NotImplemented(specification);
   });
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:ColorOutput.cs


示例15: Passing

 public void Passing(SpecificationInfo specification)
 {
   Color(ConsoleColor.Green, () =>
   {
     _inner.SpecificationStart(specification);
     _inner.Passing(specification);
   });
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:ColorOutput.cs


示例16: OnSpecificationStart

 public void OnSpecificationStart(SpecificationInfo specification)
 {
     string specificationName = specification.FieldName;
     string fullyQualifiedName = string.Format("{0}::{1}", specification.ContainingType, (object)specificationName);
     string displayName = specificationName.Replace("_", " ");
     this.RecordStart(fullyQualifiedName, displayName);
     this.currentRunStats = new RunStats();
 }
开发者ID:ivanz,项目名称:machine.vstestadapter,代码行数:8,代码来源:SpecificationRunListener.cs


示例17: GetSpecificationTime

        public long GetSpecificationTime(SpecificationInfo specificationInfo)
        {
            if (_specificationTimes.ContainsKey(specificationInfo))
            {
                return _specificationTimes[specificationInfo];
            }

            return -1;
        }
开发者ID:machine,项目名称:machine.specifications,代码行数:9,代码来源:TimingRunListener.cs


示例18: RecordFailure

    public void RecordFailure(ContextInfo context, SpecificationInfo specification, Result result)
    {
      if (!_failures.ContainsKey(context))
      {
        _failures.Add(context, new List<FailedSpecification>());
      }

      var entry = _failures[context];
      entry.Add(new FailedSpecification {Specification = specification, Result = result});
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:10,代码来源:FailedSpecificationsSummary.cs


示例19: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            if (this.currentRunStats != null)
                this.currentRunStats.Stop();

            TestCase testCase = ConvertSpecificationToTestCase(specification, this.settings);

            this.frameworkHandle.RecordEnd(testCase, MapSpecificationResultToTestOutcome(result));
            this.frameworkHandle.RecordResult(ConverResultToTestResult(testCase, result, this.currentRunStats));
        }
开发者ID:machine-visualstudio,项目名称:machine.vstestadapter,代码行数:10,代码来源:VSProxyAssemblySpecificationRunListener.cs


示例20: OnSpecificationStart

    public void OnSpecificationStart(SpecificationInfo specification)
    {
      RemoteTask task = FindTaskFor(specification);
      if (task == null)
      {
        return;
      }

      _server.TaskStarting(task);
      _server.TaskProgress(task, "Running specification");
    }
开发者ID:benlovell,项目名称:machine.specifications,代码行数:11,代码来源:PerContextRunListener.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MadViper.POrder类代码示例发布时间:2022-05-26
下一篇:
C# Runner.ContextInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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