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


C# TestContext.GenerateAndVerifySource方法代码示例

本文整理汇总了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);
                }
            }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:31,代码来源:MetadataAsSourceTests.VisualBasic.cs

示例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);
     }
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:AbstractMetadataAsSourceTests.cs


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