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

C# ITestListener类代码示例

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

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



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


示例16: RunAssembly

        public TestRunState RunAssembly(ITestListener testListener, Assembly assembly)
        {
            if (testListener == null)
                throw new ArgumentNullException("testListener");
            if (assembly == null)
                throw new ArgumentNullException("assembly");

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


示例17: RunMember

        public TestRunState RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
        {
            using (var helper = CreateHelper(testListener, assembly))
            {
                if (member is Type)
                    return helper.RunClass((Type)member);
                if (member is MethodInfo)
                    return helper.RunMethod((MethodInfo)member);

                return TestRunState.NoTests;
            }
        }
开发者ID:ansarisamer,项目名称:xunit,代码行数:12,代码来源:TdNetRunner.cs


示例18: RunMember

        public TestRunState RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
        {
            var method = member as MethodInfo;
            if (method != null)
                return Run(testListener, runner => runner.RunMethod(assembly, method));

            var type = member as Type;
            if (type != null)
                return Run(testListener, runner => runner.RunType(assembly, type));

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


示例19: RunMember

        public new TestRunState RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
        {
            if (member.MemberType == MemberTypes.Constructor)
            {
                var where  = "(cat == '.current')";
                var result = this.Call<TestRunState>("run", testListener, assembly, where);
                if (result != TestRunState.NoTests) return result;

                return base.RunMember(testListener, assembly, member.DeclaringType);
            }

            return base.RunMember(testListener, assembly, member);
        }
开发者ID:ColinOrr,项目名称:penfold,代码行数:13,代码来源:TestRunner.cs


示例20: StartRun

        /// <summary>
        /// Run selected tests asynchronously, notifying the listener interface as it progresses.
        /// </summary>
        /// <param name="listener">Interface to receive EventListener notifications.</param>
        /// <returns></returns>
        public override void StartRun(ITestListener listener)
        {
#if !SILVERLIGHT && !NETCF
            _savedOut = Console.Out;
            _savedErr = Console.Error;

            Console.SetOut(new TextCapture(_savedOut));
            Console.SetError(new TextCapture(_savedErr));
#endif

            Context.Dispatcher = new SimpleWorkItemDispatcher();
            Context.Dispatcher.Dispatch(TopLevelWorkItem);
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:18,代码来源:NUnitLiteTestAssemblyRunner.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ITestMethod类代码示例发布时间:2022-05-24
下一篇:
C# ITestFrameworkDiscoveryOptions类代码示例发布时间: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