本文整理汇总了C#中ITypeInfo.GetTraits方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeInfo.GetTraits方法的具体用法?C# ITypeInfo.GetTraits怎么用?C# ITypeInfo.GetTraits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo.GetTraits方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExploreTestClass
private void ExploreTestClass(IProject project, IMetadataAssembly assembly, IUnitTestElementsObserver observer, ITypeInfo typeInfo, string typeName)
{
var classUnitTestElement = unitTestElementFactory.GetOrCreateTestClass(project, new ClrTypeName(typeName), assembly.Location.FullPath, typeInfo.GetTraits());
observer.OnUnitTestElement(classUnitTestElement);
// Don't create elements for [Fact] methods when the class has [RunWith]. This
// is because we don't know what the RunWith will do - it might not pay any
// attention to [Fact], and if we create the elements now, they won't be
// dynamic, and that can cause issues later
if (!TypeUtility.HasRunWith(typeInfo))
{
foreach (var methodInfo in TypeUtility.GetTestMethods(typeInfo))
ExploreTestMethod(project, classUnitTestElement, observer, methodInfo);
}
}