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


C# IMethodInfo.IsDefined方法代码示例

本文整理汇总了C#中IMethodInfo.IsDefined方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodInfo.IsDefined方法的具体用法?C# IMethodInfo.IsDefined怎么用?C# IMethodInfo.IsDefined使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMethodInfo的用法示例。


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

示例1: ParameterizedMethodSuite

 /// <summary>
 /// Construct from a MethodInfo
 /// </summary>
 /// <param name="method"></param>
 public ParameterizedMethodSuite(IMethodInfo method)
     : base(method.TypeInfo.FullName, method.Name)
 {
     Method = method;
     #if PORTABLE
     _isTheory = false;
     #else
     _isTheory = method.IsDefined<TheoryAttribute>(true);
     #endif
     this.MaintainTestOrder = true;
 }
开发者ID:yonglehou,项目名称:nunit,代码行数:15,代码来源:ParameterizedMethodSuite.cs

示例2: CanBuildFrom

 /// <summary>
 /// Determines if the method can be used to build an NUnit test
 /// test method of some kind. The method must normally be marked
 /// with an identifying attribute for this to be true.
 /// 
 /// Note that this method does not check that the signature
 /// of the method for validity. If we did that here, any
 /// test methods with invalid signatures would be passed
 /// over in silence in the test run. Since we want such
 /// methods to be reported, the check for validity is made
 /// in BuildFrom rather than here.
 /// </summary>
 /// <param name="method">An IMethodInfo for the method being used as a test method</param>
 /// <returns>True if the builder can create a test case from this method</returns>
 public bool CanBuildFrom(IMethodInfo method)
 {
     return method.IsDefined<ITestBuilder>(false)
         || method.IsDefined<ISimpleTestBuilder>(false);
 }
开发者ID:alfeg,项目名称:nunit,代码行数:19,代码来源:DefaultTestCaseBuilder.cs


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