本文整理汇总了C#中TestContext.GenerateAndVerifySource方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.GenerateAndVerifySource方法的具体用法?C# TestContext.GenerateAndVerifySource怎么用?C# TestContext.GenerateAndVerifySource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestContext
的用法示例。
在下文中一共展示了TestContext.GenerateAndVerifySource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BracketedIdentifierSimplificationTest
public void BracketedIdentifierSimplificationTest()
{
var expected = [email protected]"#Region ""{FeaturesResources.Assembly} mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089""
' mscorlib.v4_0_30319_17626.dll
#End Region
Imports System.Runtime
Imports System.Runtime.InteropServices
Namespace System
<__DynamicallyInvokableAttribute> <AttributeUsage(AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Enum Or AttributeTargets.Constructor Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field Or AttributeTargets.Event Or AttributeTargets.Interface Or AttributeTargets.Delegate, Inherited:=False)> <ComVisible(True)>
Public NotInheritable Class [|ObsoleteAttribute|]
Inherits Attribute
<__DynamicallyInvokableAttribute>
Public Sub New()
<__DynamicallyInvokableAttribute>
Public Sub New(message As String)
<__DynamicallyInvokableAttribute> <TargetedPatchingOptOut(""Performance critical to inline this type of method across NGen image boundaries"")>
Public Sub New(message As String, [error] As Boolean)
<__DynamicallyInvokableAttribute>
Public ReadOnly Property IsError As Boolean
<__DynamicallyInvokableAttribute>
Public ReadOnly Property Message As String
End Class
End Namespace";
using (var context = new TestContext(LanguageNames.VisualBasic))
{
context.GenerateAndVerifySource("System.ObsoleteAttribute", expected);
}
}
示例2: GenerateAndVerifySource
internal static void GenerateAndVerifySource(string metadataSource, string symbolName, string projectLanguage, string expected, bool compareTokens = true, bool includeXmlDocComments = false)
{
using (var context = new TestContext(projectLanguage, SpecializedCollections.SingletonEnumerable(metadataSource), includeXmlDocComments))
{
context.GenerateAndVerifySource(symbolName, expected, compareTokens);
}
}