本文整理汇总了C#中IMethodInfo.GetXmlDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodInfo.GetXmlDocumentation方法的具体用法?C# IMethodInfo.GetXmlDocumentation怎么用?C# IMethodInfo.GetXmlDocumentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethodInfo
的用法示例。
在下文中一共展示了IMethodInfo.GetXmlDocumentation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeTest
/// <summary>
/// Initializes a test for a method after it has been added to the test model.
/// </summary>
/// <param name="methodScope">The method scope.</param>
/// <param name="method">The method.</param>
protected virtual void InitializeTest(IPatternScope methodScope, IMethodInfo method)
{
string xmlDocumentation = method.GetXmlDocumentation();
if (xmlDocumentation != null)
methodScope.TestBuilder.AddMetadata(MetadataKeys.XmlDocumentation, xmlDocumentation);
methodScope.Process(method);
if (method.IsGenericMethodDefinition)
{
foreach (IGenericParameterInfo parameter in method.GenericArguments)
methodScope.Consume(parameter, false, DefaultGenericParameterPattern);
}
foreach (IParameterInfo parameter in method.Parameters)
methodScope.Consume(parameter, false, DefaultMethodParameterPattern);
}
示例2: CreateMethodTest
private static MSTest CreateMethodTest(ITypeInfo typeInfo, IMethodInfo methodInfo)
{
MSTest methodTest = new MSTest(methodInfo.Name, methodInfo);
methodTest.Kind = TestKinds.Test;
methodTest.IsTestCase = true;
PopulateTestMethodMetadata(methodInfo, methodTest);
// Add XML documentation.
string xmlDocumentation = methodInfo.GetXmlDocumentation();
if (xmlDocumentation != null)
methodTest.Metadata.SetValue(MetadataKeys.XmlDocumentation, xmlDocumentation);
return methodTest;
}