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


C# ITestListener类代码示例

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


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

示例1: TdNetRunnerHelper

        public TdNetRunnerHelper(Assembly assembly, ITestListener testListener)
        {
            this.testListener = testListener;

            xunit = new Xunit2(new NullSourceInformationProvider(), assembly.GetLocalCodeBase());
            toDispose.Push(xunit);
        }
开发者ID:ansarisamer,项目名称:xunit,代码行数:7,代码来源:TdNetRunnerHelper.cs

示例2: TextUI

 /// <summary>
 /// Initializes a new instance of the <see cref="TextUI"/> class.
 /// </summary>
 /// <param name="writer">The TextWriter to use.</param>
 /// <param name="listener">The Test listener to use.</param>
 public TextUI(TextWriter writer, ITestListener listener)
 {
     // Set the default writer - may be overridden by the args specified
     this.writer = writer;
     this.runner = new NUnitLiteTestAssemblyRunner(new NUnitLiteTestAssemblyBuilder());
     this.listener = listener;
 }
开发者ID:xplatform,项目名称:Portable.NUnitLite,代码行数:12,代码来源:TextUI.cs

示例3: AdapterFacadeTestListener

        public AdapterFacadeTestListener(ITestListener testListener)
        {
            if (testListener == null)
                throw new ArgumentNullException("testListener");

            this.testListener = testListener;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:AdapterFacadeTestListener.cs

示例4: ValidateParameters

 private bool ValidateParameters(ITestListener listener, DataRow dataRow) {
    if(_expectedParameterNum == dataRow.Values.Length) {
       var parameters = MethodInfo.GetParameters();
       var paramValues = new object[parameters.Length];
       for(var i = 0; i < parameters.Length; i++) {
          try {
             paramValues[i] = Convert.ChangeType(dataRow.Values[i], parameters[i].ParameterType);
          }
          catch(InvalidCastException) {
             ReportError(listener, string.Format(
                "Parameter types don't match for DataRow({0}).",
                dataRow));
             return false;
          }
          catch(FormatException) {
             ReportError(listener, string.Format(
                "Parameter types don't match for DataRow({0}).",
                dataRow));
             return false;
          }
          catch(Exception ex) {
             ReportError(listener, "Failed to convert parameter." + ex.Message);
             return false;
          }
       }
       dataRow.Values = paramValues;
       return true;
    }
    ReportError(listener, string.Format("Each data row for {0} must have {1} values.",
                                        MethodInfo.Name, _expectedParameterNum));
    return false;
 }
开发者ID:ManfredLange,项目名称:csUnit,代码行数:32,代码来源:ParameterizedTestMethod.cs

示例5: AddListener

		public void AddListener (ITestListener listener)
		{
			lock (listeners.SyncRoot)
			{
				listeners.Add (listener);
			}
		}
开发者ID:kgardas,项目名称:virtuoso-opensource,代码行数:7,代码来源:TestResult.cs

示例6: RunMethod

        TestRunState ITdNetTestRunner.RunMember(ITestListener listener, Assembly assembly, MemberInfo member)
        {
            try
            {
                using (ExecutorWrapper wrapper = new ExecutorWrapper(new Uri(assembly.CodeBase).LocalPath, null, false))
                {
                    TdNetLogger logger = new TdNetLogger(listener, assembly);
                    TestRunner runner = new TestRunner(wrapper, logger);

                    MethodInfo method = member as MethodInfo;
                    if (method != null)
                        return RunMethod(runner, method);

                    Type type = member as Type;
                    if (type != null)
                        return RunClassWithInnerTypes(runner, type);

                    return TestRunState.NoTests;
                }
            }
            catch (ArgumentException)
            {
                return TestRunState.NoTests;
            }
        }
开发者ID:paulecoyote,项目名称:xunit,代码行数:25,代码来源:TdNetRunner.cs

示例7: RunMember

        public TestRunState RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
        {
            var method = member as MethodInfo;
            if (method != null)
            {
                if (method.IsDispose())
                {
                    var listener = new TestDrivenListener(testListener);
                    listener.CaseSkipped(new SkipResult(new Case(method), "Dispose() is not a test."));
                    return TestRunState.Success;
                }

                return Run(testListener, runner => runner.RunMethods(assembly, method));
            }

            var type = member as Type;
            if (type != null)
            {
                var types = GetTypeAndNestedTypes(type).ToArray();

                return Run(testListener, runner => runner.RunTypes(assembly, types));
            }

            return TestRunState.Error;
        }
开发者ID:JakeGinnivan,项目名称:fixie,代码行数:25,代码来源:TdNetRunner.cs

示例8:

        TestRunState ITestRunner.RunNamespace(ITestListener testListener, Assembly assembly, string ns)
        {
            return TestRunState.NoTests;

            //TODO: Fix filter. ns is probably equal to NamespaceFilter in StoryRunnerFilter
            //return Run(assembly, null, testListener);
        }
开发者ID:smhabdoli,项目名称:NBehave,代码行数:7,代码来源:NBehaveStoryRunner.cs

示例9: RunMember

    public TestRunState RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
    {
      var listener = new TDNetRunListener(testListener);
      var runner = new AppDomainRunner(listener, RunOptions.Default);
      runner.RunMember(assembly, member);

      return listener.TestRunState;
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:SpecificationRunner.cs

示例10: RunNamespace

    public TestRunState RunNamespace(ITestListener testListener, Assembly assembly, string ns)
    {
      var listener = new TDNetRunListener(testListener);
      var runner = new AppDomainRunner(listener, RunOptions.Default);
      runner.RunNamespace(assembly, ns);

      return listener.TestRunState;
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:SpecificationRunner.cs

示例11: RunNamespace

 public TestRunState RunNamespace(ITestListener testListener, Assembly assembly, string ns)
 {
     using (var helper = CreateHelper(testListener, assembly))
     {
         var testCases = helper.Discover().Where(tc => ns == null || tc.GetClass().Namespace == ns);
         return helper.Run(testCases);
     }
 }
开发者ID:ansarisamer,项目名称:xunit,代码行数:8,代码来源:TdNetRunner.cs

示例12: Run

 public virtual void Run(ITestListener listener)
 {
     listener.RunStarted();
     ITestExecutor executor = new _ITestExecutor_19(this, listener);
     Environments.RunWith(Environments.NewClosedEnvironment(new object[] {executor})
         , new _IRunnable_28(this, listener));
     listener.RunFinished();
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:TestRunner.cs

示例13: TdNetRunnerHelper

        public TdNetRunnerHelper(Assembly assembly, ITestListener testListener)
        {
            this.testListener = testListener;

            var assemblyFileName = assembly.GetLocalCodeBase();
            configuration = ConfigReader.Load(assemblyFileName);
            var diagnosticMessageSink = new DiagnosticMessageSink(testListener, Path.GetFileNameWithoutExtension(assemblyFileName), configuration.DiagnosticMessagesOrDefault);
            xunit = new Xunit2(configuration.AppDomainOrDefault, new NullSourceInformationProvider(), assemblyFileName, shadowCopy: false, diagnosticMessageSink: diagnosticMessageSink);
            toDispose.Push(xunit);
        }
开发者ID:commonsensesoftware,项目名称:xunit,代码行数:10,代码来源:TdNetRunnerHelper.cs

示例14: TextUI

        /// <summary>
        /// Initializes a new instance of the <see cref="TextUI"/> class.
        /// </summary>
        /// <param name="writer">The TextWriter to use.</param>
        /// <param name="listener">The Test listener to use.</param>
        public TextUI(TextWriter writer, ITestListener listener)
        {
            // Set the default writer - may be overridden by the args specified
            this.writer = writer;
            this.finallyDelegate = new FinallyDelegate();
            this.runner = new NUnitLiteTestAssemblyRunner(new NUnitLiteTestAssemblyBuilder(), this.finallyDelegate);
            this.listener = listener;


	    AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.TopLevelHandler);
        }
开发者ID:alexanderkyte,项目名称:NUnitLite,代码行数:16,代码来源:TextUI.cs

示例15: Run

        public TestRunState Run(ITestListener testListener, string assemblyFile, string cref)
        {
            if (testListener == null)
                throw new ArgumentNullException("testListener");
            if (assemblyFile == null)
                throw new ArgumentNullException("assemblyFile");

            FacadeOptions options = FacadeOptions.ReadFromRegistry();
            FacadeTestRunState result = TestRunner.Run(new AdapterFacadeTestListener(testListener), assemblyFile, cref, options);
            return FacadeUtils.ToTestRunState(result);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:11,代码来源:GallioResidentTestRunner.cs


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