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


C# Runner.SpecificationInfo类代码示例

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


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


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