[
  {
    "path": ".config/dotnet-tools.json",
    "content": "{\n  \"version\": 1,\n  \"isRoot\": true,\n  \"tools\": {\n    \"sign\": {\n      \"version\": \"0.9.1-beta.25330.2\",\n      \"commands\": [\n        \"sign\"\n      ],\n      \"rollForward\": false\n    }\n  }\n}"
  },
  {
    "path": ".editorconfig",
    "content": "# top-most EditorConfig file\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\nindent_style = tab\n\n[*.{ps1,sln}]\nend_of_line = crlf\n\n# Visual Studio demands 2-spaced project files\n# Tabs are not legal whitespace for YAML files\n[*.{csproj,json,props,targets,xslt,yaml,yml}]\nindent_style = space\nindent_size = 2\n\n[*.cs]\n# Organize usings\ndotnet_separate_import_directive_groups = false\ndotnet_sort_system_directives_first = true\nfile_header_template = unset\n\n# this. and Me. preferences\ndotnet_style_qualification_for_event = false\ndotnet_style_qualification_for_field = false\ndotnet_style_qualification_for_method = false\ndotnet_style_qualification_for_property = false\n\n# Language keywords vs BCL types preferences\ndotnet_style_predefined_type_for_locals_parameters_members = true\ndotnet_style_predefined_type_for_member_access = true\n\n# Parentheses preferences\ndotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity\ndotnet_style_parentheses_in_other_operators = never_if_unnecessary\ndotnet_style_parentheses_in_relational_binary_operators = always_for_clarity\n\n# Modifier preferences\ndotnet_style_require_accessibility_modifiers = for_non_interface_members\n\n# Expression-level preferences\ndotnet_style_coalesce_expression = true\ndotnet_style_collection_initializer = true\ndotnet_style_explicit_tuple_names = true\ndotnet_style_namespace_match_folder = false\ndotnet_style_null_propagation = true\ndotnet_style_object_initializer = true\ndotnet_style_operator_placement_when_wrapping = beginning_of_line\ndotnet_style_prefer_auto_properties = true\ndotnet_style_prefer_compound_assignment = true\ndotnet_style_prefer_conditional_expression_over_assignment = true\ndotnet_style_prefer_conditional_expression_over_return = false\ndotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed\ndotnet_style_prefer_inferred_anonymous_type_member_names = true\ndotnet_style_prefer_inferred_tuple_names = true\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true\ndotnet_style_prefer_simplified_boolean_expressions = true\ndotnet_style_prefer_simplified_interpolation = true\n\n# Field preferences\ndotnet_style_readonly_field = true\n\n# Parameter preferences\ndotnet_code_quality_unused_parameters = all\n\n# Suppression preferences\ndotnet_remove_unnecessary_suppression_exclusions = none\n\n# New line preferences\ndotnet_style_allow_multiple_blank_lines_experimental = true\ndotnet_style_allow_statement_immediately_after_block_experimental = true\n\n#### C# Coding Conventions ####\n\n# var preferences\ncsharp_style_var_elsewhere = true\ncsharp_style_var_for_built_in_types = true\ncsharp_style_var_when_type_is_apparent = true\n\n# Expression-bodied members\ncsharp_style_expression_bodied_accessors = true\ncsharp_style_expression_bodied_constructors = false\ncsharp_style_expression_bodied_indexers = true\ncsharp_style_expression_bodied_lambdas = true\ncsharp_style_expression_bodied_local_functions = false\ncsharp_style_expression_bodied_methods = false\ncsharp_style_expression_bodied_operators = false\ncsharp_style_expression_bodied_properties = true\n\n# Pattern matching preferences\ncsharp_style_pattern_matching_over_as_with_null_check = true\ncsharp_style_pattern_matching_over_is_with_cast_check = true\ncsharp_style_prefer_extended_property_pattern = true\ncsharp_style_prefer_not_pattern = true\ncsharp_style_prefer_pattern_matching = true\ncsharp_style_prefer_switch_expression = true\n\n# Null-checking preferences\ncsharp_style_conditional_delegate_call = true\n\n# Modifier preferences\ncsharp_prefer_static_local_function = true\ncsharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async\n\n# Code-block preferences\ncsharp_prefer_braces = false\ncsharp_prefer_simple_using_statement = true\ncsharp_style_namespace_declarations = file_scoped\n\n# Expression-level preferences\ncsharp_prefer_simple_default_expression = true\ncsharp_style_deconstructed_variable_declaration = true\ncsharp_style_implicit_object_creation_when_type_is_apparent = true\ncsharp_style_inlined_variable_declaration = true\ncsharp_style_pattern_local_over_anonymous_function = true\ncsharp_style_prefer_index_operator = true\ncsharp_style_prefer_null_check_over_type_check = true\ncsharp_style_prefer_range_operator = true\ncsharp_style_throw_expression = true\ncsharp_style_unused_value_assignment_preference = discard_variable\ncsharp_style_unused_value_expression_statement_preference = discard_variable\n\n# 'using' directive preferences\ncsharp_using_directive_placement = outside_namespace:warning\n\n# New line preferences\ncsharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true\ncsharp_style_allow_blank_lines_between_consecutive_braces_experimental = true\ncsharp_style_allow_embedded_statements_on_same_line_experimental = true\n\n#### C# Formatting Rules ####\n\n# New line preferences\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_else = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_anonymous_types = true\ncsharp_new_line_before_members_in_object_initializers = true\ncsharp_new_line_before_open_brace = all\ncsharp_new_line_between_query_expression_clauses = true\n\n# Indentation preferences\ncsharp_indent_block_contents = true\ncsharp_indent_braces = false\ncsharp_indent_case_contents = true\ncsharp_indent_case_contents_when_block = true\ncsharp_indent_labels = one_less_than_current\ncsharp_indent_switch_labels = true\n\n# Space preferences\ncsharp_space_after_cast = false\ncsharp_space_after_colon_in_inheritance_clause = true\ncsharp_space_after_comma = true\ncsharp_space_after_dot = false\ncsharp_space_after_keywords_in_control_flow_statements = true\ncsharp_space_after_semicolon_in_for_statement = true\ncsharp_space_around_binary_operators = before_and_after\ncsharp_space_around_declaration_statements = false\ncsharp_space_before_colon_in_inheritance_clause = true\ncsharp_space_before_comma = false\ncsharp_space_before_dot = false\ncsharp_space_before_open_square_brackets = false\ncsharp_space_before_semicolon_in_for_statement = false\ncsharp_space_between_empty_square_brackets = false\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\ncsharp_space_between_method_call_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_name_and_open_parenthesis = false\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\ncsharp_space_between_parentheses = false\ncsharp_space_between_square_brackets = false\n\n# Wrapping preferences\ncsharp_preserve_single_line_blocks = true\ncsharp_preserve_single_line_statements = true\n\n#### Naming styles ####\n\n# Naming rules\n\ndotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion\ndotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface\ndotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i\n\ndotnet_naming_rule.types_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.types_should_be_pascal_case.symbols = types\ndotnet_naming_rule.types_should_be_pascal_case.style = pascal_case\n\ndotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members\ndotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case\n\n# Symbol specifications\n\ndotnet_naming_symbols.interface.applicable_kinds = interface\ndotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.interface.required_modifiers =\n\ndotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum\ndotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.types.required_modifiers =\n\ndotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method\ndotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.non_field_members.required_modifiers =\n\n# Naming styles\n\ndotnet_naming_style.pascal_case.required_prefix =\ndotnet_naming_style.pascal_case.required_suffix =\ndotnet_naming_style.pascal_case.word_separator =\ndotnet_naming_style.pascal_case.capitalization = pascal_case\n\ndotnet_naming_style.begins_with_i.required_prefix = I\ndotnet_naming_style.begins_with_i.required_suffix =\ndotnet_naming_style.begins_with_i.word_separator =\ndotnet_naming_style.begins_with_i.capitalization = pascal_case\n\n#### Roslyn diagnostics ####\n\ndotnet_diagnostic.CA1000.severity  = none  # Do not declare static members on generic types\ndotnet_diagnostic.CA1002.severity  = none  # Do not expose generic lists\ndotnet_diagnostic.CA1014.severity  = none  # Mark assemblies with CLSCompliantAttribute\ndotnet_diagnostic.CA1034.severity  = none  # Do not nest types\ndotnet_diagnostic.CA1050.severity  = none  # Declare types in namespaces\ndotnet_diagnostic.CA1200.severity  = none  # Avoid using cref tags with a prefix\ndotnet_diagnostic.CA1303.severity  = none  # Do not pass literals as localized parameters\ndotnet_diagnostic.CA1707.severity  = none  # Remove the underscores from type name\ndotnet_diagnostic.CA1720.severity  = none  # Identifier contains type name\ndotnet_diagnostic.CA1724.severity  = none  # Type names should not match namespaces\ndotnet_diagnostic.CA1859.severity  = none  # Use concrete types when possible for improved performance\ndotnet_diagnostic.CA1861.severity  = none  # Avoid constant arrays as arguments\ndotnet_diagnostic.CA2211.severity  = none  # Non-constant fields should not be visible\ndotnet_diagnostic.CA2241.severity  = error # Provide correct arguments to formatting methods/The format argument is not a valid string\ndotnet_diagnostic.CS1591.severity  = none  # Missing XML comment\ndotnet_diagnostic.IDE0010.severity = none  # Populate switch\ndotnet_diagnostic.IDE0021.severity = none  # Use block body for method\ndotnet_diagnostic.IDE0022.severity = none  # Use block body for method\ndotnet_diagnostic.IDE0040.severity = none  # Add accessibility modifiers\ndotnet_diagnostic.IDE0058.severity = none  # Remove unnecessary expression value\ndotnet_diagnostic.IDE0072.severity = none  # Populate switch\ndotnet_diagnostic.IDE1006.severity = none  # Naming rule violation\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto eol=lf\n\n*.cs text diff=csharp\n*.csproj text merge=union\n*.ico binary\n*.resx text merge=union\n*.ps1 eol=crlf\n*.sln text eol=crlf merge=union\n*.snk binary\n*.vbproj text merge=union\n*.xls binary\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: xunit\n"
  },
  {
    "path": ".github/workflows/ci-signed.yaml",
    "content": "name: xUnit.net Analyzers CI Build (signed)\non:\n  push:\n    branches:\n      - main\n      - 'rel/**'\n  workflow_dispatch:\n\njobs:\n  deployment:\n    name: \"Build\"\n    runs-on: windows-latest\n    environment: signing\n    permissions:\n      id-token: write  # Required for Azure CLI Login\n    env:\n      DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true\n      DOTNET_NOLOGO: true\n    steps:\n      - name: Clone source\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          submodules: true\n\n      - name: Install .NET SDK\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: |\n            8.0.x\n            10.0.x\n\n      - name: Get .NET information\n        run: dotnet --info\n\n      - name: \"Build target: BuildAll\"\n        run: dotnet run --project tools/builder --no-launch-profile -- BuildAll --timing\n\n      - name: Login to Azure CLI\n        uses: azure/login@v2\n        with:\n          client-id: ${{ vars.KEYVAULT_APP_ID }}\n          tenant-id: ${{ vars.KEYVAULT_TENANT_ID }}\n          subscription-id: ${{ vars.KEYVAULT_SUBSCRIPTION_ID }}\n\n      - name: \"Build target: PublishPackages\"\n        env:\n          PUSH_APIKEY: ${{ secrets.FEEDZ_PUSH_KEY }}\n          PUSH_URI: ${{ vars.FEEDZ_PUSH_URL }}\n          SIGN_APP_ID: ${{ vars.KEYVAULT_APP_ID }}\n          SIGN_CERT_NAME: ${{ vars.KEYVAULT_CERT_NAME }}\n          SIGN_TIMESTAMP_URI: ${{ vars.KEYVAULT_TIMESTAMP_URL }}\n          SIGN_VAULT_URI: ${{ vars.KEYVAULT_URL }}\n        run: dotnet run --project tools/builder --no-launch-profile -- PublishPackages --timing\n\n      - name: \"Upload artifact: build\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: build\n          path: artifacts/build\n          compression-level: 9\n        if: always()\n\n      - name: \"Upload artifact: test\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: test\n          path: artifacts/test\n          compression-level: 9\n        if: always()\n\n      - name: \"Upload artifact: packages\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: packages\n          path: artifacts/packages\n          compression-level: 0\n        if: always()\n\n      - name: Publish Test Report\n        uses: ctrf-io/github-test-reporter@v1\n        with:\n          report-path: './artifacts/test/*.ctrf'\n          github-report: true\n        if: always()\n"
  },
  {
    "path": ".github/workflows/ci-unsigned.yaml",
    "content": "name: xUnit.net Analyzers CI Build (unsigned)\non:\n  push:\n    branches-ignore:\n      - main\n      - 'rel/**'\n  workflow_dispatch:\n\njobs:\n  build:\n    name: \"Build\"\n    runs-on: windows-latest\n    env:\n      DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true\n      DOTNET_NOLOGO: true\n    steps:\n      - name: Clone source\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          submodules: true\n\n      - name: Install .NET SDK\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: |\n            8.0.x\n            10.0.x\n\n      - name: Get .NET information\n        run: dotnet --info\n\n      - name: \"Build target: BuildAll\"\n        run: dotnet run --project tools/builder --no-launch-profile -- BuildAll --timing\n\n      - name: \"Upload artifact: test\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: test\n          path: artifacts/test\n          compression-level: 9\n        if: always()\n\n      - name: \"Upload artifact: packages\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: packages\n          path: artifacts/packages\n          compression-level: 0\n        if: always()\n\n      - name: Publish Test Report\n        uses: ctrf-io/github-test-reporter@v1\n        with:\n          report-path: './artifacts/test/*.ctrf'\n          github-report: true\n        if: always()\n"
  },
  {
    "path": ".github/workflows/pull-request.yaml",
    "content": "name: xUnit.net Analyzers PR Build\non:\n  - pull_request\n  - workflow_dispatch\n\njobs:\n  build:\n    name: \"Build\"\n    runs-on: ${{ matrix.os }}\n    env:\n      DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: true\n      DOTNET_NOLOGO: true\n    strategy:\n      fail-fast: false\n      matrix:\n        os: [windows-latest, ubuntu-latest, macOS-latest]\n    steps:\n      - name: Clone source\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          submodules: true\n\n      - name: Install .NET SDK\n        uses: actions/setup-dotnet@v4\n        with:\n          dotnet-version: |\n            8.0.x\n            10.0.x\n\n      - name: Get .NET information\n        run: dotnet --info\n\n      - name: Install Mono (Ubuntu)\n        run: >\n          sudo apt-get -y install apt-transport-https dirmngr gnupg ca-certificates software-properties-common &&\n          curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef' | sudo tee /etc/apt/trusted.gpg.d/mono-official-stable.asc &&\n          sudo apt-add-repository -y --no-update 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' &&\n          sudo apt-get update &&\n          sudo apt-get -y install mono-complete mono-vbnc\n        if: ${{ matrix.os == 'ubuntu-latest' }}\n\n      - name: Install Mono (macOS)\n        run: brew install mono\n        if: ${{ matrix.os == 'macOS-latest' }}\n\n      - name: Get Mono information\n        run: mono --version\n        if: ${{ matrix.os != 'windows-latest' }}\n\n      - name: \"Build target: BuildAll\"\n        run: dotnet run --project tools/builder --no-launch-profile -- BuildAll\n\n      - name: \"Upload artifact: test-${{ matrix.os }}\"\n        uses: actions/upload-artifact@v4\n        with:\n          name: test-${{ matrix.os }}\n          path: artifacts/test\n          compression-level: 9\n        if: always()\n\n      - name: Publish Test Report\n        uses: ctrf-io/github-test-reporter@v1\n        with:\n          report-path: './artifacts/test/*.ctrf'\n          github-report: true\n          pull-request: true\n          update-comment: true\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        if: always()\n"
  },
  {
    "path": ".gitignore",
    "content": "# Visual Studio\nlaunchSettings.json\n\n# NCrunch\n*.ncrunchsolution\n*.ncrunchsolution.user\n*.ncrunchproject\n\n# Mono's local registry\n.mono\n\n##### Copied from https://github.com/github/gitignore/blob/7b22f8ab6c85b4ef1469d72a8ba96462e2a44853/VisualStudio.gitignore\n\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore\n\n# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Mono auto generated files\nmono_crash.*\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n[Ww][Ii][Nn]32/\n[Aa][Rr][Mm]/\n[Aa][Rr][Mm]64/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n[Ll]ogs/\n\n# Visual Studio 2015/2017 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# Visual Studio 2017 auto generated files\nGenerated\\ Files/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# Benchmark Results\nBenchmarkDotNet.Artifacts/\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\n\n# ASP.NET Scaffolding\nScaffoldingReadMe.txt\n\n# StyleCop\nStyleCopReport.xml\n\n# Files built by Visual Studio\n*_i.c\n*_p.c\n*_h.h\n*.ilk\n*.meta\n*.obj\n*.iobj\n*.pch\n*.pdb\n*.ipdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*_wpftmp.csproj\n*.log\n*.tlog\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# Visual Studio Trace Files\n*.e2e\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# AxoCover is a Code Coverage Tool\n.axoCover/*\n!.axoCover/settings.json\n\n# Coverlet is a free, cross platform Code Coverage Tool\ncoverage*.json\ncoverage*.xml\ncoverage*.info\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# Note: Comment the next line if you want to checkin your web deploy settings,\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# NuGet Symbol Packages\n*.snupkg\n# The packages folder can be ignored because of Package Restore\n**/[Pp]ackages/*\n# except build/, which is used as an MSBuild target.\n!**/[Pp]ackages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/[Pp]ackages/repositories.config\n# NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!?*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Including strong name files can present a security risk\n# (https://github.com/github/gitignore/pull/2483#issue-259490424)\n#*.snk\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\nServiceFabricBackup/\n*.rptproj.bak\n\n# SQL Server files\n*.mdf\n*.ldf\n*.ndf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n*.rptproj.rsuser\n*- [Bb]ackup.rdl\n*- [Bb]ackup ([0-9]).rdl\n*- [Bb]ackup ([0-9][0-9]).rdl\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio 6 auto-generated project file (contains which files were open etc.)\n*.vbp\n\n# Visual Studio 6 workspace and project file (working project files containing files to include in project)\n*.dsw\n*.dsp\n\n# Visual Studio 6 technical files\n*.ncb\n*.aps\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# CodeRush personal settings\n.cr/personal\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools/**\n# !tools/packages.config\n\n# Tabs Studio\n*.tss\n\n# Telerik's JustMock configuration file\n*.jmconfig\n\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n\n# OpenCover UI analysis results\nOpenCover/\n\n# Azure Stream Analytics local run output\nASALocalRun/\n\n# MSBuild Binary and Structured Log\n*.binlog\n\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n\n# MFractors (Xamarin productivity tool) working folder\n.mfractor/\n\n# Local History for Visual Studio\n.localhistory/\n\n# Visual Studio History (VSHistory) files\n.vshistory/\n\n# BeatPulse healthcheck temp database\nhealthchecksdb\n\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup/\n\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide/\n\n# Fody - auto-generated XML schema\nFodyWeavers.xsd\n\n# VS Code files for those working on multiple tools\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n*.code-workspace\n\n# Local History for Visual Studio Code\n.history/\n\n# Windows Installer files from build outputs\n*.cab\n*.msi\n*.msix\n*.msm\n*.msp\n\n# JetBrains Rider\n*.sln.iml\n.idea/\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"tools/media\"]\n\tpath = tools/media\n\turl = https://github.com/xunit/media\n[submodule \"tools/builder/common\"]\n\tpath = tools/builder/common\n\turl = https://github.com/xunit/build-tools-v3\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": []\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n\t\"cSpell.words\": [\n\t\t\"LLMBRO\",\n\t\t\"MBRO\",\n\t\t\"app\",\n\t\t\"nuget\",\n\t\t\"nupkg\",\n\t\t\"parallelization\",\n\t\t\"veyor\"\n\t],\n\t\"files.exclude\": {\n\t\t\"**/.git\": true,\n\t\t\"**/.DS_Store\": true,\n\t\t\"**/bin\": true,\n\t\t\"**/obj\": true,\n\t\t\"artifacts\": true,\n\t\t\"packages\": true\n\t}\n}\n"
  },
  {
    "path": ".vscode/tasks.json",
    "content": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"label\": \"Build\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"tools/builder\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"Build\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Pre-PR Validation\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"tools/builder\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"Packages\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Unit Tests (.NET Core)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"tools/builder\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"TestCore\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Unit Tests (.NET Framework)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"tools/builder\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"TestFx\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "BUILDING.md",
    "content": "# Building xUnit.net Analyzers\n\nThe primary build system for xUnit.net Analyzers is done via command line, and officially supports Linux and Windows. Users running macOS can generally follow the Linux instructions (while installing the macOS equivalents of the dependencies).\n\n# Pre-Requisites\n\nYou will need the following software installed (regardless of OS):\n\n* [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0)\n* [git](https://git-scm.com/downloads)\n\n## Linux Pre-Requisites\n\nLinux users will additionally need:\n\n* [Mono](https://www.mono-project.com/download/stable/) 6.12+\n* [bash](https://www.gnu.org/software/bash/)\n\nNote: Linux users cannot run the .NET Framework tests, as they are incompatible. For this reason, we recommend that users either work primarily in Windows, or verify their tests work as expected in a Windows VM, before submitting PRs.\n\n## Windows Pre-Requisites\n\nWindows users will additionally need:\n\n* .NET Framework 4.7.2 or later (part of the Windows OS)\n* [PowerShell 7+](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows)\n\nEnsure that you have configured PowerShell to be able to run local unsigned scripts (either by running `Set-ExecutionPolicy RemoteSigned` from within PowerShell, or by launching PowerShell with the `-ExecutionPolicy RemoteSigned` command line switch).\n\n_Note that the built-in version of PowerShell may work, but is unsupported by us. If you have PowerShell-related issues, please make sure you have installed PowerShell 7+ and the command prompt you opened is for PowerShell 7+, and not the built-in version of PowerShell._\n\n# Command-Line Build\n\n1. **Linux users:** Open a terminal to your favorite shell.\n\n    **Windows users:** Open PowerShell 7+.\n\n1. From the root folder of the source repo, this command will build the code & run all tests:\n\n    `./build`\n\n    To build a specific target (or multiple targets):\n\n    `./build [target [target...]]`\n\n    The common targets (case-insensitive) include:\n\n    * `Restore`: Perform package restore\n    * `Build`: Build the source\n    * `Test`: Run all unit tests\n\n    You can get a list of options:\n\n    `./build --help`\n\n# Editing source\n\nThe primary projects for editing are:\n\n* `xunit.analyzers` (for code analysis)\n* `xunit.analyzers.fixes` (for automated fixes for issues raised in code analysis)\n* `xunit.analyzers.tests` (for unit tests of both above projects)\n\nThese are targeting our lowest common denominator for Roslyn (current version 3.11, the version that's supported in Visual Studio 2019 16.11).\n\nThere are also three projects which build against the latest version of Roslyn:\n\n* `xunit.analyzers.latest`\n* `xunit.analyzers.latest.fixes`\n* `xunit.analyzers.latest.tests`\n\nWhen running a command line build, we run a matrix of 4 test projects: Roslyn 3.11 vs. latest, and .NET Framework vs. .NET. It's important that you run `./build` (or `./build test`) from Windows before submitting PRs, because some bugs are often found only in one of the four combinations (and Mono cannot run the .NET Framework tests).\n\nYou will also occasionally see tests which only run in specific environments. Common `#if` statements you may see (or may need to use) include:\n\n* `#if NETFRAMEWORK` (only runs for .NET Framework)\n* `#if NETCOREAPP` (only runs for .NET)\n* `#if ROSLYN_LATEST` (only runs with latest Roslyn, which includes getting analysis test support to C# language > version 9)\n\nIn production code, we try to minimize these when possible, and prefer to fall back to use dynamic runtime environment detection when we can (as we'd like to light up features in newer versions of Roslyn when available). While this isn't always possible, it is generally a goal we try to achieve. In test code, we tend to use these to more frequently to ensure we have complete coverage of features that should be available dynamically (whether they are lit up based on `#if` or by runtime environment detection).\n"
  },
  {
    "path": "LICENSE",
    "content": "Unless otherwise noted, the source code here is covered by the following license:\n\n\tCopyright (c) .NET Foundation and Contributors\n\tAll Rights Reserved\n\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\n\t\thttp://www.apache.org/licenses/LICENSE-2.0\n\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n\nThe source in src/xunit.analyzers.tests/Utilities/XunitVerifier.cs was adapted from code\nthat is covered the following license (copied from\nhttps://github.com/dotnet/roslyn-sdk/blob/35d5e46fd5c403194692c645d912a17d36ed74f5/LICENSE.txt):\n\n\tThe MIT License (MIT)\n\n\tCopyright (c) .NET Foundation and Contributors\n\n\tAll rights reserved.\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in all\n\tcopies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\tSOFTWARE.\n"
  },
  {
    "path": "NuGet.Config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <packageSources>\n    <clear />\n    <add key=\"nuget.org\" value=\"https://api.nuget.org/v3/index.json\" protocolVersion=\"3\" />\n    <add key=\"feedz.io/xunit/xunit\" value=\"https://f.feedz.io/xunit/xunit/nuget/index.json\" protocolVersion=\"3\" />\n  </packageSources>\n</configuration>\n"
  },
  {
    "path": "README.md",
    "content": "# About This Project\n\nThis project contains source code analysis and cleanup rules for xUnit.net. Analysis and fixes are only supported with C#.\n\n**Requirements**: xUnit.net v2 or v3. Supported in Visual Studio 2019, 2022, and 2026 (as well as via command line builds with Roslyn 3.11+). Other environments (such as Mono or JetBrains Rider) may be able to use these analyzers as well; support and issue resolution will be provided by those third parties and not by xUnit.net itself.\n\n**Documentation**: a list of supported rules is available at https://xunit.net/xunit.analyzers/rules/\n\n**Bugs and issues**: please visit the [core xUnit.net project issue tracker](https://github.com/xunit/xunit/issues).\n\n**Building**: see [BUILDING.md](https://github.com/xunit/xunit.analyzers/blob/main/BUILDING.md).\n\n> _**Note:** Our minimum supported versions of Visual Studio 2019, 2022, and 2026 align with the \"Baseline\" column of the \"Support for Older Versions\" table of [Visual Studio Product Lifecycle and Servicing](https://learn.microsoft.com/visualstudio/releases/2026/servicing-vs#support-for-older-versions), as these are the minimum versions supported by Microsoft. If you are experiencing issues with an older version of Visual Studio, please upgrade and verify the issue still exists before opening issues._\n\n## How to install\n\n- xUnit.net v3: the analyzer package is referenced by the main [`xunit.v3` NuGet package](https://www.nuget.org/packages/xunit.v3) out of the box. If you choose to reference [`xunit.v3.core`](https://www.nuget.org/packages/xunit.v3.core) instead, you can reference [`xunit.analyzers`](https://www.nuget.org/packages/xunit.analyzers) explicitly.\n\n- xUnit.net v2 2.3.0 and higher: the analyzer package is referenced by the main [`xunit` NuGet package](https://www.nuget.org/packages/xunit) out of the box. If you choose to reference [`xunit.core`](https://www.nuget.org/packages/xunit.core) instead, you can reference [`xunit.analyzers`](https://www.nuget.org/packages/xunit.analyzers) explicitly.\n\n- xUnit.net v2 2.2.0 and earlier: you have to install the [`xunit.analyzers` NuGet package](https://www.nuget.org/packages/xunit.analyzers) explicitly.\n\n## How to uninstall\n\n- If you are using xUnit.net v3 and do not wish to use the analyzers package, replace the package reference to [`xunit.v3`](https://www.nuget.org/packages/xunit.v3) with the corresponding versions of [`xunit.v3.core`](https://www.nuget.org/packages/xunit.v3.core) and [`xunit.v3.assert`](https://www.nuget.org/packages/xunit.v3.assert).\n\n- If you are using xUnit.net v2 2.3.0 or higher and do not wish to use the analyzers package, replace the package reference to [`xunit`](https://www.nuget.org/packages/xunit) with the corresponding versions of [`xunit.core`](https://www.nuget.org/packages/xunit.core) and [`xunit.assert`](https://www.nuget.org/packages/xunit.assert).\n\n- If you are using xUnit.net v2 v2.2.0 or earlier: remove the reference to the [`xunit.analyzers` NuGet package](https://www.nuget.org/packages/xunit.analyzers).\n\n## Analysis and Code Fix in Action\n\n![Analyzer in action animation](https://cloud.githubusercontent.com/assets/607223/25752060/fb4af444-316b-11e7-9e7c-fc69ade132fb.gif)\n\n# About xUnit.net\n\nxUnit.net is a free, open source, community-focused unit testing tool for C#, F#, and Visual Basic.\n\nxUnit.net works with the [.NET SDK](https://dotnet.microsoft.com/download) command line tools, [Visual Studio](https://visualstudio.microsoft.com/), [Visual Studio Code](https://code.visualstudio.com/), [JetBrains Rider](https://www.jetbrains.com/rider/), [NCrunch](https://www.ncrunch.net/), and any development environment compatible with [Microsoft Testing Platform](https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-intro) (xUnit.net v3) or [VSTest](https://github.com/microsoft/vstest) (all versions of xUnit.net).\n\nxUnit.net is part of the [.NET Foundation](https://www.dotnetfoundation.org/) and operates under their [code of conduct](https://www.dotnetfoundation.org/code-of-conduct). It is licensed under [Apache 2](https://opensource.org/licenses/Apache-2.0) (an OSI approved license). The project is [governed](https://xunit.net/governance) by a Project Lead.\n\nFor project documentation, please visit the [xUnit.net project home](https://xunit.net/).\n\n* _New to xUnit.net? Get started with the [.NET SDK](https://xunit.net/docs/getting-started/v3/getting-started)._\n* _Need some help building the source? See [BUILDING.md](https://github.com/xunit/xunit/tree/main/BUILDING.md)._\n* _Want to contribute to the project? See [CONTRIBUTING.md](https://github.com/xunit/.github/tree/main/CONTRIBUTING.md)._\n* _Want to contribute to the assertion library? See the [suggested contribution workflow](https://github.com/xunit/assert.xunit/tree/main/README.md#suggested-contribution-workflow) in the assertion library project, as it is slightly more complex due to code being spread across two GitHub repositories._\n\n## Latest Builds\n\n|                             | Latest stable                                                                                                                            | Latest CI ([how to use](https://xunit.net/docs/using-ci-builds))                                                                                                                                                              | Build status\n| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------\n| `xunit.v3`                  | [![](https://img.shields.io/nuget/v/xunit.v3.svg?logo=nuget)](https://www.nuget.org/packages/xunit.v3)                                   | [![](https://img.shields.io/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.v3/latest&logo=nuget&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.v3)                                   | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit/goto?ref=main)\n| `xunit`                     | [![](https://img.shields.io/nuget/v/xunit.svg?logo=nuget)](https://www.nuget.org/packages/xunit)                                         | [![](https://img.shields.io/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit/latest&logo=nuget&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit)                                         | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit/badge%3Fref%3Dv2&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit/goto?ref=v2)\n| `xunit.analyzers`           | [![](https://img.shields.io/nuget/v/xunit.analyzers.svg?logo=nuget)](https://www.nuget.org/packages/xunit.analyzers)                     | [![](https://img.shields.io/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.analyzers/latest&logo=nuget&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.analyzers)                     | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/xunit.analyzers/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/xunit.analyzers/goto?ref=main)\n| `xunit.runner.visualstudio` | [![](https://img.shields.io/nuget/v/xunit.runner.visualstudio.svg?logo=nuget)](https://www.nuget.org/packages/xunit.runner.visualstudio) | [![](https://img.shields.io/endpoint.svg?url=https://f.feedz.io/xunit/xunit/shield/xunit.runner.visualstudio/latest&logo=nuget&color=f58142)](https://feedz.io/org/xunit/repository/xunit/packages/xunit.runner.visualstudio) | [![](https://img.shields.io/endpoint.svg?url=https://actions-badge.atrox.dev/xunit/visualstudio.xunit/badge%3Fref%3Dmain&amp;label=build)](https://actions-badge.atrox.dev/xunit/visualstudio.xunit/goto?ref=main)\n\n*For complete CI package lists, please visit the [feedz.io package search](https://feedz.io/org/xunit/repository/xunit/search). A free login is required.*\n\n## Sponsors\n\nHelp support this project by becoming a sponsor through [GitHub Sponsors](https://github.com/sponsors/xunit).\n"
  },
  {
    "path": "build",
    "content": "#!/usr/bin/env bash\nset -euo pipefail\n\nPUSHED=0\n\ncleanup () {\n\tif [[ $PUSHED == 1 ]]; then\n\t\tpopd >/dev/null\n\t\tPUSHED=0\n\tfi\n}\n\ntrap cleanup EXIT ERR INT TERM\n\nif which git > /dev/null; then\n\tgit submodule status | while read line; do\n\t\tif [ \"$(echo $line | cut -b1)\" == \"-\" ]; then\n\t\t\tpieces=( $line )\n\t\t\tgit submodule update --init ${pieces[1]}\n\t\t\techo \"\"\n\t\tfi\n\tdone\nelse\n\techo \"error(1): Could not find 'git'; please install the Git CLI\" 2>&1\n\texit 1\nfi\n\nif which dotnet > /dev/null; then\n\tif [ $(dotnet --version | cut -d. -f1) -lt 8 ]; then\n\t\techo \"error(1): .NET SDK version $(dotnet --version) is too low; please install 8.0 or later\"\n\t\texit 1\n\tfi\n\n\tif [ `uname -o` = Msys ] || which mono > /dev/null ; then\n\t\tpushd $( cd \"$(dirname \"$0\")\" ; pwd -P ) >/dev/null\n\t\tPUSHED=1\n\n\t\tdotnet run --project tools/builder --no-launch-profile -- \"$@\"\n\telse\n\t\techo \"error(1): Could not find 'mono'; please install Mono\" 2>&1\n\t\texit 1\n\tfi\nelse\n\techo \"error(1): Could not find 'dotnet'; please install the .NET Core SDK\" 2>&1\n\texit 1\nfi\n"
  },
  {
    "path": "build.ps1",
    "content": "#!/usr/bin/env pwsh\r\n#Requires -Version 5.1\r\n\r\nSet-StrictMode -Version Latest\r\n$ErrorActionPreference = \"Stop\"\r\n\r\nif ($null -eq (Get-Command \"git\" -ErrorAction Ignore)) {\r\n\tthrow \"Could not find 'git'; please install the Git command line tooling\"\r\n}\r\n\r\n& git submodule status | ForEach-Object {\r\n\tif ($_[0] -eq '-') {\r\n\t\t$pieces = $_.Split(' ')\r\n\t\t& git submodule update --init \"$($pieces[1])\"\r\n\t\tWrite-Host \"\"\r\n\t}\r\n}\r\n\r\nif ($null -eq (Get-Command \"dotnet\" -ErrorAction Ignore)) {\r\n\tthrow \"Could not find 'dotnet'; please install the  .NET Core SDK\"\r\n}\r\n\r\n$version = [Version]$([regex]::matches((&dotnet --version), '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)').value)\r\nif ($version.Major -lt 8) {\r\n\tthrow \".NET SDK version ($version) is too low; please install version 8.0 or later\"\r\n}\r\n\r\nPush-Location (Split-Path $MyInvocation.MyCommand.Definition)\r\n\r\ntry {\r\n\t& dotnet run --project tools/builder --no-launch-profile -- $args\r\n}\r\nfinally {\r\n\tPop-Location\r\n}\r\n"
  },
  {
    "path": "global.json",
    "content": "{\n  \"sdk\": {\n    \"version\": \"10.0.100\",\n    \"rollForward\": \"latestMinor\"\n  }\n}\n"
  },
  {
    "path": "src/Directory.Build.props",
    "content": "<Project>\n\n  <!-- ============================== -->\n  <!-- Universal properties and items -->\n\n  <PropertyGroup>\n    <AnnotatedReferenceAssemblyVersion>8.0.10</AnnotatedReferenceAssemblyVersion>\n    <ContinuousIntegrationBuild Condition=\" '$(GITHUB_ACTIONS)' == 'true' \">true</ContinuousIntegrationBuild>\n    <DebugType>embedded</DebugType>\n    <EmbedUntrackedSources>true</EmbedUntrackedSources>\n    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>\n    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>\n    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>\n    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>\n    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>\n    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>\n    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>\n    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>\n    <GenerateDocumentationFile>true</GenerateDocumentationFile>\n    <LangVersion>14.0</LangVersion>\n    <MicrosoftCodeAnalysisVersion Condition=\" '$(MicrosoftCodeAnalysisVersion)' == '' \">3.11</MicrosoftCodeAnalysisVersion>\n    <MSBuildCopyContentTransitively>false</MSBuildCopyContentTransitively>\n    <Nullable>enable</Nullable>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"$(MSBuildThisFileDirectory)common\\*.cs\" LinkBase=\"Utility\\Common\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Analyzers\" Version=\"[$(MicrosoftCodeAnalysisVersion)]\" />\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"[$(MicrosoftCodeAnalysisVersion)]\" />\n    <PackageReference Include=\"Microsoft.SourceLink.GitHub\" Version=\"10.0.102\" PrivateAssets=\"all\" />\n    <PackageReference Include=\"Nerdbank.GitVersioning\" Version=\"3.9.50\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <!-- ======================================== -->\n  <!-- Production-specific properties and items -->\n\n  <Choose>\n    <When Condition=\" !$(MSBuildProjectName.Contains('.tests')) \">\n      <PropertyGroup>\n        <AnalysisLevel>latest-All</AnalysisLevel>\n        <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)signing.snk</AssemblyOriginatorKeyFile>\n        <EnableNETAnalyzers>true</EnableNETAnalyzers>\n        <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>\n        <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>\n        <SignAssembly>true</SignAssembly>\n      </PropertyGroup>\n    </When>\n  </Choose>\n\n  <!-- ================================== -->\n  <!-- Test-specific properties and items -->\n\n  <Choose>\n    <When Condition=\" $(MSBuildProjectName.Contains('.tests')) \">\n      <PropertyGroup>\n        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n        <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n        <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>\n        <CopyNuGetImplementations>true</CopyNuGetImplementations>\n        <DefineConstants>$(DefineConstants);XUNIT_NULLABLE;XUNIT_POINTERS;XUNIT_VISIBILITY_INTERNAL</DefineConstants>\n        <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>\n        <GenerateDependencyFile>true</GenerateDependencyFile>\n        <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>\n      </PropertyGroup>\n\n      <ItemGroup>\n        <Content Include=\"$(MSBuildThisFileDirectory)xunit.analyzers.tests\\xunit.runner.json\" CopyToOutputDirectory=\"PreserveNewest\" />\n      </ItemGroup>\n\n      <ItemGroup>\n        <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.CodeFix.Testing\" Version=\"1.1.3\" />\n        <PackageReference Include=\"NSubstitute\" Version=\"5.3.0\" />\n        <PackageReference Include=\"System.ValueTuple\" Version=\"4.6.1\" />\n        <PackageReference Include=\"xunit.v3.assert.source\" Version=\"[3.2.2-pre.18, 3.99.0)\" />\n        <PackageReference Include=\"xunit.v3.core\" Version=\"[3.2.2-pre.18, 3.99.0)\" />\n      </ItemGroup>\n\n    </When>\n  </Choose>\n\n</Project>\n"
  },
  {
    "path": "src/Directory.Build.targets",
    "content": "<Project>\n\n  <!-- Enable building .NET Framework on non-Windows machines -->\n  <ItemGroup Condition=\" '$(TargetFrameworkIdentifier)' == '.NETFramework' \">\n    <PackageReference Include=\"Microsoft.NETFramework.ReferenceAssemblies\" Version=\"1.0.3\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <!-- Enable nullable support for older targets -->\n  <ItemGroup Condition=\" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFrameworkIdentifier)' == '.NETFramework' \">\n    <PackageReference Include=\"TunnelVisionLabs.ReferenceAssemblyAnnotator\" Version=\"1.0.0-alpha.160\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageDownload Include=\"Microsoft.NETCore.App.Ref\" Version=\"[$(AnnotatedReferenceAssemblyVersion)]\" />\n  </ItemGroup>\n\n  <!-- Supplement Nerdbank.GitVersioning version calculations -->\n  <Target Name=\"UpdateAssemblyVersionInfo\" BeforeTargets=\"GenerateAssemblyNBGVVersionInfo\" DependsOnTargets=\"GetBuildVersion\">\n    <PropertyGroup>\n      <!-- Local builds should have a '-dev' suffix on the build number -->\n      <PrereleaseSuffix Condition=\" '$(GITHUB_ACTIONS)' != 'true' \">-dev</PrereleaseSuffix>\n      <!-- AssemblyVersion and AssemblyFileVersion should be x.y.z.0 -->\n      <AssemblyVersion>$(BuildVersionSimple)</AssemblyVersion>\n      <AssemblyFileVersion>$(BuildVersionSimple)</AssemblyFileVersion>\n      <!-- Always put the Git hash in the informational version, even for non-pre-release versions -->\n      <AssemblyInformationalVersion>$(BuildVersionSimple)$(PrereleaseVersion)$(PrereleaseSuffix)+$(GitCommitIdShort)</AssemblyInformationalVersion>\n    </PropertyGroup>\n  </Target>\n\n  <Target Name=\"UpdateNuSpecProperties\" BeforeTargets=\"GenerateNuspec\" DependsOnTargets=\"GetBuildVersion\">\n    <PropertyGroup>\n      <SignedPath />\n      <SignedPath Condition=\" '$(SIGN_APP_ID)' != '' \">signed\\</SignedPath>\n      <!-- Local builds should have a '-dev' suffix on the build number -->\n      <PrereleaseSuffix Condition=\" '$(GITHUB_ACTIONS)' != 'true' \">-dev</PrereleaseSuffix>\n      <!-- Never put the Git hash in the package version -->\n      <PackageVersion>$(BuildVersionSimple)$(PrereleaseVersion)$(PrereleaseSuffix)</PackageVersion>\n      <PackageReleaseNotes>https://xunit.net/releases/analyzers/$(PackageVersion)</PackageReleaseNotes>\n      <!-- Pass through values we don't know ahead of time for any hand-crafted .nuspec files -->\n      <NuspecProperties>\n        Configuration=$(Configuration);\n        GitCommitId=$(GitCommitId);\n        PackageVersion=$(PackageVersion);\n        SignedPath=$(SignedPath);\n      </NuspecProperties>\n    </PropertyGroup>\n  </Target>\n\n</Project>\n"
  },
  {
    "path": "src/common/CallerArgumentExpressionAttribute.cs",
    "content": "#if !NETCOREAPP\n\nnamespace System.Runtime.CompilerServices;\n\n[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]\ninternal sealed class CallerArgumentExpressionAttribute(string parameterName) :\n\tAttribute\n{\n\tpublic string ParameterName { get; } = parameterName;\n}\n\n#endif\n"
  },
  {
    "path": "src/common/Guard.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Runtime.CompilerServices;\n\nnamespace Xunit;\n\n/// <summary>\n/// Helper class for guarding value arguments and valid state.\n/// </summary>\nstatic class Guard\n{\n\t/// <summary>\n\t/// Ensures that a nullable reference type argument is not null.\n\t/// </summary>\n\t/// <typeparam name=\"T\">The argument type</typeparam>\n\t/// <param name=\"argValue\">The value of the argument</param>\n\t/// <param name=\"argName\">The name of the argument</param>\n\t/// <returns>The argument value as a non-null value</returns>\n\t/// <exception cref=\"ArgumentNullException\">Thrown when the argument is null</exception>\n\tpublic static T ArgumentNotNull<T>(\n\t\t[NotNull] T? argValue,\n\t\t[CallerArgumentExpression(nameof(argValue))] string? argName = null)\n\t\t\twhere T : class\n\t{\n\t\tif (argValue is null)\n\t\t\tthrow new ArgumentNullException(argName?.TrimStart('@'));\n\n\t\treturn argValue;\n\t}\n\n\t/// <summary>\n\t/// Ensures that a nullable enumerable type argument is not null or empty.\n\t/// </summary>\n\t/// <typeparam name=\"T\">The argument type</typeparam>\n\t/// <param name=\"argValue\">The value of the argument</param>\n\t/// <param name=\"argName\">The name of the argument</param>\n\t/// <returns>The argument value as a non-null, non-empty value</returns>\n\t/// <exception cref=\"ArgumentException\">Thrown when the argument is null or empty</exception>\n\tpublic static T ArgumentNotNullOrEmpty<T>(\n\t\t[NotNull] T? argValue,\n\t\t[CallerArgumentExpression(nameof(argValue))] string? argName = null)\n\t\t\twhere T : class, IEnumerable\n\t{\n\t\tArgumentNotNull(argValue, argName);\n\n\t\tif (!argValue.GetEnumerator().MoveNext())\n\t\t\tthrow new ArgumentException(\"Argument was empty\", argName?.TrimStart('@'));\n\n\t\treturn argValue;\n\t}\n\n\t/// <summary>\n\t/// Ensures that an argument is valid.\n\t/// </summary>\n\t/// <param name=\"message\">The exception message to use when the argument is not valid</param>\n\t/// <param name=\"test\">The validity test value</param>\n\t/// <param name=\"argName\">The name of the argument</param>\n\t/// <returns>The argument value as a non-null value</returns>\n\t/// <exception cref=\"ArgumentException\">Thrown when the argument is not valid</exception>\n\tpublic static void ArgumentValid(\n\t\tstring message,\n\t\tbool test,\n\t\tstring? argName = null)\n\t{\n\t\tif (!test)\n\t\t\tthrow new ArgumentException(message, argName);\n\t}\n\n\t/// <summary>\n\t/// Ensures that an argument is valid.\n\t/// </summary>\n\t/// <param name=\"messageFunc\">The creator for an exception message to use when the argument is not valid</param>\n\t/// <param name=\"test\">The validity test value</param>\n\t/// <param name=\"argName\">The name of the argument</param>\n\t/// <returns>The argument value as a non-null value</returns>\n\t/// <exception cref=\"ArgumentException\">Thrown when the argument is not valid</exception>\n\tpublic static void ArgumentValid(\n\t\tFunc<string> messageFunc,\n\t\tbool test,\n\t\tstring? argName = null)\n\t{\n\t\tif (!test)\n\t\t\tthrow new ArgumentException(messageFunc?.Invoke(), argName);\n\t}\n}\n"
  },
  {
    "path": "src/compat/Directory.Build.props",
    "content": "<Project>\n\n  <PropertyGroup>\n    <DefineConstants>$(DefineConstants);ROSLYN_LATEST</DefineConstants>\n    <MicrosoftCodeAnalysisVersion>4.14.0</MicrosoftCodeAnalysisVersion>\n  </PropertyGroup>\n\n  <Import Project=\"..\\Directory.Build.props\"/>\n\n</Project>\n"
  },
  {
    "path": "src/compat/xunit.analyzers.latest/xunit.analyzers.latest.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <RootNamespace>Xunit.Analyzers</RootNamespace>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\xunit.analyzers\\**\\*.cs\" Exclude=\"**\\obj\\**\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/compat/xunit.analyzers.latest.fixes/xunit.analyzers.latest.fixes.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <RootNamespace>Xunit.Analyzers.Fixes</RootNamespace>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\xunit.analyzers.fixes\\**\\*.cs\" Exclude=\"**\\obj\\**\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\xunit.analyzers.latest\\xunit.analyzers.latest.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"[$(MicrosoftCodeAnalysisVersion)]\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/compat/xunit.analyzers.latest.tests/xunit.analyzers.latest.tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <AssemblyName>xunit.analyzers.latest.tests.$(TargetFramework)</AssemblyName>\n    <OutputType>Exe</OutputType>\n    <PackageId>xunit.analyzers.latest.tests</PackageId>\n    <RootNamespace>Xunit.Analyzers</RootNamespace>\n    <TargetFrameworks>net8.0;net472</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"..\\..\\xunit.analyzers.tests\\**\\*.cs\" Exclude=\"**\\obj\\**\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\xunit.analyzers.latest\\xunit.analyzers.latest.csproj\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"true\" />\n    <ProjectReference Include=\"..\\xunit.analyzers.latest.fixes\\xunit.analyzers.latest.fixes.csproj\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"true\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/xunit.analyzers/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyCompany(\".NET Foundation\")]\n[assembly: AssemblyProduct(\"xUnit.net Testing Framework\")]\n[assembly: AssemblyCopyright(\"Copyright (C) .NET Foundation\")]\n[assembly: AssemblyTitle(\"xUnit.net Code Analysis (Analyzers)\")]\n"
  },
  {
    "path": "src/xunit.analyzers/Suppressors/ConsiderCallingConfigureAwaitSuppressor.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class ConsiderCallingConfigureAwaitSuppressor : XunitDiagnosticSuppressor\n{\n\tpublic ConsiderCallingConfigureAwaitSuppressor() :\n\t\tbase(Descriptors.CA2007_Suppression)\n\t{ }\n\n\tprotected override bool ShouldSuppress(\n\t\tDiagnostic diagnostic,\n\t\tSuppressionAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (diagnostic.Location.SourceTree is null)\n\t\t\treturn false;\n\n\t\tvar factAttributeType = xunitContext.Core.FactAttributeType;\n\t\tvar theoryAttributeType = xunitContext.Core.TheoryAttributeType;\n\t\tif (factAttributeType is null || theoryAttributeType is null)\n\t\t\treturn false;\n\n\t\tvar root = diagnostic.Location.SourceTree.GetRoot(context.CancellationToken);\n\t\tif (root?.FindNode(diagnostic.Location.SourceSpan) is not InvocationExpressionSyntax invocationSyntax)\n\t\t\treturn false;\n\n\t\tvar current = invocationSyntax.Parent;\n\t\twhile (true)\n\t\t{\n\t\t\tif (current is null or LocalFunctionStatementSyntax or LambdaExpressionSyntax)\n\t\t\t\treturn false;\n\t\t\tif (current is MethodDeclarationSyntax)\n\t\t\t\tbreak;\n\n\t\t\tcurrent = current.Parent;\n\t\t}\n\n\t\tvar semanticModel = context.GetSemanticModel(diagnostic.Location.SourceTree);\n\t\tvar methodSymbol = semanticModel.GetDeclaredSymbol(current);\n\t\tif (methodSymbol is null)\n\t\t\treturn false;\n\n\t\tvar attributes = ImmutableHashSet.Create(SymbolEqualityComparer.Default, factAttributeType, theoryAttributeType);\n\n\t\treturn\n\t\t\tmethodSymbol\n\t\t\t\t.GetAttributes()\n\t\t\t\t.Any(a => attributes.Contains(a.AttributeClass));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Suppressors/MakeTypesInternalSuppressor.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class MakeTypesInternalSuppressor : XunitDiagnosticSuppressor\n{\n\tpublic MakeTypesInternalSuppressor() :\n\t\tbase(Descriptors.CA1515_Suppression)\n\t{ }\n\n\tprotected override bool ShouldSuppress(\n\t\tDiagnostic diagnostic,\n\t\tSuppressionAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (diagnostic.Location.SourceTree is null)\n\t\t\treturn false;\n\n\t\tvar root = diagnostic.Location.SourceTree.GetRoot(context.CancellationToken);\n\t\tif (root?.FindNode(diagnostic.Location.SourceSpan) is not ClassDeclarationSyntax classDeclaration)\n\t\t\treturn false;\n\n\t\tvar semanticModel = context.GetSemanticModel(diagnostic.Location.SourceTree);\n\t\tvar classSymbol = semanticModel.GetDeclaredSymbol(classDeclaration) as ITypeSymbol;\n\t\treturn classSymbol.IsTestClass(xunitContext, strict: false);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Suppressors/NonNullableFieldInitializationSuppressor.cs",
    "content": "using System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic sealed class NonNullableFieldInitializationSuppressor : XunitDiagnosticSuppressor\n{\n\tpublic NonNullableFieldInitializationSuppressor() :\n\t\tbase(Descriptors.CS8618_Suppression)\n\t{ }\n\n\tprotected override bool ShouldSuppress(\n\t\tDiagnostic diagnostic,\n\t\tSuppressionAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (diagnostic.Location.SourceTree is null)\n\t\t\treturn false;\n\n\t\tvar asyncLifetimeType = TypeSymbolFactory.IAsyncLifetime(context.Compilation);\n\t\tif (asyncLifetimeType is null)\n\t\t\treturn false;\n\n\t\tvar root = diagnostic.Location.SourceTree.GetRoot(context.CancellationToken);\n\t\tvar node = root?.FindNode(diagnostic.Location.SourceSpan);\n\t\tif (node is null)\n\t\t\treturn false;\n\n\t\tvar semanticModel = context.GetSemanticModel(diagnostic.Location.SourceTree);\n\n\t\tvar memberSymbol = ResolveMemberSymbol(diagnostic, node, semanticModel, context);\n\t\tif (memberSymbol is null)\n\t\t\treturn false;\n\n\t\tvar containingType = memberSymbol.ContainingType;\n\t\tif (containingType is null)\n\t\t\treturn false;\n\n\t\tif (!containingType.AllInterfaces.Contains(asyncLifetimeType, SymbolEqualityComparer.Default))\n\t\t\treturn false;\n\n\t\t// Find the InitializeAsync method implementation\n\t\tvar initializeAsyncInterfaceMethod = asyncLifetimeType.GetMembers(\"InitializeAsync\").FirstOrDefault();\n\t\tif (initializeAsyncInterfaceMethod is null)\n\t\t\treturn false;\n\n\t\tvar initializeAsyncImpl = containingType.FindImplementationForInterfaceMember(initializeAsyncInterfaceMethod);\n\t\tif (initializeAsyncImpl is null)\n\t\t\treturn false;\n\n\t\treturn IsMemberAssignedInMethod(initializeAsyncImpl, memberSymbol, context);\n\t}\n\n\tstatic ISymbol? ResolveMemberSymbol(\n\t\tDiagnostic diagnostic,\n\t\tSyntaxNode node,\n\t\tSemanticModel semanticModel,\n\t\tSuppressionAnalysisContext context)\n\t{\n\t\t// CS8618 can target field variable declarators or property declarations directly\n\t\tISymbol? memberSymbol = node switch\n\t\t{\n\t\t\tVariableDeclaratorSyntax variableDeclarator => semanticModel.GetDeclaredSymbol(variableDeclarator),\n\t\t\tPropertyDeclarationSyntax propertyDeclaration => semanticModel.GetDeclaredSymbol(propertyDeclaration),\n\t\t\t_ => null,\n\t\t};\n\n\t\tif (memberSymbol is not null)\n\t\t\treturn memberSymbol;\n\n\t\t// Check AdditionalLocations (some compiler versions include member location here)\n\t\tforeach (var additionalLocation in diagnostic.AdditionalLocations)\n\t\t{\n\t\t\tif (additionalLocation.SourceTree is null)\n\t\t\t\tcontinue;\n\n\t\t\tvar addRoot = additionalLocation.SourceTree.GetRoot(context.CancellationToken);\n\t\t\tvar addNode = addRoot.FindNode(additionalLocation.SourceSpan);\n\t\t\tvar addModel = context.GetSemanticModel(additionalLocation.SourceTree);\n\t\t\tvar symbol = addModel.GetDeclaredSymbol(addNode, context.CancellationToken);\n\t\t\tif (symbol is IFieldSymbol or IPropertySymbol)\n\t\t\t\treturn symbol;\n\t\t}\n\n\t\t// Fallback: CS8618 on a constructor — extract member name from diagnostic message\n\t\tvar declaredSymbol = semanticModel.GetDeclaredSymbol(node, context.CancellationToken);\n\t\tif (declaredSymbol is IMethodSymbol { MethodKind: MethodKind.Constructor } constructorSymbol)\n\t\t{\n\t\t\tvar message = diagnostic.GetMessage(CultureInfo.InvariantCulture);\n\t\t\tvar startQuote = message.IndexOf('\\'');\n\t\t\tif (startQuote >= 0)\n\t\t\t{\n\t\t\t\tvar endQuote = message.IndexOf('\\'', startQuote + 1);\n\t\t\t\tif (endQuote > startQuote)\n\t\t\t\t{\n\t\t\t\t\tvar memberName = message.Substring(startQuote + 1, endQuote - startQuote - 1);\n\t\t\t\t\treturn constructorSymbol.ContainingType\n\t\t\t\t\t\t.GetMembers(memberName)\n\t\t\t\t\t\t.FirstOrDefault(m => m is IFieldSymbol or IPropertySymbol);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic bool IsMemberAssignedInMethod(\n\t\tISymbol methodSymbol,\n\t\tISymbol targetMember,\n\t\tSuppressionAnalysisContext context)\n\t{\n\t\tforeach (var syntaxRef in methodSymbol.DeclaringSyntaxReferences)\n\t\t{\n\t\t\tvar methodSyntax = syntaxRef.GetSyntax(context.CancellationToken);\n\t\t\tif (methodSyntax is not MethodDeclarationSyntax methodDecl)\n\t\t\t\tcontinue;\n\n\t\t\tvar methodSemanticModel = context.GetSemanticModel(methodSyntax.SyntaxTree);\n\n\t\t\tforeach (var assignment in methodDecl.DescendantNodes().OfType<AssignmentExpressionSyntax>())\n\t\t\t{\n\t\t\t\tvar assignedSymbol = methodSemanticModel.GetSymbolInfo(assignment.Left).Symbol;\n\t\t\t\tif (assignedSymbol is not null && SymbolEqualityComparer.Default.Equals(assignedSymbol, targetMember))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Suppressors/UseAsyncSuffixForAsyncMethodsSuppressor.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseAsyncSuffixForAsyncMethodsSuppressor : XunitDiagnosticSuppressor\n{\n\tpublic UseAsyncSuffixForAsyncMethodsSuppressor() :\n\t\tbase(Descriptors.VSTHRD200_Suppression)\n\t{ }\n\n\tprotected override bool ShouldSuppress(\n\t\tDiagnostic diagnostic,\n\t\tSuppressionAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tvar attributeUsageType = TypeSymbolFactory.AttributeUsageAttribute(context.Compilation);\n\t\tif (attributeUsageType is null)\n\t\t\treturn false;\n\n\t\tif (diagnostic?.Location.SourceTree is null)\n\t\t\treturn false;\n\n\t\tif (diagnostic.Location.SourceTree.GetRoot().FindNode(diagnostic.Location.SourceSpan) is not MethodDeclarationSyntax methodDeclaration)\n\t\t\treturn false;\n\n\t\tvar semanticModel = context.GetSemanticModel(diagnostic.Location.SourceTree);\n\t\tvar methodSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration) as IMethodSymbol;\n\t\treturn methodSymbol.IsTestMethod(xunitContext, attributeUsageType, strict: false);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/AssertUsageAnalyzerBase.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\npublic abstract class AssertUsageAnalyzerBase(\n\tDiagnosticDescriptor[] descriptors,\n\tIEnumerable<string> methods) :\n\t\tXunitDiagnosticAnalyzer(descriptors)\n{\n\treadonly HashSet<string> targetMethods = new(methods, StringComparer.Ordinal);\n\n\tprotected AssertUsageAnalyzerBase(\n\t\tDiagnosticDescriptor descriptor,\n\t\tIEnumerable<string> methods)\n\t\t\t: this([descriptor], methods)\n\t{ }\n\n\tpublic sealed override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar assertType = TypeSymbolFactory.Assert(context.Compilation);\n\t\tif (assertType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is IInvocationOperation invocationOperation)\n\t\t\t{\n\t\t\t\tvar methodSymbol = invocationOperation.TargetMethod;\n\t\t\t\tif (methodSymbol.MethodKind != MethodKind.Ordinary || !SymbolEqualityComparer.Default.Equals(methodSymbol.ContainingType, assertType) || !targetMethods.Contains(methodSymbol.Name))\n\t\t\t\t\treturn;\n\n\t\t\t\tAnalyzeInvocation(context, xunitContext, invocationOperation, methodSymbol);\n\t\t\t}\n\t\t}, OperationKind.Invocation);\n\t}\n\n\tprotected abstract void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Category.cs",
    "content": "namespace Xunit.Analyzers;\n\npublic enum Category\n{\n\t// 1xxx\n\tUsage,\n\n\t// 2xxx\n\tAssertions,\n\n\t// 3xxx\n\tExtensibility,\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/CodeAnalysisExtensions.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\nstatic class CodeAnalysisExtensions\n{\n\tpublic static INamedTypeSymbol? FindNamedType(\n\t\tthis IAssemblySymbol assembly,\n\t\tFunc<INamedTypeSymbol, bool> selector)\n\t{\n\t\tGuard.ArgumentNotNull(assembly);\n\t\tGuard.ArgumentNotNull(selector);\n\n\t\tvar visitor = new NamedTypeVisitor(selector);\n\t\tvisitor.Visit(assembly);\n\t\treturn visitor.MatchingType;\n\t}\n\n\tpublic static ImmutableArray<AttributeData> GetAttributesWithInheritance(\n\t\tthis IMethodSymbol method,\n\t\tITypeSymbol? attributeUsageType)\n\t{\n\t\tvar result = new Dictionary<INamedTypeSymbol, List<AttributeData>>(SymbolEqualityComparer.Default);\n\t\tforeach (var attribute in method.GetAttributes())\n\t\t\tif (attribute.AttributeClass is not null)\n\t\t\t\tresult.Add(attribute.AttributeClass, attribute);\n\n\t\tif (method.IsOverride && attributeUsageType is not null)\n\t\t\tfor (var baseMethod = method.OverriddenMethod; baseMethod != null; baseMethod = baseMethod.OverriddenMethod)\n\t\t\t\tforeach (var attribute in baseMethod.GetAttributes())\n\t\t\t\t{\n\t\t\t\t\tif (attribute.AttributeClass is null || result.ContainsKey(attribute.AttributeClass))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar inherited = true;\n\t\t\t\t\tvar allowMultiple = false;\n\n\t\t\t\t\tvar usageAttribute = attribute.AttributeClass.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeUsageType));\n\t\t\t\t\tif (usageAttribute is not null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar inheritedNamedArgument =\n\t\t\t\t\t\t\tusageAttribute\n\t\t\t\t\t\t\t\t.NamedArguments\n\t\t\t\t\t\t\t\t.FirstOrDefault(n => n.Key == nameof(AttributeUsageAttribute.Inherited));\n\n\t\t\t\t\t\tif (inheritedNamedArgument.Value.Value is not null)\n\t\t\t\t\t\t\tinherited = (bool)inheritedNamedArgument.Value.Value;\n\n\t\t\t\t\t\tvar allowMultipleNamedArgument =\n\t\t\t\t\t\t\tusageAttribute\n\t\t\t\t\t\t\t\t.NamedArguments\n\t\t\t\t\t\t\t\t.FirstOrDefault(n => n.Key == nameof(AttributeUsageAttribute.AllowMultiple));\n\n\t\t\t\t\t\tif (allowMultipleNamedArgument.Value.Value is not null)\n\t\t\t\t\t\t\tallowMultiple = (bool)allowMultipleNamedArgument.Value.Value;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((allowMultiple || !result.ContainsKey(attribute.AttributeClass)) && inherited)\n\t\t\t\t\t\tresult.Add(attribute.AttributeClass, attribute);\n\t\t\t\t}\n\n\t\treturn result.Values.SelectMany(x => x).ToImmutableArray();\n\t}\n\n\tpublic static (bool isInTestMethod, IOperation? lambdaOwner) IsInTestMethod(\n\t\tthis IOperation operation,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(operation);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.TheoryAttributeType is null)\n\t\t\treturn (false, null);\n\n\t\tvar semanticModel = operation.SemanticModel;\n\t\tif (semanticModel is null)\n\t\t\treturn (false, null);\n\n\t\tIOperation? lambdaOwner = null;\n\n\t\tfor (var parent = operation.Parent; parent is not null; parent = parent.Parent)\n\t\t{\n\t\t\tif (parent is IAnonymousFunctionOperation)\n\t\t\t{\n\t\t\t\tif (lambdaOwner is null)\n\t\t\t\t{\n\t\t\t\t\tlambdaOwner = parent;\n\n\t\t\t\t\tif (parent.Parent is IDelegateCreationOperation)\n\t\t\t\t\t\tfor (var target = parent.Parent.Parent; target is not null; target = target.Parent)\n\t\t\t\t\t\t\tif (target is IArgumentOperation && target.Parent is IInvocationOperation invocationOperation)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlambdaOwner = invocationOperation;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (parent is ILocalFunctionOperation)\n\t\t\t{\n\t\t\t\tlambdaOwner = parent;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (parent is not IMethodBodyOperation methodBodyOperation)\n\t\t\t\tcontinue;\n\t\t\tif (methodBodyOperation.Syntax is not MethodDeclarationSyntax methodSyntax)\n\t\t\t\tcontinue;\n\n\t\t\tvar insideTestMethod = methodSyntax.AttributeLists.SelectMany(list => list.Attributes).Any(attr =>\n\t\t\t{\n\t\t\t\tvar typeInfo = semanticModel.GetTypeInfo(attr);\n\t\t\t\tif (typeInfo.Type is null)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(typeInfo.Type, xunitContext.Core.FactAttributeType) ||\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(typeInfo.Type, xunitContext.Core.TheoryAttributeType);\n\t\t\t});\n\n\t\t\tif (!insideTestMethod)\n\t\t\t\treturn (false, null);\n\n\t\t\treturn (true, lambdaOwner);\n\t\t}\n\n\t\treturn (false, null);\n\t}\n\n\tpublic static bool IsPointer(\n\t\tthis ExpressionSyntax expression,\n\t\tSemanticModel? semanticModel) =>\n\t\t\tsemanticModel?.GetTypeInfo(expression).Type?.TypeKind == TypeKind.Pointer;\n\n\tpublic static bool IsTestClass(\n\t\tthis ITypeSymbol? type,\n\t\tXunitContext xunitContext,\n\t\tbool strict)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (type is null)\n\t\t\treturn false;\n\n\t\tif (strict)\n\t\t\treturn IsTestClassStrict(type, xunitContext);\n\t\telse\n\t\t\treturn IsTestClassNonStrict(type, xunitContext);\n\t}\n\n\tstatic bool IsTestClassNonStrict(\n\t\tITypeSymbol type,\n\t\tXunitContext xunitContext)\n\t{\n\t\tvar factAttributeType = xunitContext.Core.FactAttributeType;\n\t\tif (factAttributeType is null)\n\t\t\treturn false;\n\n\t\treturn\n\t\t\ttype\n\t\t\t\t.GetMembers()\n\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t.Any(method =>\n\t\t\t\t\tmethod\n\t\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t\t.Select(a => a.AttributeClass)\n\t\t\t\t\t\t.Any(t => factAttributeType.IsAssignableFrom(t))\n\t\t\t\t);\n\t}\n\n\tstatic bool IsTestClassStrict(\n\t\tITypeSymbol type,\n\t\tXunitContext xunitContext)\n\t{\n\t\tvar factAttributeType = xunitContext.Core.FactAttributeType;\n\t\tvar theoryAttributeType = xunitContext.Core.TheoryAttributeType;\n\t\tif (factAttributeType is null || theoryAttributeType is null)\n\t\t\treturn false;\n\n\t\tvar testMethodAttributes =\n\t\t\tnew[] { factAttributeType, theoryAttributeType }\n\t\t\t\t.ToImmutableHashSet(SymbolEqualityComparer.Default);\n\n\t\treturn\n\t\t\ttype\n\t\t\t\t.GetMembers()\n\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t.Any(method =>\n\t\t\t\t\tmethod\n\t\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t\t.Select(a => a.AttributeClass)\n\t\t\t\t\t\t.Any(t => testMethodAttributes.Contains(t, SymbolEqualityComparer.Default))\n\t\t\t\t);\n\t}\n\n\tpublic static bool IsTestMethod(\n\t\tthis IMethodSymbol? method,\n\t\tXunitContext xunitContext,\n\t\tITypeSymbol attributeUsageType,\n\t\tbool strict)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (method is null)\n\t\t\treturn false;\n\n\t\tvar factAttributeType = xunitContext.Core.FactAttributeType;\n\t\tvar theoryAttributeType = xunitContext.Core.TheoryAttributeType;\n\t\tif (factAttributeType is null || theoryAttributeType is null)\n\t\t\treturn false;\n\n\t\tvar attributes = method.GetAttributesWithInheritance(attributeUsageType);\n\t\tvar comparer = SymbolEqualityComparer.Default;\n\n\t\treturn\n\t\t\tstrict\n\t\t\t\t? attributes.Any(a => comparer.Equals(a.AttributeClass, factAttributeType) || comparer.Equals(a.AttributeClass, theoryAttributeType))\n\t\t\t\t: attributes.Any(a => factAttributeType.IsAssignableFrom(a.AttributeClass));\n\t}\n\n\tpublic static IOperation WalkDownImplicitConversions(this IOperation operation)\n\t{\n\t\tGuard.ArgumentNotNull(operation);\n\n\t\tvar current = operation;\n\t\twhile (current is IConversionOperation conversion && conversion.Conversion.IsImplicit)\n\t\t\tcurrent = conversion.Operand;\n\n\t\treturn current;\n\t}\n\n\tsealed class NamedTypeVisitor(Func<INamedTypeSymbol, bool> selector) :\n\t\tSymbolVisitor\n\t{\n\t\treadonly Func<INamedTypeSymbol, bool> selector = Guard.ArgumentNotNull(selector);\n\n\t\tpublic INamedTypeSymbol? MatchingType { get; private set; }\n\n\t\tpublic override void VisitAssembly(IAssemblySymbol symbol) =>\n\t\t\tGuard.ArgumentNotNull(symbol).GlobalNamespace.Accept(this);\n\n\t\tpublic override void VisitNamespace(INamespaceSymbol symbol)\n\t\t{\n\t\t\tGuard.ArgumentNotNull(symbol);\n\n\t\t\tif (MatchingType is not null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var member in symbol.GetMembers())\n\t\t\t\tmember.Accept(this);\n\t\t}\n\n\t\tpublic override void VisitNamedType(INamedTypeSymbol symbol)\n\t\t{\n\t\t\tGuard.ArgumentNotNull(symbol);\n\n\t\t\tif (MatchingType is not null)\n\t\t\t\treturn;\n\n\t\t\tif (selector(symbol))\n\t\t\t{\n\t\t\t\tMatchingType = symbol;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach (var nestedType in symbol.GetTypeMembers())\n\t\t\t\tnestedType.Accept(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Constants.cs",
    "content": "namespace Xunit.Analyzers;\n\npublic static class Constants\n{\n\t/// <summary>\n\t/// Argument names for Assert methods\n\t/// </summary>\n\tpublic static class AssertArguments\n\t{\n\t\tpublic const string Actual = \"actual\";\n\t\tpublic const string Expected = \"expected\";\n\t\tpublic const string IgnoreCase = \"ignoreCase\";\n\t}\n\n\t/// <summary>\n\t/// Method names from Assert\n\t/// </summary>\n\tpublic static class Asserts\n\t{\n\t\tpublic const string All = nameof(All);\n\t\tpublic const string AllAsync = nameof(AllAsync);\n\t\tpublic const string Collection = nameof(Collection);\n\t\tpublic const string CollectionAsync = nameof(CollectionAsync);\n\t\tpublic const string Contains = nameof(Contains);\n\t\tpublic const string Distinct = nameof(Distinct);\n\t\tpublic const string DoesNotContain = nameof(DoesNotContain);\n\t\tpublic const string DoesNotMatch = nameof(DoesNotMatch);\n\t\tpublic const string Empty = nameof(Empty);\n\t\tpublic const string EndsWith = nameof(EndsWith);\n\t\tpublic const string Equal = nameof(Equal);\n\t\tpublic const string Equivalent = nameof(Equivalent);\n\t\tpublic const string Fail = nameof(Fail);\n\t\tpublic const string False = nameof(False);\n\t\tpublic const string InRange = nameof(InRange);\n\t\tpublic const string IsAssignableFrom = nameof(IsAssignableFrom);\n\t\tpublic const string IsNotAssignableFrom = nameof(IsNotAssignableFrom);\n\t\tpublic const string IsNotType = nameof(IsNotType);\n\t\tpublic const string IsType = nameof(IsType);\n\t\tpublic const string Matches = nameof(Matches);\n\t\tpublic const string Multiple = nameof(Multiple);\n\t\tpublic const string NotEmpty = nameof(NotEmpty);\n\t\tpublic const string NotEqual = nameof(NotEqual);\n\t\tpublic const string NotInRange = nameof(NotInRange);\n\t\tpublic const string NotNull = nameof(NotNull);\n\t\tpublic const string NotSame = nameof(NotSame);\n\t\tpublic const string NotStrictEqual = nameof(NotStrictEqual);\n\t\tpublic const string Null = nameof(Null);\n\t\tpublic const string ProperSubset = nameof(ProperSubset);\n\t\tpublic const string ProperSuperset = nameof(ProperSuperset);\n\t\tpublic const string PropertyChanged = nameof(PropertyChanged);\n\t\tpublic const string PropertyChangedAsync = nameof(PropertyChangedAsync);\n\t\tpublic const string Raises = nameof(Raises);\n\t\tpublic const string RaisesAny = nameof(RaisesAny);\n\t\tpublic const string RaisesAnyAsync = nameof(RaisesAnyAsync);\n\t\tpublic const string RaisesAsync = nameof(RaisesAsync);\n\t\tpublic const string Same = nameof(Same);\n\t\tpublic const string Single = nameof(Single);\n\t\tpublic const string StartsWith = nameof(StartsWith);\n\t\tpublic const string StrictEqual = nameof(StrictEqual);\n\t\tpublic const string Subset = nameof(Subset);\n\t\tpublic const string Superset = nameof(Superset);\n\t\tpublic const string Throws = nameof(Throws);\n\t\tpublic const string ThrowsAny = nameof(ThrowsAny);\n\t\tpublic const string ThrowsAnyAsync = nameof(ThrowsAnyAsync);\n\t\tpublic const string ThrowsAsync = nameof(ThrowsAsync);\n\t\tpublic const string True = nameof(True);\n\t}\n\n\t/// <summary>\n\t/// Attribute names (without the Attribute suffix unless otherwise noted)\n\t/// </summary>\n\tpublic static class Attributes\n\t{\n\t\tpublic const string Fact = nameof(Fact);\n\t\tpublic const string Theory = nameof(Theory);\n\t}\n\n\t/// <summary>\n\t/// Property names from xUnit.net attributes\n\t/// </summary>\n\tpublic static class AttributeProperties\n\t{\n\t\tpublic const string DeclaringType = nameof(DeclaringType);\n\t\tpublic const string MemberName = nameof(MemberName);\n\t\tpublic const string MemberType = nameof(MemberType);\n\t}\n\n\t/// <summary>\n\t/// Properties placed into diagnostics to be picked up by fixes\n\t/// </summary>\n\tpublic static class Properties\n\t{\n\t\tpublic const string ArgumentValue = nameof(ArgumentValue);\n\t\tpublic const string AssertMethodName = nameof(AssertMethodName);\n\t\tpublic const string DataAttributeTypeName = nameof(DataAttributeTypeName);\n\t\tpublic const string DeclaringType = nameof(DeclaringType);\n\t\tpublic const string IgnoreCase = nameof(IgnoreCase);\n\t\tpublic const string IsCtorObsolete = nameof(IsCtorObsolete);\n\t\tpublic const string IsStatic = nameof(IsStatic);\n\t\tpublic const string IsStaticMethodCall = nameof(IsStaticMethodCall);\n\t\tpublic const string LiteralValue = nameof(LiteralValue);\n\t\tpublic const string MemberName = nameof(MemberName);\n\t\tpublic const string MethodName = nameof(MethodName);\n\t\tpublic const string NewBaseType = nameof(NewBaseType);\n\t\tpublic const string ParameterArrayStyle = nameof(ParameterArrayStyle);\n\t\tpublic const string ParameterIndex = nameof(ParameterIndex);\n\t\tpublic const string ParameterName = nameof(ParameterName);\n\t\tpublic const string ParameterSpecialType = nameof(ParameterSpecialType);\n\t\tpublic const string Replacement = nameof(Replacement);\n\t\tpublic const string SizeValue = nameof(SizeValue);\n\t\tpublic const string SubstringMethodName = nameof(SubstringMethodName);\n\t\tpublic const string TestClassName = nameof(TestClassName);\n\t\tpublic const string TFixtureDisplayName = nameof(TFixtureDisplayName);\n\t\tpublic const string TFixtureName = nameof(TFixtureName);\n\t\tpublic const string TypeName = nameof(TypeName);\n\t\tpublic const string UseExactMatch = nameof(UseExactMatch);\n\t}\n\n\t/// <summary>\n\t/// Type names as strings for runtime lookup\n\t/// </summary>\n\tpublic static class Types\n\t{\n\t\tpublic static class System\n\t\t{\n\t\t\tpublic const string ObsoleteAttribute = \"System.ObsoleteAttribute\";\n\t\t}\n\n\t\tpublic static class Xunit\n\t\t{\n\t\t\tpublic const string AssemblyFixtureAttribute_V3 = \"Xunit.AssemblyFixtureAttribute\";\n\t\t\tpublic const string Assert = \"Xunit.Assert\";\n\t\t\tpublic const string ClassDataAttribute = \"Xunit.ClassDataAttribute\";\n\t\t\tpublic const string ClassDataAttributeOfT_V3 = \"Xunit.ClassDataAttribute`1\";\n\t\t\tpublic const string CollectionAttribute = \"Xunit.CollectionAttribute\";\n\t\t\tpublic const string CollectionAttributeOfT_V3 = \"Xunit.CollectionAttribute`1\";\n\t\t\tpublic const string CollectionDefinitionAttribute = \"Xunit.CollectionDefinitionAttribute\";\n\t\t\tpublic const string DataAttribute_V2 = \"Xunit.Sdk.DataAttribute\";\n\t\t\tpublic const string DataAttribute_V3 = \"Xunit.v3.DataAttribute\";\n\t\t\tpublic const string FactAttribute = \"Xunit.FactAttribute\";\n\t\t\tpublic const string IAssemblyInfo_V2 = \"Xunit.Abstractions.IAssemblyInfo\";\n\t\t\tpublic const string IAsyncLifetime = \"Xunit.IAsyncLifetime\";\n\t\t\tpublic const string IAttributeInfo_V2 = \"Xunit.Abstractions.IAttributeInfo\";\n\t\t\tpublic const string IClassFixtureOfT = \"Xunit.IClassFixture`1\";\n\t\t\tpublic const string ICollectionFixtureOfT = \"Xunit.ICollectionFixture`1\";\n\t\t\tpublic const string IDataAttribute_V3 = \"Xunit.v3.IDataAttribute\";\n\t\t\tpublic const string IMessageSink_V2 = \"Xunit.Abstractions.IMessageSink\";\n\t\t\tpublic const string IMessageSink_V3 = \"Xunit.Sdk.IMessageSink\";\n\t\t\tpublic const string IMessageSinkMessage_V2 = \"Xunit.Abstractions.IMessageSinkMessage\";\n\t\t\tpublic const string IMethodInfo_V2 = \"Xunit.Abstractions.IMethodInfo\";\n\t\t\tpublic const string IParameterInfo_V2 = \"Xunit.Abstractions.IParameterInfo\";\n\t\t\tpublic const string InlineDataAttribute = \"Xunit.InlineDataAttribute\";\n\t\t\tpublic const string IRunnerReporter_V3 = \"Xunit.Runner.Common.IRunnerReporter\";\n\t\t\tpublic const string ISourceInformation_V2 = \"Xunit.Abstractions.ISourceInformation\";\n\t\t\tpublic const string ISourceInformationProvider_V2 = \"Xunit.Abstractions.ISourceInformationProvider\";\n\t\t\tpublic const string ISourceInformationProvider_V3 = \"Xunit.Runner.Common.ISourceInformationProvider\";\n\t\t\tpublic const string ITest_V2 = \"Xunit.Abstractions.ITest\";\n\t\t\tpublic const string ITest_V3 = \"Xunit.Sdk.ITest\";\n\t\t\tpublic const string ITestAssembly_V2 = \"Xunit.Abstractions.ITestAssembly\";\n\t\t\tpublic const string ITestAssembly_V3 = \"Xunit.Sdk.ITestAssembly\";\n\t\t\tpublic const string ITestCase_V2 = \"Xunit.Abstractions.ITestCase\";\n\t\t\tpublic const string ITestCase_V3 = \"Xunit.Sdk.ITestCase\";\n\t\t\tpublic const string ITestClass_V2 = \"Xunit.Abstractions.ITestClass\";\n\t\t\tpublic const string ITestClass_V3 = \"Xunit.Sdk.ITestClass\";\n\t\t\tpublic const string ITestCollection_V2 = \"Xunit.Abstractions.ITestCollection\";\n\t\t\tpublic const string ITestCollection_V3 = \"Xunit.Sdk.ITestCollection\";\n\t\t\tpublic const string ITestContextAccessor_V3 = \"Xunit.ITestContextAccessor\";\n\t\t\tpublic const string ITestFramework_V2 = \"Xunit.Abstractions.ITestFramework\";\n\t\t\tpublic const string ITestFramework_V3 = \"Xunit.v3.ITestFramework\";\n\t\t\tpublic const string ITestFrameworkDiscoverer_V2 = \"Xunit.Abstractions.ITestFrameworkDiscoverer\";\n\t\t\tpublic const string ITestFrameworkDiscoverer_V3 = \"Xunit.v3.ITestFrameworkDiscoverer\";\n\t\t\tpublic const string ITestFrameworkExecutor_V2 = \"Xunit.Abstractions.ITestFrameworkExecutor\";\n\t\t\tpublic const string ITestFrameworkExecutor_V3 = \"Xunit.v3.ITestFrameworkExecutor\";\n\t\t\tpublic const string ITestMethod_V2 = \"Xunit.Abstractions.ITestMethod\";\n\t\t\tpublic const string ITestMethod_V3 = \"Xunit.Sdk.ITestMethod\";\n\t\t\tpublic const string ITestOutputHelper_V2 = \"Xunit.Abstractions.ITestOutputHelper\";\n\t\t\tpublic const string ITestOutputHelper_V3 = \"Xunit.ITestOutputHelper\";\n\t\t\tpublic const string ITheoryDataRow_V3 = \"Xunit.ITheoryDataRow\";\n\t\t\tpublic const string ITypeInfo_V2 = \"Xunit.Abstractions.ITypeInfo\";\n\t\t\tpublic const string IXunitSerializable_V2 = \"Xunit.Abstractions.IXunitSerializable\";\n\t\t\tpublic const string IXunitSerializable_V3 = \"Xunit.Sdk.IXunitSerializable\";\n\t\t\tpublic const string IXunitSerializer_V3 = \"Xunit.Sdk.IXunitSerializer\";\n\t\t\tpublic const string JsonTypeIDAttribute_V3 = \"Xunit.Sdk.JsonTypeIDAttribute\";\n\t\t\tpublic const string LongLivedMarshalByRefObject_Execution_V2 = \"Xunit.LongLivedMarshalByRefObject\";\n\t\t\tpublic const string LongLivedMarshalByRefObject_RunnerUtility = \"Xunit.Sdk.LongLivedMarshalByRefObject\";\n\t\t\tpublic const string MemberDataAttribute = \"Xunit.MemberDataAttribute\";\n\t\t\tpublic const string Record = \"Xunit.Record\";\n\t\t\tpublic const string RegisterXunitSerializerAttribute_V3 = \"Xunit.Sdk.RegisterXunitSerializerAttribute\";\n\t\t\tpublic const string TestContext_V3 = \"Xunit.TestContext\";\n\t\t\tpublic const string TheoryAttribute = \"Xunit.TheoryAttribute\";\n\t\t\tpublic const string TheoryData = \"Xunit.TheoryData\";\n\t\t\tpublic const string TheoryDataRow_V3 = \"Xunit.TheoryDataRow\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/ConversionChecker.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace Xunit.Analyzers;\n\nstatic class ConversionChecker\n{\n\tstatic readonly HashSet<SpecialType> SignedIntegralTypes = [\n\t\tSpecialType.System_SByte,\n\t\tSpecialType.System_Int16,\n\t\tSpecialType.System_Int32,\n\t\tSpecialType.System_Int64,\n\t];\n\n\tstatic readonly HashSet<SpecialType> UnsignedIntegralTypes = [\n\t\tSpecialType.System_Byte,\n\t\tSpecialType.System_UInt16,\n\t\tSpecialType.System_UInt32,\n\t\tSpecialType.System_UInt64,\n\t];\n\n\tpublic static bool IsConvertible(\n\t\tCompilation compilation,\n\t\tITypeSymbol source,\n\t\tITypeSymbol destination,\n\t\tXunitContext xunitContext,\n\t\tobject? valueSource = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\t\tGuard.ArgumentNotNull(source);\n\t\tGuard.ArgumentNotNull(destination);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (destination.TypeKind == TypeKind.Array)\n\t\t{\n\t\t\tvar destinationElementType = ((IArrayTypeSymbol)destination).ElementType;\n\n\t\t\tif (destinationElementType.TypeKind == TypeKind.TypeParameter)\n\t\t\t\treturn IsConvertibleTypeParameter(source, (ITypeParameterSymbol)destinationElementType);\n\t\t}\n\n\t\tif (destination.TypeKind == TypeKind.TypeParameter)\n\t\t\treturn IsConvertibleTypeParameter(source, (ITypeParameterSymbol)destination);\n\n\t\tvar conversion = compilation.ClassifyConversion(source, destination);\n\n\t\tif (conversion.IsNumeric)\n\t\t\treturn IsConvertibleNumeric(source, destination, valueSource);\n\n\t\tif (destination.SpecialType == SpecialType.System_DateTime\n\t\t\t|| (xunitContext.Core.TheorySupportsConversionFromStringToDateTimeOffsetAndGuid && IsDateTimeOffsetOrGuid(destination)))\n\t\t{\n\t\t\t// Allow all conversions from strings. All parsing issues will be reported at runtime.\n\t\t\treturn source.SpecialType == SpecialType.System_String;\n\t\t}\n\n\t\t// Rules of last resort\n\t\treturn conversion.IsImplicit\n\t\t\t|| conversion.IsUnboxing\n\t\t\t|| (conversion.IsExplicit && conversion.IsUserDefined)\n\t\t\t|| (conversion.IsExplicit && conversion.IsNullable);\n\t}\n\n\tstatic bool IsConvertibleTypeParameter(\n\t\tITypeSymbol source,\n\t\tITypeParameterSymbol destination)\n\t{\n\t\tif (destination.HasValueTypeConstraint && !source.IsValueType)\n\t\t\treturn false;\n\t\tif (destination.HasReferenceTypeConstraint && source.IsValueType)\n\t\t\treturn false;\n\n\t\treturn destination.ConstraintTypes.All(c => c.IsAssignableFrom(source));\n\t}\n\n\tstatic bool IsConvertibleNumeric(\n\t\tITypeSymbol source,\n\t\tITypeSymbol destination,\n\t\tobject? valueSource = null)\n\t{\n\t\tvar isIntegral = long.TryParse(valueSource?.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var integralValue);\n\t\tif (isIntegral && integralValue < 0 && IsSigned(source) && IsUnsigned(destination))\n\t\t\treturn false;\n\n\t\tif (destination.SpecialType == SpecialType.System_Char\n\t\t\t&& (source.SpecialType == SpecialType.System_Double || source.SpecialType == SpecialType.System_Single))\n\t\t{\n\t\t\t// Conversions from float to char (though numeric) do not actually work at runtime, so report them\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true; // Allow all numeric conversions. Narrowing conversion issues will be reported at runtime.\n\t}\n\n\tstatic bool IsDateTimeOffsetOrGuid(ITypeSymbol destination)\n\t{\n\t\tif (destination.ContainingNamespace?.Name != nameof(System))\n\t\t\treturn false;\n\n\t\treturn destination.MetadataName is (nameof(DateTimeOffset)) or (nameof(Guid));\n\t}\n\n\tstatic bool IsSigned(ITypeSymbol typeSymbol) =>\n\t\tSignedIntegralTypes.Contains(typeSymbol.SpecialType);\n\n\tstatic bool IsUnsigned(ITypeSymbol typeSymbol) =>\n\t\tUnsignedIntegralTypes.Contains(typeSymbol.SpecialType);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Descriptors.Suppressors.cs",
    "content": "using Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic static partial class Descriptors\n{\n\tpublic static SuppressionDescriptor CA1515_Suppression { get; } =\n\t\tSuppression(\"CA1515\", \"xUnit.net's test classes must be public.\");\n\n\tpublic static SuppressionDescriptor CA2007_Suppression { get; } =\n\t\tSuppression(\"CA2007\", \"xUnit.net test methods should not call ConfigureAwait\");\n\n\tpublic static SuppressionDescriptor CS8618_Suppression { get; } =\n\t\tSuppression(\"CS8618\", \"Non-nullable member is initialized in IAsyncLifetime.InitializeAsync\");\n\n\tpublic static SuppressionDescriptor VSTHRD200_Suppression { get; } =\n\t\tSuppression(\"VSTHRD200\", \"xUnit.net test methods are not directly callable and do not benefit from this naming rule\");\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Descriptors.cs",
    "content": "using System.Collections.Concurrent;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic static partial class Descriptors\n{\n\tstatic readonly ConcurrentDictionary<Category, string> categoryMapping = new();\n\n\tstatic DiagnosticDescriptor Diagnostic(\n\t\tstring id,\n\t\tstring title,\n\t\tCategory category,\n\t\tDiagnosticSeverity defaultSeverity,\n\t\tstring messageFormat)\n\t{\n\t\tvar helpLink = $\"https://xunit.net/xunit.analyzers/rules/{id}\";\n\t\tvar categoryString = categoryMapping.GetOrAdd(category, c => c.ToString());\n\n\t\treturn new DiagnosticDescriptor(id, title, messageFormat, categoryString, defaultSeverity, isEnabledByDefault: true, helpLinkUri: helpLink);\n\t}\n\n\tstatic SuppressionDescriptor Suppression(\n\t\tstring suppressedDiagnosticId,\n\t\tstring justification) =>\n\t\t\tnew(\"xUnitSuppress-\" + suppressedDiagnosticId, suppressedDiagnosticId, justification);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Descriptors.xUnit1xxx.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing static Microsoft.CodeAnalysis.DiagnosticSeverity;\nusing static Xunit.Analyzers.Category;\n\nnamespace Xunit.Analyzers;\n\npublic static partial class Descriptors\n{\n\tpublic static DiagnosticDescriptor X1000_TestClassMustBePublic { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1000\",\n\t\t\t\"Test classes must be public\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Test classes must be public. Add or change the visibility modifier of the test class to public.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1001_FactMethodMustNotHaveParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1001\",\n\t\t\t\"Fact methods cannot have parameters\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Fact methods cannot have parameters. Remove the parameters from the method or convert it into a Theory.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1002_TestMethodMustNotHaveMultipleFactAttributes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1002\",\n\t\t\t\"Test methods cannot have multiple Fact or Theory attributes\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Test methods cannot have multiple Fact or Theory attributes. Remove all but one of the attributes.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1003_TheoryMethodMustHaveTestData { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1003\",\n\t\t\t\"Theory methods must have test data\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Theory methods must have test data. Use InlineData, MemberData, or ClassData to provide test data for the Theory.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1004_TestMethodShouldNotBeSkipped { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1004\",\n\t\t\t\"Test methods should not be skipped\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"Test methods should not be skipped. Remove the Skip property to start running the test again.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1005_FactMethodShouldNotHaveTestData { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1005\",\n\t\t\t\"Fact methods should not have test data\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Fact methods should not have test data. Remove the test data, or convert the Fact to a Theory.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1006_TheoryMethodShouldHaveParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1006\",\n\t\t\t\"Theory methods should have parameters\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Theory methods should have parameters. Add parameter(s) to the theory method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1007_ClassDataAttributeMustPointAtValidClass { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1007\",\n\t\t\t\"ClassData must point at a valid class\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"ClassData must point at a valid class. The class {0} must be public, not sealed, with an empty constructor, and implement {1}.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1008_DataAttributeShouldBeUsedOnATheory { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1008\",\n\t\t\t\"Test data attribute should only be used on a Theory\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Test data attribute should only be used on a Theory. Remove the test data, or add the Theory attribute to the test method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1009_InlineDataMustMatchTheoryParameters_TooFewValues { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1009\",\n\t\t\t\"InlineData values must match the number of method parameters\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"InlineData values must match the number of method parameters. Remove unused parameters, or add more data for the missing parameters.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1010_InlineDataMustMatchTheoryParameters_IncompatibleValueType { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1010\",\n\t\t\t\"The value is not convertible to the method parameter type\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"The value is not convertible to the method parameter '{0}' of type '{1}'. Use a compatible data value.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1011_InlineDataMustMatchTheoryParameters_ExtraValue { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1011\",\n\t\t\t\"There is no matching method parameter\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"There is no matching method parameter for value: {0}. Remove unused value(s), or add more parameter(s).\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1012_InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameter { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1012\",\n\t\t\t\"Null should only be used for nullable parameters\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Null should not be used for type parameter '{0}' of type '{1}'. Use a non-null value, or convert the parameter to a nullable type.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1013_PublicMethodShouldBeMarkedAsTest { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1013\",\n\t\t\t\"Public method should be marked as test\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Public method '{0}' on test class '{1}' should be marked as a {2}. Reduce the visibility of the method, or add a {2} attribute to the method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1014_MemberDataShouldUseNameOfOperator { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1014\",\n\t\t\t\"MemberData should use nameof operator for member name\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"MemberData should use nameof operator to reference member '{0}' on type '{1}'. Replace the constant string with nameof.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1015_MemberDataMustReferenceExistingMember { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1015\",\n\t\t\t\"MemberData must reference an existing member\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference an existing member '{0}' on type '{1}'. Fix the member reference, or add the missing data member.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1016_MemberDataMustReferencePublicMember { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1016\",\n\t\t\t\"MemberData must reference a public member\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference a public member. Add or change the visibility of the data member to public.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1017_MemberDataMustReferenceStaticMember { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1017\",\n\t\t\t\"MemberData must reference a static member\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference a static member. Add the static modifier to the data member.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1018_MemberDataMustReferenceValidMemberKind { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1018\",\n\t\t\t\"MemberData must reference a valid member kind\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference a property, field, or method. Convert the data member to a compatible member type.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1019_MemberDataMustReferenceMemberOfValidType { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1019\",\n\t\t\t\"MemberData must reference a member providing a valid data type\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference a data type assignable to {0}. The referenced type '{1}' is not valid.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1020_MemberDataPropertyMustHaveGetter { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1020\",\n\t\t\t\"MemberData must reference a property with a public getter\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"MemberData must reference a property with a public getter. Add a public getter to the data member, or change the visibility of the existing getter to public.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1021_MemberDataNonMethodShouldNotHaveParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1021\",\n\t\t\t\"MemberData should not have parameters if the referenced member is not a method\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"MemberData should not have parameters if the referenced member is not a method. Remove the parameter values, or convert the data member to a method with parameters.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1022_TheoryMethodCannotHaveParameterArray { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1022\",\n\t\t\t\"Theory methods cannot have a parameter array\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Theory method '{0}' on test class '{1}' cannot have a parameter array '{2}'. Upgrade to xUnit.net 2.2 or later to enable this feature.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1023_TheoryMethodCannotHaveDefaultParameter { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1023\",\n\t\t\t\"Theory methods cannot have default parameter values\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Theory method '{0}' on test class '{1}' parameter '{2}' cannot have a default value. Upgrade to xUnit.net 2.2 or later to enable this feature.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1024_TestMethodCannotHaveOverloads { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1024\",\n\t\t\t\"Test methods cannot have overloads\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Test method '{0}' on test class '{1}' has the same name as another method declared on class '{2}'. Rename method(s) so that there are no overloaded names.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1025_InlineDataShouldBeUniqueWithinTheory { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1025\",\n\t\t\t\"InlineData should be unique within the Theory it belongs to\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Theory method '{0}' on test class '{1}' has InlineData duplicate(s). Remove redundant attribute(s) from the theory method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1026_TheoryMethodShouldUseAllParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1026\",\n\t\t\t\"Theory methods should use all of their parameters\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Theory method '{0}' on test class '{1}' does not use parameter '{2}'. Use the parameter, or remove the parameter and associated data.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1027_CollectionDefinitionClassMustBePublic { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1027\",\n\t\t\t\"Collection definition classes must be public\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Collection definition classes must be public. Add or change the visibility modifier of the collection definition class to public.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1028_TestMethodHasInvalidReturnType { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1028\",\n\t\t\t\"Test method must have valid return type\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Test methods must have a supported return type. Valid types are: {0}. Change the return type to one of the compatible types.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1029_LocalFunctionsCannotBeTestFunctions { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1029\",\n\t\t\t\"Local functions cannot be test functions\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Local functions cannot be test functions. Remove '{0}'.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1030_DoNotUseConfigureAwait { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1030\",\n\t\t\t\"Do not call ConfigureAwait(false) in test method\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Test methods should not call ConfigureAwait({0}), as it may bypass parallelization limits. {1}\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1031_DoNotUseBlockingTaskOperations { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1031\",\n\t\t\t\"Do not use blocking task operations in test method\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1032_TestClassCannotBeNestedInGenericClass { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1032\",\n\t\t\t\"Test classes cannot be nested within a generic class\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Test classes cannot be nested within a generic class. Move the test class out of the class it is nested in.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1033_TestClassShouldHaveTFixtureArgument { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1033\",\n\t\t\t\"Test classes decorated with 'Xunit.IClassFixture<TFixture>' or 'Xunit.ICollectionFixture<TFixture>' should add a constructor argument of type TFixture\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"Test class '{0}' does not contain constructor argument of type '{1}'. Add a constructor argument to consume the fixture data.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1034_MemberDataArgumentsMustMatchMethodParameters_NullShouldNotBeUsedForIncompatibleParameter { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1034\",\n\t\t\t\"Null should only be used for nullable parameters\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Null should not be used for type parameter '{0}' of type '{1}'. Use a non-null value, or convert the parameter to a nullable type.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1035_MemberDataArgumentsMustMatchMethodParameters_IncompatibleValueType { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1035\",\n\t\t\t\"The value is not convertible to the method parameter type\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"The value is not convertible to the method parameter '{0}' of type '{1}'. Use a compatible data value.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1036_MemberDataArgumentsMustMatchMethodParameters_ExtraValue { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1036\",\n\t\t\t\"There is no matching method parameter\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"There is no matching method parameter for value: {0}. Remove unused value(s), or add more parameter(s).\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1037\",\n\t\t\t\"There are fewer theory data type arguments than required by the parameters of the test method\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"There are fewer {0} type arguments than required by the parameters of the test method. Add more type parameters to match the method signature, or remove parameters from the test method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1038\",\n\t\t\t\"There are more theory data type arguments than allowed by the parameters of the test method\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"There are more {0} type arguments than allowed by the parameters of the test method. Remove unused type arguments, or add more parameters.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1039\",\n\t\t\t\"The type argument to theory data is not compatible with the type of the corresponding test method parameter\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"The type argument {0} from {1} is not compatible with the type of the corresponding test method parameter {2}.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1040\",\n\t\t\t\"The type argument to theory data is nullable, while the type of the corresponding test method parameter is not\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"The type argument {0} from {1} is nullable, while the type of the corresponding test method parameter {2} is not. Make the theory data type non-nullable, or make the test method parameter nullable.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1041_EnsureFixturesHaveASource { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1041\",\n\t\t\t\"Fixture arguments to test classes must have fixture sources\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Fixture argument '{0}' does not have a fixture source (if it comes from a collection definition, ensure the definition is in the same assembly as the test)\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1042_MemberDataTheoryDataIsRecommendedForStronglyTypedAnalysis { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1042\",\n\t\t\t\"The member referenced by the MemberData attribute returns untyped data rows\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The member referenced by the MemberData attribute returns untyped data rows, such as object[]. Consider using {0} as the return type to provide better type safety.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1043_ConstructorOnFactAttributeSubclassShouldBePublic { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1043\",\n\t\t\t\"Constructors on classes derived from FactAttribute must be public when used on test methods\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Constructor '{0}' must be public to be used on a test method.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1044_AvoidUsingTheoryDataTypeArgumentsThatAreNotSerializable { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1044\",\n\t\t\t\"Avoid using TheoryData type arguments that are not serializable\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The type argument {0} is not serializable, which will cause Test Explorer to not enumerate individual data rows. Consider using a type that is known to be serializable.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1045_AvoidUsingTheoryDataTypeArgumentsThatMightNotBeSerializable { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1045\",\n\t\t\t\"Avoid using TheoryData type arguments that might not be serializable\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The type argument {0} might not be serializable, which may cause Test Explorer to not enumerate individual data rows. Consider using a type that is known to be serializable.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1046_AvoidUsingTheoryDataRowArgumentsThatAreNotSerializable { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1046\",\n\t\t\t\"Avoid using TheoryDataRow arguments that are not serializable\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The argument '{0}' of type '{1}' is not serializable, which will cause Test Explorer to not enumerate individual data rows. Consider using a value that is known to be serializable.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1047_AvoidUsingTheoryDataRowArgumentsThatMightNotBeSerializable { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1047\",\n\t\t\t\"Avoid using TheoryDataRow arguments that might not be serializable\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The argument '{0}' of type '{1}' might not be serializable, which may cause Test Explorer to not enumerate individual data rows. Consider using a value that is known to be serializable.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1048_DoNotUseAsyncVoidForTestMethods_V2 { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1048\",\n\t\t\t\"Avoid using 'async void' for test methods as it is deprecated in xUnit.net v3\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Support for 'async void' unit tests is being removed from xUnit.net v3. To simplify upgrading, convert the test to 'async Task' instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1049_DoNotUseAsyncVoidForTestMethods_V3 { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1049\",\n\t\t\t\"Do not use 'async void' for test methods as it is no longer supported\",\n\t\t\tUsage,\n\t\t\tError,\n\t\t\t\"Support for 'async void' unit tests has been removed from xUnit.net v3. Convert the test to 'async Task' or 'async ValueTask' instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1050_ClassDataTheoryDataRowIsRecommendedForStronglyTypedAnalysis { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1050\",\n\t\t\t\"The class referenced by the ClassData attribute returns untyped data rows\",\n\t\t\tUsage,\n\t\t\tInfo,\n\t\t\t\"The class referenced by the ClassData attribute returns untyped data rows, such as object[] or ITheoryDataRow. Consider using generic TheoryDataRow<> as the row type to provide better type safety.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1051_UseCancellationToken { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1051\",\n\t\t\t\"Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1052_TheoryDataShouldNotUseITheoryDataRow { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1052\",\n\t\t\t\"Avoid using 'TheoryData<...>' with types that implement 'ITheoryDataRow'.\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"'TheoryData<...>' should not be used with one or more type arguments that implement 'ITheoryDataRow' or a derived variant. This usage is not supported. Use either 'TheoryData' or a type of 'ITheoryDataRow' exclusively.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X1053_MemberDataMemberMustBeStaticallyWrittenTo { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit1053\",\n\t\t\t\"The static member used as theory data must be statically initialized.\",\n\t\t\tUsage,\n\t\t\tWarning,\n\t\t\t\"The member {0} referenced by MemberData is not initialized before use. Add an inline initializer or initialize the value in the static constructor.\"\n\t\t);\n\n\t// Placeholder for rule X1054\n\n\t// Placeholder for rule X1055\n\n\t// Placeholder for rule X1056\n\n\t// Placeholder for rule X1057\n\n\t// Placeholder for rule X1058\n\n\t// Placeholder for rule X1059\n\n\t// Placeholder for rule X1060\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Descriptors.xUnit2xxx.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing static Microsoft.CodeAnalysis.DiagnosticSeverity;\nusing static Xunit.Analyzers.Category;\n\nnamespace Xunit.Analyzers;\n\npublic static partial class Descriptors\n{\n\tpublic static DiagnosticDescriptor X2000_AssertEqualLiteralValueShouldBeFirst { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2000\",\n\t\t\t\"Constants and literals should be the expected argument\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"The literal or constant value {0} should be passed as the 'expected' argument in the call to '{1}' in method '{2}' on type '{3}'. Swap the parameter values.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2001_AssertEqualsShouldNotBeUsed { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2001\",\n\t\t\t\"Do not use invalid equality check\",\n\t\t\tAssertions,\n\t\t\tHidden,\n\t\t\t\"Do not use {0}. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2002_AssertNullShouldNotBeCalledOnValueTypes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2002\",\n\t\t\t\"Do not use null check on value type\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} on value type '{1}'. Remove this assert.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2003_AssertEqualShouldNotUsedForNullCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2003\",\n\t\t\t\"Do not use equality check to test for null value\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for null value. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2004_AssertEqualShouldNotUsedForBoolLiteralCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2004\",\n\t\t\t\"Do not use equality check to test for boolean conditions\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for boolean conditions. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2005_AssertSameShouldNotBeCalledOnValueTypes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2005\",\n\t\t\t\"Do not use identity check on value type\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} on value type '{1}'. Value types do not have identity. Use Assert.{2} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2006_AssertEqualGenericShouldNotBeUsedForStringValue { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2006\",\n\t\t\t\"Do not use invalid string equality check\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to test for string equality. Use {1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2007_AssertIsTypeShouldUseGenericOverload { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2007\",\n\t\t\t\"Do not use typeof expression to check the type\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use typeof({0}) expression to check the type. Use Assert.IsType<{0}> instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2008_AssertRegexMatchShouldNotUseBoolLiteralCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2008\",\n\t\t\t\"Do not use boolean check to match on regular expressions\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to match on regular expressions. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2009_AssertSubstringCheckShouldNotUseBoolCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2009\",\n\t\t\t\"Do not use boolean check to check for substrings\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for substrings. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2010_AssertStringEqualityCheckShouldNotUseBoolCheckFixer { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2010\",\n\t\t\t\"Do not use boolean check to check for string equality\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for string equality. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2011_AssertEmptyCollectionCheckShouldNotBeUsed { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2011\",\n\t\t\t\"Do not use empty collection check\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for empty collections. Add element inspectors (for non-empty collections), or use Assert.Empty (for empty collections) instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2012_AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2012\",\n\t\t\t\"Do not use boolean check to check if a value exists in a collection\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check if a value exists in a collection. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2013_AssertEqualShouldNotBeUsedForCollectionSizeCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2013\",\n\t\t\t\"Do not use equality check to check for collection size.\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check for collection size. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2014_AssertThrowsShouldNotBeUsedForAsyncThrowsCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2014\",\n\t\t\t\"Do not use throws check to check for asynchronously thrown exception\",\n\t\t\tAssertions,\n\t\t\tError,\n\t\t\t\"Do not use {0} to check for asynchronously thrown exceptions. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2015_AssertThrowsShouldUseGenericOverload { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2015\",\n\t\t\t\"Do not use typeof expression to check the exception type\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use typeof({1}) expression to check the exception type. Use Assert.{0}<{1}> instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2016_AssertEqualPrecisionShouldBeInRange { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2016\",\n\t\t\t\"Keep precision in the allowed range when asserting equality of doubles or decimals.\",\n\t\t\tAssertions,\n\t\t\tError,\n\t\t\t\"Keep precision in range {0} when asserting equality of {1} typed actual value.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2017_AssertCollectionContainsShouldNotUseBoolCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2017\",\n\t\t\t\"Do not use Contains() to check if a value exists in a collection\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use {0} to check if a value exists in a collection. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2018_AssertIsTypeShouldNotBeUsedForAbstractType { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2018\",\n\t\t\t\"Do not compare an object's exact type to an abstract class or interface\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not compare an object's exact type to the {0} '{1}'. Use {2} instead.\"\n\t\t);\n\n\t// Note: X2019 was already covered by X2014, and should not be reused\n\n\tpublic static DiagnosticDescriptor X2020_UseAssertFailInsteadOfBooleanAssert { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2020\",\n\t\t\t\"Do not use always-failing boolean assertions\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use Assert.{0}({1}, message) to fail a test. Use Assert.Fail(message) instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2021_AsyncAssertionsShouldBeAwaited { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2021\",\n\t\t\t\"Async assertions should be awaited\",\n\t\t\tAssertions,\n\t\t\tError,\n\t\t\t\"Assert.{0} is async. The resulting task should be awaited (or stored for later awaiting).\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2022_BooleanAssertionsShouldNotBeNegated { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2022\",\n\t\t\t\"Boolean assertions should not be negated\",\n\t\t\tAssertions,\n\t\t\tInfo,\n\t\t\t\"Do not negate your value when calling Assert.{0}. Call Assert.{1} without the negation instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2023_AssertSingleShouldBeUsedForSingleParameter { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2023\",\n\t\t\t\"Do not use collection methods for single-item collections\",\n\t\t\tAssertions,\n\t\t\tInfo,\n\t\t\t\"Do not use Assert.{0} if there is one element in the collection. Use Assert.Single instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2024_BooleanAssertionsShouldNotBeUsedForSimpleEqualityCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2024\",\n\t\t\t\"Do not use boolean asserts for simple equality tests\",\n\t\t\tAssertions,\n\t\t\tInfo,\n\t\t\t\"Do not use Assert.{0} to test equality against null, numeric, string, or enum literals. Use Assert.{1} instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2025_BooleanAssertionCanBeSimplified { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2025\",\n\t\t\t\"The boolean assertion statement can be simplified\",\n\t\t\tAssertions,\n\t\t\tInfo,\n\t\t\t\"The use of Assert.{0} can be simplified to avoid using a boolean literal value in an equality test.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2026_SetsMustBeComparedWithEqualityComparer { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2026\",\n\t\t\t\"Comparison of sets must be done with IEqualityComparer\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Comparison of two sets may produce inconsistent results if GetHashCode() is not overriden. Consider using Assert.{0}(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>) instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2027_SetsShouldNotBeComparedToLinearContainers { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2027\",\n\t\t\t\"Comparison of sets to linear containers have undefined results\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Comparing an instance of {0} with an instance of {1} has undefined results, because the order of items in the set is not predictable. Create a stable order for the set (i.e., by using OrderBy from Linq).\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2028_DoNotUseAssertEmptyWithProblematicTypes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2028\",\n\t\t\t\"Do not use Assert.Empty or Assert.NotEmpty with problematic types\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Using Assert.{0} with an instance of {1} is problematic, because {2}. Check the length with .Count instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2029_AssertEmptyShouldNotBeUsedForCollectionDoesNotContainCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2029\",\n\t\t\t\"Do not use Assert.Empty to check if a value does not exist in a collection\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use Assert.Empty to check if a value does not exist in a collection. Use Assert.DoesNotContain instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2030_AssertNotEmptyShouldNotBeUsedForCollectionContainsCheck { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2030\",\n\t\t\t\"Do not use Assert.NotEmpty to check if a value exists in a collection\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use Assert.NotEmpty to check if a value exists in a collection. Use Assert.Contains instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2031_AssertSingleShouldUseTwoArgumentCall { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2031\",\n\t\t\t\"Do not use Where clause with Assert.Single\",\n\t\t\tAssertions,\n\t\t\tWarning,\n\t\t\t\"Do not use a Where clause to filter before calling Assert.Single. Use the overload of Assert.Single that accepts a filtering function.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X2032_AssignableFromAssertionIsConfusinglyNamed { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit2032\",\n\t\t\t\"Type assertions based on 'assignable from' are confusingly named\",\n\t\t\tAssertions,\n\t\t\tInfo,\n\t\t\t\"The naming of Assert.{0} can be confusing. An overload of Assert.{1} is available with an exact match flag which can be set to false to perform the same operation.\"\n\t\t);\n\n\t// Placeholder for rule X2033\n\n\t// Placeholder for rule X2034\n\n\t// Placeholder for rule X2035\n\n\t// Placeholder for rule X2036\n\n\t// Placeholder for rule X2037\n\n\t// Placeholder for rule X2038\n\n\t// Placeholder for rule X2039\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Descriptors.xUnit3xxx.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing static Microsoft.CodeAnalysis.DiagnosticSeverity;\nusing static Xunit.Analyzers.Category;\n\nnamespace Xunit.Analyzers;\n\npublic static partial class Descriptors\n{\n\tpublic static DiagnosticDescriptor X3000_CrossAppDomainClassesMustBeLongLivedMarshalByRefObject { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit3000\",\n\t\t\t\"Classes which cross AppDomain boundaries must derive directly or indirectly from LongLivedMarshalByRefObject\",\n\t\t\tExtensibility,\n\t\t\tError,\n\t\t\t\"Class {0} must derive directly or indirectly from LongLivedMarshalByRefObject.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X3001_SerializableClassMustHaveParameterlessConstructor { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit3001\",\n\t\t\t\"Classes that are marked as serializable (or created by the test framework at runtime) must have a public parameterless constructor\",\n\t\t\tExtensibility,\n\t\t\tError,\n\t\t\t\"Class {0} must have a public parameterless constructor to support {1}.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X3002_DoNotTestForConcreteTypeOfJsonSerializableTypes { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit3002\",\n\t\t\t\"Classes which are JSON serializable should not be tested for their concrete type\",\n\t\t\tExtensibility,\n\t\t\tWarning,\n\t\t\t\"Class {0} is JSON serializable and should not be tested for its concrete type. Test for its primary interface instead.\"\n\t\t);\n\n\tpublic static DiagnosticDescriptor X3003_ProvideConstructorForFactAttributeOverride { get; } =\n\t\tDiagnostic(\n\t\t\t\"xUnit3003\",\n\t\t\t\"Classes which extend FactAttribute (directly or indirectly) should provide a public constructor for source information\",\n\t\t\tExtensibility,\n\t\t\tWarning,\n\t\t\t\"Class {0} extends FactAttribute. It should include a public constructor for source information.\"\n\t\t);\n\n\t// Placeholder for rule X3004\n\n\t// Placeholder for rule X3005\n\n\t// Placeholder for rule X3006\n\n\t// Placeholder for rule X3007\n\n\t// Placeholder for rule X3008\n\n\t// Placeholder for rule X3009\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/EmptyAssertContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class EmptyAssertContext : IAssertContext\n{\n\tEmptyAssertContext()\n\t{ }\n\n\tpublic INamedTypeSymbol? AssertType => null;\n\n\tpublic static EmptyAssertContext Instance { get; } = new();\n\n\tpublic bool SupportsAssertFail => false;\n\n\tpublic bool SupportsAssertNullWithPointers => false;\n\n\tpublic bool SupportsInexactTypeAssertions => false;\n\n\tpublic Version Version { get; } = new();\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/EmptyCommonContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class EmptyCommonContext : ICommonContext\n{\n\tEmptyCommonContext()\n\t{ }\n\n\tpublic static EmptyCommonContext Instance { get; } = new();\n\n\tpublic INamedTypeSymbol? IMessageSinkType => null;\n\n\tpublic INamedTypeSymbol? ISourceInformationProviderType => null;\n\n\tpublic INamedTypeSymbol? ITestAssemblyType => null;\n\n\tpublic INamedTypeSymbol? ITestCaseType => null;\n\n\tpublic INamedTypeSymbol? ITestClassType => null;\n\n\tpublic INamedTypeSymbol? ITestCollectionType => null;\n\n\tpublic INamedTypeSymbol? ITestFrameworkDiscovererType => null;\n\n\tpublic INamedTypeSymbol? ITestFrameworkExecutorType => null;\n\n\tpublic INamedTypeSymbol? ITestFrameworkType => null;\n\n\tpublic INamedTypeSymbol? ITestMethodType => null;\n\n\tpublic INamedTypeSymbol? ITestType => null;\n\n\tpublic INamedTypeSymbol? IXunitSerializableType => null;\n\n\tpublic Version Version => new();\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/EmptyCoreContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class EmptyCoreContext : ICoreContext\n{\n\tEmptyCoreContext()\n\t{ }\n\n\tpublic INamedTypeSymbol? ClassDataAttributeType => null;\n\n\tpublic INamedTypeSymbol? CollectionAttributeType => null;\n\n\tpublic INamedTypeSymbol? CollectionDefinitionAttributeType => null;\n\n\tpublic INamedTypeSymbol? DataAttributeType => null;\n\n\tpublic INamedTypeSymbol? FactAttributeType => null;\n\n\tpublic INamedTypeSymbol? IClassFixtureType => null;\n\n\tpublic INamedTypeSymbol? ICollectionFixtureType => null;\n\n\tpublic INamedTypeSymbol? InlineDataAttributeType => null;\n\n\tpublic INamedTypeSymbol? ITestOutputHelperType => null;\n\n\tpublic static EmptyCoreContext Instance { get; } = new();\n\n\tpublic INamedTypeSymbol? MemberDataAttributeType => null;\n\n\tpublic INamedTypeSymbol? TheoryAttributeType => null;\n\n\tpublic bool TheorySupportsConversionFromStringToDateTimeOffsetAndGuid => false;\n\n\tpublic bool TheorySupportsDefaultParameterValues => false;\n\n\tpublic bool TheorySupportsParameterArrays => false;\n\n\tpublic Version Version { get; } = new();\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/EmptyRunnerUtilityContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class EmptyRunnerUtilityContext : IRunnerUtilityContext\n{\n\tEmptyRunnerUtilityContext()\n\t{ }\n\n\tpublic static EmptyRunnerUtilityContext Instance { get; } = new();\n\n\tpublic INamedTypeSymbol? LongLivedMarshalByRefObjectType => null;\n\n\tpublic string Platform => \"N/A\";\n\n\tpublic Version Version { get; } = new();\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/EnumerableExtensions.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Xunit;\n\n/// <summary>\n/// Extension methods for <see cref=\"IEnumerable{T}\"/>.\n/// </summary>\nstatic partial class EnumerableExtensions\n{\n\tstatic readonly Func<object, bool> notNullTest = x => x is not null;\n\n\tpublic static void Add<TKey, TValue>(\n\t\tthis Dictionary<TKey, List<TValue>> dictionary,\n\t\tTKey key,\n\t\tTValue value)\n\t\t\twhere TKey : notnull\n\t{\n\t\tif (!dictionary.TryGetValue(key, out var list))\n\t\t{\n\t\t\tlist = [];\n\t\t\tdictionary[key] = list;\n\t\t}\n\n\t\tlist.Add(value);\n\t}\n\n\tpublic static void AddRange<T>(\n\t\tthis HashSet<T> hashSet,\n\t\tIEnumerable<T> source)\n\t{\n\t\tGuard.ArgumentNotNull(hashSet);\n\t\tGuard.ArgumentNotNull(source);\n\n\t\tforeach (var item in source)\n\t\t\thashSet.Add(item);\n\t}\n\n\t/// <summary>\n\t/// Returns <paramref name=\"source\"/> as an enumerable of <typeparamref name=\"T\"/> with\n\t/// all the <c>null</c> items removed.\n\t/// </summary>\n\tpublic static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> source)\n\t\twhere T : class =>\n\t\t\tGuard.ArgumentNotNull(source).Where((Func<T?, bool>)notNullTest)!;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/IAssertContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic interface IAssertContext\n{\n\t/// <summary>\n\t/// Gets a reference to type <c>Assert</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? AssertType { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether <c>Assert.Fail</c> is supported.\n\t/// </summary>\n\tbool SupportsAssertFail { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether <c>Assert.Null</c> and <c>Assert.NotNull</c> supports\n\t/// unsafe pointers.\n\t/// </summary>\n\tbool SupportsAssertNullWithPointers { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether <c>Assert.IsType</c> and <c>Assert.IsNotType</c>\n\t/// support inexact matches (soft-deprecating <c>Assert.IsAssignableFrom</c>\n\t/// and <c>Assert.IsNotAssignableFrom</c>).\n\t/// </summary>\n\tbool SupportsInexactTypeAssertions { get; }\n\n\t/// <summary>\n\t/// Gets the version number of the assertion assembly.\n\t/// </summary>\n\tVersion Version { get; }\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/ICommonContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\n/// <summary>\n/// Context for types that that originated in <c>xunit.abstractions</c> in v2, and moved in v3\n/// to one of <c>xunit.v3.common</c>, <c>xunit.v3.core</c>, or <c>xunit.v3.runner.common</c>.\n/// </summary>\npublic interface ICommonContext\n{\n\t/// <summary>\n\t/// Gets a reference to type <c>IMessageSink</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? IMessageSinkType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ISourceInformationProvider</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ISourceInformationProviderType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestAssembly</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestAssemblyType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestCase</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestCaseType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestClass</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestClassType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestCollection</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestCollectionType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestFrameworkDiscoverer</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestFrameworkDiscovererType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestFrameworkExecutor</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestFrameworkExecutorType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestFramework</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestFrameworkType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestMethod</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestMethodType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITest</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IXunitSerializable</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? IXunitSerializableType { get; }\n\n\t/// <summary>\n\t/// Gets the version number of the <c>xunit.abstractions</c> or <c>xunit.v3.common</c> assembly.\n\t/// </summary>\n\tpublic Version Version { get; }\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/ICoreContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic interface ICoreContext\n{\n\t/// <summary>\n\t/// Gets a reference to type <c>ClassDataAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ClassDataAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>CollectionAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? CollectionAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>CollectionDefinitionAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? CollectionDefinitionAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>DataAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? DataAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>FactAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? FactAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IClassFixture&lt;T&gt;</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? IClassFixtureType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ICollectionFixture&lt;T&gt;</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ICollectionFixtureType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>InlineDataAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? InlineDataAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestOutputHelper</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? ITestOutputHelperType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>MemberDataAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? MemberDataAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a reference to type <c>TheoryAttribute</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? TheoryAttributeType { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether theory data can be automatically converted from a <see cref=\"string\"/>\n\t/// value into a <see cref=\"DateTimeOffset\"/> or a <see cref=\"Guid\"/>.\n\t/// </summary>\n\tbool TheorySupportsConversionFromStringToDateTimeOffsetAndGuid { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether theory methods support default parameter values.\n\t/// </summary>\n\tbool TheorySupportsDefaultParameterValues { get; }\n\n\t/// <summary>\n\t/// Gets a flag indicating whether theory methods support params arrays.\n\t/// </summary>\n\tbool TheorySupportsParameterArrays { get; }\n\n\t/// <summary>\n\t/// Gets the version number of the core assembly.\n\t/// </summary>\n\tVersion Version { get; }\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/IRunnerUtilityContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic interface IRunnerUtilityContext\n{\n\t/// <summary>\n\t/// Gets a reference to type <c>Xunit.Sdk.LongLivedMarshalByRefObject</c>, if available.\n\t/// </summary>\n\tINamedTypeSymbol? LongLivedMarshalByRefObjectType { get; }\n\n\t/// <summary>\n\t/// Gets a description of the target platform for the runner utility (i.e., \"net452\"). This is\n\t/// typically extracted from the assembly name (i.e., \"xunit.runner.utility.net452\").\n\t/// </summary>\n\tstring Platform { get; }\n\n\t/// <summary>\n\t/// Gets the version number of the runner utility assembly.\n\t/// </summary>\n\tVersion Version { get; }\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/Serializability.cs",
    "content": "namespace Xunit.Analyzers;\n\npublic enum Serializability\n{\n\tNeverSerializable,\n\tPossiblySerializable,\n\tAlwaysSerializable\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/SerializabilityAnalyzer.cs",
    "content": "using System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic sealed class SerializabilityAnalyzer(SerializableTypeSymbols typeSymbols)\n{\n\tstatic readonly Version Version_3_0_1 = new(3, 0, 1);\n\n\t/// <summary>\n\t/// Analyze the given type to determine whether it is always, possibly, or never serializable.\n\t/// </summary>\n\t/// <remarks>\n\t/// The logic in this method corresponds to the logic in SerializationHelper.IsSerializable\n\t/// and SerializationHelper.Serialize.\n\t/// </remarks>\n\tpublic Serializability AnalayzeSerializability(\n\t\tITypeSymbol type,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\ttype = type.UnwrapNullable();\n\n\t\tif (GetTypeKindSerializability(type.TypeKind) == Serializability.NeverSerializable)\n\t\t\treturn Serializability.NeverSerializable;\n\n\t\tif (type.TypeKind == TypeKind.Array && type is IArrayTypeSymbol arrayType)\n\t\t\treturn AnalayzeSerializability(arrayType.ElementType, xunitContext);\n\n\t\tif (typeSymbols.Type.IsAssignableFrom(type))\n\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\tif (type.Equals(typeSymbols.TraitDictionary, SymbolEqualityComparer.Default))\n\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\tif (typeSymbols.IXunitSerializable.IsAssignableFrom(type))\n\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\tif (type.SpecialType != SpecialType.None)\n\t\t\treturn GetSpecialTypeSerializability(type.SpecialType);\n\n\t\tif (type.Equals(typeSymbols.BigInteger, SymbolEqualityComparer.Default)\n\t\t\t|| type.Equals(typeSymbols.DateTimeOffset, SymbolEqualityComparer.Default)\n\t\t\t|| type.Equals(typeSymbols.TimeSpan, SymbolEqualityComparer.Default)\n\t\t\t|| type.Equals(typeSymbols.DateOnly, SymbolEqualityComparer.Default)\n\t\t\t|| type.Equals(typeSymbols.TimeOnly, SymbolEqualityComparer.Default))\n\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\tif (xunitContext.HasV3References)\n\t\t{\n\t\t\tif (type.Equals(typeSymbols.Guid, SymbolEqualityComparer.Default)\n\t\t\t\t|| type.Equals(typeSymbols.Index, SymbolEqualityComparer.Default)\n\t\t\t\t|| type.Equals(typeSymbols.Range, SymbolEqualityComparer.Default)\n\t\t\t\t|| type.Equals(typeSymbols.Uri, SymbolEqualityComparer.Default)\n\t\t\t\t|| type.Equals(typeSymbols.Version, SymbolEqualityComparer.Default))\n\t\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\t\tif (typeSymbols.IFormattable.IsAssignableFrom(type) && typeSymbols.IParsableOfT is not null)\n\t\t\t{\n\t\t\t\tvar iParsableOfSelf = typeSymbols.IParsableOfT.Construct(type);\n\t\t\t\tif (iParsableOfSelf.IsAssignableFrom(type))\n\t\t\t\t\treturn Serializability.AlwaysSerializable;\n\t\t\t}\n\n\t\t\tif (xunitContext.V3Core?.Version >= Version_3_0_1 && typeSymbols.ITuple is not null && typeSymbols.ITuple.IsAssignableFrom(type))\n\t\t\t\treturn Serializability.AlwaysSerializable;\n\t\t}\n\n\t\tif (typeSymbols.TypesWithCustomSerializers.Any(t => t.IsAssignableFrom(type)))\n\t\t\treturn Serializability.AlwaysSerializable;\n\n\t\tif (type.TypeKind == TypeKind.Class && !type.IsSealed)\n\t\t\treturn Serializability.PossiblySerializable;\n\n\t\tif (type.TypeKind == TypeKind.Interface)\n\t\t\treturn Serializability.PossiblySerializable;\n\n\t\tif (type.TypeKind == TypeKind.Enum)\n\t\t\treturn Serializability.PossiblySerializable;\n\n\t\treturn Serializability.NeverSerializable;\n\t}\n\n\tstatic Serializability GetSpecialTypeSerializability(SpecialType type) =>\n\t\ttype switch\n\t\t{\n\t\t\tSpecialType.System_String\n\t\t\t\tor SpecialType.System_Char\n\t\t\t\tor SpecialType.System_Byte\n\t\t\t\tor SpecialType.System_SByte\n\t\t\t\tor SpecialType.System_Int16\n\t\t\t\tor SpecialType.System_UInt16\n\t\t\t\tor SpecialType.System_Int32\n\t\t\t\tor SpecialType.System_UInt32\n\t\t\t\tor SpecialType.System_Int64\n\t\t\t\tor SpecialType.System_UInt64\n\t\t\t\tor SpecialType.System_Single\n\t\t\t\tor SpecialType.System_Double\n\t\t\t\tor SpecialType.System_Decimal\n\t\t\t\tor SpecialType.System_Boolean\n\t\t\t\tor SpecialType.System_DateTime => Serializability.AlwaysSerializable,\n\n\t\t\tSpecialType.None\n\t\t\t\tor SpecialType.System_Object\n\t\t\t\tor SpecialType.System_Array\n\t\t\t\tor SpecialType.System_Enum\n\t\t\t\tor SpecialType.System_ValueType\n\t\t\t\tor SpecialType.System_Nullable_T\n\t\t\t\tor SpecialType.System_Collections_IEnumerable\n\t\t\t\tor SpecialType.System_IDisposable => Serializability.PossiblySerializable,\n\n\t\t\t_ => Serializability.NeverSerializable\n\t\t};\n\n\tstatic Serializability GetTypeKindSerializability(TypeKind kind) =>\n\t\tkind switch\n\t\t{\n\t\t\tTypeKind.Array\n\t\t\t\tor TypeKind.Class\n\t\t\t\tor TypeKind.Enum\n\t\t\t\tor TypeKind.Interface\n\t\t\t\tor TypeKind.Struct => Serializability.PossiblySerializable,\n\n\t\t\t_ => Serializability.NeverSerializable\n\t\t};\n\n\tstatic bool TypeKindShouldBeIgnored(TypeKind kind) =>\n\t\tkind switch\n\t\t{\n\t\t\tTypeKind.Unknown\n\t\t\t\tor TypeKind.Enum\n\t\t\t\tor TypeKind.Error\n\t\t\t\tor TypeKind.Module\n\t\t\t\tor TypeKind.TypeParameter\n\t\t\t\tor TypeKind.Submission => true,\n\n\t\t\t_ => false\n\t\t};\n\n\t/// <summary>\n\t/// Determine whether the given type should be ignored when analyzing serializability.\n\t/// Types are ignored by type kind (and special type for <see cref=\"SpecialType.System_Enum\"/>).\n\t/// Arrays and generic types are ignored if they are composed of ignored types, recursively.\n\t/// </summary>\n\t/// <remarks>\n\t/// Enumerations are serializable if and only if they are not from the Global Assembly Cache,\n\t/// which exists in .NET Framework only. However, static analysis cannot reliably determine\n\t/// whether a type is from a local assembly or the GAC. Therefore, <see cref=\"TypeKind.Enum\"/>\n\t/// and <see cref=\"SpecialType.System_Enum\"/> are ignored, in order to prevent a diagnostic from\n\t/// being always found for all enumeration types.\n\t/// </remarks>\n\tpublic bool TypeShouldBeIgnored([NotNullWhen(false)] ITypeSymbol? type)\n\t{\n\t\tif (type is null)\n\t\t\treturn true;\n\n\t\tif (TypeKindShouldBeIgnored(type.TypeKind) || type.SpecialType == SpecialType.System_Enum)\n\t\t\treturn true;\n\n\t\tif (type is IArrayTypeSymbol arrayType)\n\t\t\treturn TypeShouldBeIgnored(arrayType.ElementType);\n\n\t\tif (type is INamedTypeSymbol namedType && namedType.IsGenericType)\n\t\t\treturn namedType.TypeArguments.Where(TypeShouldBeIgnored).Any();\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/SerializableTypeSymbols.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic sealed class SerializableTypeSymbols\n{\n\treadonly Lazy<INamedTypeSymbol?> bigInteger;\n\treadonly Lazy<INamedTypeSymbol?> dateOnly;\n\treadonly Lazy<INamedTypeSymbol?> dateTimeOffset;\n\treadonly Lazy<INamedTypeSymbol?> guid;\n\treadonly Lazy<INamedTypeSymbol?> iFormattable;\n\treadonly Lazy<INamedTypeSymbol?> index;\n\treadonly Lazy<INamedTypeSymbol?> iParsableOfT;\n\treadonly Lazy<INamedTypeSymbol?> iTuple;\n\treadonly Lazy<INamedTypeSymbol?> iXunitSerializable;\n\treadonly Lazy<INamedTypeSymbol?> range;\n\treadonly Lazy<INamedTypeSymbol?> theoryDataBaseType;\n\treadonly Dictionary<int, INamedTypeSymbol> theoryDataTypes;\n\treadonly Lazy<INamedTypeSymbol?> timeOnly;\n\treadonly Lazy<INamedTypeSymbol?> timeSpan;\n\treadonly Lazy<INamedTypeSymbol?> traitDictionary;\n\treadonly Lazy<INamedTypeSymbol?> type;\n\treadonly Lazy<ImmutableArray<INamedTypeSymbol>> typesWithCustomSerializers;\n\treadonly Lazy<INamedTypeSymbol?> uri;\n\treadonly Lazy<INamedTypeSymbol?> version;\n\n\tSerializableTypeSymbols(\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext,\n\t\tINamedTypeSymbol classDataAttribute,\n\t\tINamedTypeSymbol dataAttribute,\n\t\tINamedTypeSymbol memberDataAttribute,\n\t\tINamedTypeSymbol theoryAttribute,\n\t\tDictionary<int, INamedTypeSymbol> theoryDataTypes)\n\t{\n\t\tthis.theoryDataTypes = theoryDataTypes;\n\n\t\tbigInteger = new(() => TypeSymbolFactory.BigInteger(compilation));\n\t\tdateOnly = new(() => TypeSymbolFactory.DateOnly(compilation));\n\t\tdateTimeOffset = new(() => TypeSymbolFactory.DateTimeOffset(compilation));\n\t\tguid = new(() => TypeSymbolFactory.Guid(compilation));\n\t\tiFormattable = new(() => TypeSymbolFactory.IFormattable(compilation));\n\t\tindex = new(() => TypeSymbolFactory.Index(compilation));\n\t\tiParsableOfT = new(() => TypeSymbolFactory.IParsableOfT(compilation));\n\t\tiTuple = new(() => TypeSymbolFactory.ITuple(compilation));\n\t\tiXunitSerializable = new(() => xunitContext.Common.IXunitSerializableType);\n\t\trange = new(() => TypeSymbolFactory.Range(compilation));\n\t\t// For v2 and early versions of v3, the base type is \"TheoryData\" (non-generic). For later versions\n\t\t// of v3, it's \"TheoryDataBase<TTheoryDataRow, TRawDataRow>\". In either case, getting \"TheoryData<T>\"\n\t\t// and going up one layer gets us the type we want to be able to search for.\n\t\ttheoryDataBaseType = new(() => TheoryData(arity: 1)?.BaseType);\n\t\ttimeOnly = new(() => TypeSymbolFactory.TimeOnly(compilation));\n\t\ttimeSpan = new(() => TypeSymbolFactory.TimeSpan(compilation));\n\t\ttraitDictionary = new(() => GetTraitDictionary(compilation));\n\t\ttype = new(() => TypeSymbolFactory.Type(compilation));\n\t\ttypesWithCustomSerializers = new(() =>\n\t\t{\n\t\t\tvar registerXunitSerializer = TypeSymbolFactory.RegisterXunitSerializerAttribute_V3(compilation);\n\t\t\tif (registerXunitSerializer is null)\n#pragma warning disable IDE0301  // Cannot convert this due to Roslyn 3.11\n\t\t\t\treturn ImmutableArray<INamedTypeSymbol>.Empty;\n#pragma warning restore IDE0301\n\n\t\t\treturn\n\t\t\t\tcompilation\n\t\t\t\t\t.Assembly\n\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t.Where(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, registerXunitSerializer) && a.ConstructorArguments.Length > 1 && a.ConstructorArguments[1].Kind == TypedConstantKind.Array)\n\t\t\t\t\t.SelectMany(a => a.ConstructorArguments[1].Values.Select(v => v.Value as INamedTypeSymbol))\n\t\t\t\t\t.WhereNotNull()\n\t\t\t\t\t.ToImmutableArray();\n\t\t});\n\t\turi = new(() => TypeSymbolFactory.Uri(compilation));\n\t\tversion = new(() => TypeSymbolFactory.Version(compilation));\n\n\t\tClassDataAttribute = classDataAttribute;\n\t\tDataAttribute = dataAttribute;\n\t\tMemberDataAttribute = memberDataAttribute;\n\t\tTheoryAttribute = theoryAttribute;\n\t}\n\n\tpublic INamedTypeSymbol? BigInteger => bigInteger.Value;\n\tpublic INamedTypeSymbol ClassDataAttribute { get; }\n\tpublic INamedTypeSymbol DataAttribute { get; }\n\tpublic INamedTypeSymbol? DateOnly => dateOnly.Value;\n\tpublic INamedTypeSymbol? DateTimeOffset => dateTimeOffset.Value;\n\tpublic INamedTypeSymbol? Guid => guid.Value;\n\tpublic INamedTypeSymbol? IFormattable => iFormattable.Value;\n\tpublic INamedTypeSymbol? Index => index.Value;\n\tpublic INamedTypeSymbol? IParsableOfT => iParsableOfT.Value;\n\tpublic INamedTypeSymbol? ITuple => iTuple.Value;\n\tpublic INamedTypeSymbol? IXunitSerializable => iXunitSerializable.Value;\n\tpublic INamedTypeSymbol MemberDataAttribute { get; }\n\tpublic INamedTypeSymbol? Range => range.Value;\n\tpublic INamedTypeSymbol TheoryAttribute { get; }\n\tpublic INamedTypeSymbol? TheoryDataBaseType => theoryDataBaseType.Value;\n\tpublic INamedTypeSymbol? TimeOnly => timeOnly.Value;\n\tpublic INamedTypeSymbol? TimeSpan => timeSpan.Value;\n\tpublic INamedTypeSymbol? TraitDictionary => traitDictionary.Value;\n\tpublic INamedTypeSymbol? Type => type.Value;\n\tpublic ImmutableArray<INamedTypeSymbol> TypesWithCustomSerializers => typesWithCustomSerializers.Value;\n\tpublic INamedTypeSymbol? Uri => uri.Value;\n\tpublic INamedTypeSymbol? Version => version.Value;\n\n\tpublic static SerializableTypeSymbols? Create(\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.TheoryAttributeType is not INamedTypeSymbol theoryAttribute)\n\t\t\treturn null;\n\t\tif (xunitContext.Core.DataAttributeType is not INamedTypeSymbol dataAttribute)\n\t\t\treturn null;\n\t\tif (xunitContext.Core.ClassDataAttributeType is not INamedTypeSymbol classDataAttribute)\n\t\t\treturn null;\n\t\tif (xunitContext.Core.MemberDataAttributeType is not INamedTypeSymbol memberDataAttribute)\n\t\t\treturn null;\n\n\t\treturn new SerializableTypeSymbols(\n\t\t\tcompilation,\n\t\t\txunitContext,\n\t\t\tclassDataAttribute,\n\t\t\tdataAttribute,\n\t\t\tmemberDataAttribute,\n\t\t\ttheoryAttribute,\n\t\t\tTypeSymbolFactory.TheoryData_ByGenericArgumentCount(compilation)\n\t\t);\n\t}\n\n\tstatic INamedTypeSymbol? GetTraitDictionary(Compilation compilation)\n\t{\n\t\tif (TypeSymbolFactory.DictionaryofTKeyTValue(compilation) is not INamedTypeSymbol dictionaryType)\n\t\t\treturn null;\n\n\t\tif (TypeSymbolFactory.ListOfT(compilation) is not INamedTypeSymbol listType)\n\t\t\treturn null;\n\n\t\tvar stringType = compilation.GetSpecialType(SpecialType.System_String);\n\t\tvar listOfStringType = listType.Construct(stringType);\n\t\treturn dictionaryType.Construct(stringType, listOfStringType);\n\t}\n\n\tpublic INamedTypeSymbol? TheoryData(int arity)\n\t{\n\t\ttheoryDataTypes.TryGetValue(arity, out var result);\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/SymbolExtensions.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic static class SymbolExtensions\n{\n\tpublic static bool ContainsAttributeType(\n\t\tthis ImmutableArray<AttributeData> attributes,\n\t\tINamedTypeSymbol attributeType,\n\t\tbool exactMatch = false) =>\n\t\t\tattributes.Any(a => a.IsInstanceOf(attributeType, exactMatch));\n\n\t/// <summary>\n\t/// If the passed <paramref name=\"typeSymbol\"/> is <see cref=\"T:System.Collections.Generic.IAsyncEnumerable{T}\"/>,\n\t/// then returns the enumerable type (aka, T); otherwise, returns <c>null</c>.\n\t/// </summary>\n\tpublic static ITypeSymbol? GetAsyncEnumerableType(this ITypeSymbol? typeSymbol)\n\t{\n\t\tif (typeSymbol is not INamedTypeSymbol namedTypeSymbol)\n\t\t\treturn null;\n\n\t\t// Ideally we'd use symbol comparison here, but that would require threading the\n\t\t// Compilation object here, and with 44 callers to IsAssignableFrom that seemed\n\t\t// like an unnecessarily daunting task. We cross fingers that this is good. :)\n\t\tif (namedTypeSymbol.Name == \"IAsyncEnumerable\" && namedTypeSymbol.ContainingNamespace.ToString() == \"System.Collections.Generic\")\n\t\t\treturn namedTypeSymbol.TypeArguments[0];\n\n\t\treturn null;\n\t}\n\n\t/// <summary>\n\t/// If the passed <paramref name=\"typeSymbol\"/> is <see cref=\"IEnumerable{T}\"/>, then returns\n\t/// the enumerable type (aka, T); otherwise, returns <c>null</c>.\n\t/// </summary>\n\tpublic static ITypeSymbol? GetEnumerableType(this ITypeSymbol? typeSymbol)\n\t{\n\t\tif (typeSymbol is not INamedTypeSymbol namedTypeSymbol)\n\t\t\treturn null;\n\n\t\tif (namedTypeSymbol.OriginalDefinition.SpecialType != SpecialType.System_Collections_Generic_IEnumerable_T)\n\t\t\treturn null;\n\n\t\treturn namedTypeSymbol.TypeArguments[0];\n\t}\n\n\tpublic static INamedTypeSymbol? GetGenericInterfaceImplementation(\n\t\tthis ITypeSymbol implementingType,\n\t\tINamedTypeSymbol openInterfaceType)\n\t{\n\t\tGuard.ArgumentNotNull(implementingType);\n\t\tGuard.ArgumentNotNull(openInterfaceType);\n\n\t\tif (SymbolEqualityComparer.Default.Equals(implementingType.OriginalDefinition, openInterfaceType))\n\t\t\treturn implementingType as INamedTypeSymbol;\n\n\t\treturn implementingType.AllInterfaces.FirstOrDefault(i => SymbolEqualityComparer.Default.Equals(i.OriginalDefinition, openInterfaceType));\n\t}\n\n\tpublic static ISymbol? GetMember(\n\t\tthis INamespaceOrTypeSymbol namespaceOrType,\n\t\tstring name) =>\n\t\t\tGuard.ArgumentNotNull(namespaceOrType).GetMembers(name).FirstOrDefault();\n\n\tpublic static ImmutableArray<ISymbol> GetInheritedAndOwnMembers(\n\t\tthis ITypeSymbol? symbol,\n\t\tstring? name = null)\n\t{\n\t\tvar builder = ImmutableArray.CreateBuilder<ISymbol>();\n\t\twhile (symbol is not null)\n\t\t{\n\t\t\tbuilder.AddRange(name is null ? symbol.GetMembers() : symbol.GetMembers(name));\n\t\t\tsymbol = symbol.BaseType;\n\t\t}\n\n\t\treturn builder.ToImmutable();\n\t}\n\n\tpublic static bool IsAssignableFrom(\n\t\tthis ITypeSymbol? targetType,\n\t\tITypeSymbol? sourceType,\n\t\tbool exactMatch = false)\n\t{\n\t\tif (targetType is not null)\n\t\t{\n\t\t\tvar targetEnumerableType = targetType.GetEnumerableType();\n\t\t\tvar targetAsyncEnumerableType = targetType.GetAsyncEnumerableType();\n\n\t\t\twhile (sourceType is not null)\n\t\t\t{\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(sourceType, targetType))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (exactMatch)\n\t\t\t\t\treturn false;\n\n\t\t\t\t// Special handling for IEnumerable<T> == IEnumerable<T>, because the Ts are covariant and the\n\t\t\t\t// symbol equality comparerer is an exact comparison, not a compatibility test.\n\t\t\t\tif (targetEnumerableType is not null)\n\t\t\t\t{\n\t\t\t\t\tvar sourceEnumerableType = sourceType.GetEnumerableType();\n\t\t\t\t\tif (sourceEnumerableType is not null)\n\t\t\t\t\t\treturn IsAssignableFrom(targetEnumerableType, sourceEnumerableType);\n\t\t\t\t}\n\n\t\t\t\t// Special handling for IAsyncEnumerable<T> == IAsyncEnumerable<T> as well\n\t\t\t\tif (targetAsyncEnumerableType is not null)\n\t\t\t\t{\n\t\t\t\t\tvar sourceAsyncEnumerableType = sourceType.GetAsyncEnumerableType();\n\t\t\t\t\tif (sourceAsyncEnumerableType is not null)\n\t\t\t\t\t\treturn IsAssignableFrom(targetAsyncEnumerableType, sourceAsyncEnumerableType);\n\t\t\t\t}\n\n\t\t\t\t// Special handling for tuples as tuples with differently named fields are still assignable\n\t\t\t\tif (targetType.IsTupleType && sourceType.IsTupleType)\n\t\t\t\t{\n\t\t\t\t\tvar targetTupleType = ((INamedTypeSymbol)targetType).TupleUnderlyingType ?? targetType;\n\t\t\t\t\tvar sourceTupleType = ((INamedTypeSymbol)sourceType).TupleUnderlyingType ?? sourceType;\n\t\t\t\t\treturn SymbolEqualityComparer.Default.Equals(sourceTupleType, targetTupleType);\n\t\t\t\t}\n\n\t\t\t\t// Special handling for generic types, possibly with type constraints\n\t\t\t\tif (targetType is INamedTypeSymbol namedTargetType && namedTargetType.IsGenericType &&\n\t\t\t\t\tsourceType is INamedTypeSymbol namedSourceType && namedSourceType.IsGenericType)\n\t\t\t\t{\n\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(namedTargetType.OriginalDefinition, namedSourceType.OriginalDefinition))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Unbound generic types (e.g., List<>) are assignable from any open/closed generic of the same definition (e.g., List<int> or List<T>)\n\t\t\t\t\t\tif (namedTargetType.IsUnboundGenericType)\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t// Open/closed generic types must have compatible type arguments\n\t\t\t\t\t\tbool argumentsMatch = true;\n\t\t\t\t\t\tfor (int i = 0; i < namedTargetType.TypeArguments.Length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tArg = namedTargetType.TypeArguments[i];\n\t\t\t\t\t\t\tvar sArg = namedSourceType.TypeArguments[i];\n\n\t\t\t\t\t\t\tif (tArg.TypeKind == TypeKind.TypeParameter)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t// Recursively verify nested arguments (e.g., IEnumerable<string> inside Task<IEnumerable<string>>)\n\t\t\t\t\t\t\tif (!IsAssignableFrom(tArg, sArg, exactMatch))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\targumentsMatch = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (argumentsMatch)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (targetType.TypeKind == TypeKind.Interface)\n\t\t\t\t\treturn sourceType.AllInterfaces.Any(i => IsAssignableFrom(targetType, i));\n\n\t\t\t\tsourceType = sourceType.BaseType;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic static bool IsInstanceOf(\n\t\tthis AttributeData attribute,\n\t\tINamedTypeSymbol attributeType,\n\t\tbool exactMatch = false) =>\n\t\t\tGuard.ArgumentNotNull(attributeType).IsAssignableFrom(\n\t\t\t\tGuard.ArgumentNotNull(attribute).AttributeClass,\n\t\t\t\texactMatch\n\t\t\t);\n\n\tpublic static ITypeSymbol? UnwrapEnumerable(\n\t\tthis ITypeSymbol? type,\n\t\tCompilation compilation,\n\t\tbool unwrapArray = false)\n\t{\n\t\tif (type is null)\n\t\t\treturn null;\n\n\t\tvar iEnumerableOfT = TypeSymbolFactory.IEnumerableOfT(compilation);\n\t\tvar result = UnwrapEnumerable(type, iEnumerableOfT, unwrapArray);\n\n\t\tif (result is null)\n\t\t{\n\t\t\tvar iAsyncEnumerableOfT = TypeSymbolFactory.IAsyncEnumerableOfT(compilation);\n\t\t\tif (iAsyncEnumerableOfT is not null)\n\t\t\t\tresult = UnwrapEnumerable(type, iAsyncEnumerableOfT, unwrapArray);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic static ITypeSymbol? UnwrapEnumerable(\n\t\tthis ITypeSymbol? type,\n\t\tITypeSymbol enumerableType,\n\t\tbool unwrapArray = false)\n\t{\n\t\tif (type is null)\n\t\t\treturn null;\n\n\t\tif (unwrapArray && type is IArrayTypeSymbol arrayType)\n\t\t\treturn arrayType.ElementType;\n\n\t\tIEnumerable<INamedTypeSymbol> interfaces = type.AllInterfaces;\n\t\tif (type is INamedTypeSymbol namedType)\n\t\t\tinterfaces = interfaces.Concat([namedType]);\n\n\t\tforeach (var @interface in interfaces)\n\t\t\tif (SymbolEqualityComparer.Default.Equals(@interface.OriginalDefinition, enumerableType))\n\t\t\t\treturn @interface.TypeArguments[0];\n\n\t\treturn null;\n\t}\n\n\tpublic static ITypeSymbol UnwrapNullable(this ITypeSymbol type)\n\t{\n\t\tGuard.ArgumentNotNull(type);\n\n\t\tif (type is not INamedTypeSymbol namedType)\n\t\t\treturn type;\n\n\t\tif (namedType.IsGenericType && namedType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)\n\t\t\treturn namedType.TypeArguments[0];\n\n\t\treturn type;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/SyntaxExtensions.cs",
    "content": "using System.Threading;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace Xunit.Analyzers;\n\npublic static class SyntaxExtensions\n{\n\tpublic static bool ContainsAttributeType(\n\t\tthis SyntaxList<AttributeListSyntax> attributeLists,\n\t\tSemanticModel semanticModel,\n\t\tINamedTypeSymbol attributeType,\n\t\tbool exactMatch = false)\n\t{\n\t\tGuard.ArgumentNotNull(semanticModel);\n\t\tGuard.ArgumentNotNull(attributeType);\n\n\t\tforeach (var attributeList in attributeLists)\n\t\t{\n\t\t\tforeach (var attribute in attributeList.Attributes)\n\t\t\t{\n\t\t\t\tvar type = semanticModel.GetTypeInfo(attribute).Type;\n\t\t\t\tif (attributeType.IsAssignableFrom(type, exactMatch))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic static SimpleNameSyntax? GetSimpleName(this InvocationExpressionSyntax invocation) =>\n\t\tGuard.ArgumentNotNull(invocation).Expression switch\n\t\t{\n\t\t\tMemberAccessExpressionSyntax memberAccess => memberAccess.Name,\n\t\t\tSimpleNameSyntax simpleName => simpleName,\n\t\t\t_ => null,\n\t\t};\n\n\tpublic static bool IsEnumValueExpression(\n\t\tthis ExpressionSyntax expression,\n\t\tSemanticModel semanticModel,\n\t\tCancellationToken cancellationToken = default)\n\t{\n\t\tGuard.ArgumentNotNull(expression);\n\t\tGuard.ArgumentNotNull(semanticModel);\n\n\t\tif (!expression.IsKind(SyntaxKind.SimpleMemberAccessExpression))\n\t\t\treturn false;\n\n\t\tvar symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;\n\t\treturn symbol?.Kind == SymbolKind.Field && symbol.ContainingType.TypeKind == TypeKind.Enum;\n\t}\n\n\tpublic static bool IsNameofExpression(\n\t\tthis ExpressionSyntax expression,\n\t\tSemanticModel semanticModel,\n\t\tCancellationToken cancellationToken = default)\n\t{\n\t\tGuard.ArgumentNotNull(expression);\n\t\tGuard.ArgumentNotNull(semanticModel);\n\n\t\tif (!expression.IsKind(SyntaxKind.InvocationExpression))\n\t\t\treturn false;\n\t\tif (expression is not InvocationExpressionSyntax invocation)\n\t\t\treturn false;\n\t\tif (invocation.ArgumentList.Arguments.Count != 1)\n\t\t\treturn false;\n\t\tif ((invocation.Expression as IdentifierNameSyntax)?.Identifier.ValueText != \"nameof\")\n\t\t\treturn false;\n\n\t\t// A real nameof expression doesn't have a matching symbol, but it does have the string type\n\t\treturn\n\t\t\tsemanticModel.GetSymbolInfo(expression, cancellationToken).Symbol is null\n\t\t\t&& semanticModel.GetTypeInfo(expression, cancellationToken).Type?.SpecialType == SpecialType.System_String;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/TypeHierarchyComparer.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class TypeHierarchyComparer : IComparer<ITypeSymbol>\n{\n\tTypeHierarchyComparer()\n\t{ }\n\n\tpublic static TypeHierarchyComparer Instance { get; } = new TypeHierarchyComparer();\n\n\tpublic int Compare(\n\t\tITypeSymbol? x,\n\t\tITypeSymbol? y)\n\t{\n\t\tGuard.ArgumentValid(\"The argument must be a class\", x?.TypeKind == TypeKind.Class, nameof(x));\n\t\tGuard.ArgumentValid(\"The argument must be a class\", y?.TypeKind == TypeKind.Class, nameof(x));\n\n\t\tif (SymbolEqualityComparer.Default.Equals(x, y))\n\t\t\treturn 0;\n\t\tif (x.IsAssignableFrom(y))\n\t\t\treturn -1;\n\t\tif (y.IsAssignableFrom(x))\n\t\t\treturn 1;\n\n\t\tthrow new InvalidOperationException(\"Encountered types not in a hierarchy\");\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/TypeSymbolFactory.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic static class TypeSymbolFactory\n{\n\tpublic static INamedTypeSymbol? Action(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Action\");\n\n\tpublic static INamedTypeSymbol? Action(\n\t\tCompilation compilation,\n\t\tint arity = 1) =>\n\t\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName($\"System.Action`{ValidateArity(arity, min: 1, max: 16)}\");\n\n\tpublic static INamedTypeSymbol? ArraySegmentOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.ArraySegment`1\");\n\n\tpublic static INamedTypeSymbol? AssemblyFixtureAttribute_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.AssemblyFixtureAttribute_V3);\n\n\tpublic static INamedTypeSymbol? Assert(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.Assert);\n\n\tpublic static INamedTypeSymbol? AttributeUsageAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.AttributeUsageAttribute\");\n\n\tpublic static INamedTypeSymbol? BigInteger(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Numerics.BigInteger\");\n\n\tpublic static INamedTypeSymbol? CallerFilePathAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.CompilerServices.CallerFilePathAttribute\");\n\n\tpublic static INamedTypeSymbol? CallerLineNumberAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.CompilerServices.CallerLineNumberAttribute\");\n\n\tpublic static INamedTypeSymbol? CancellationToken(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.CancellationToken\");\n\n\tpublic static INamedTypeSymbol? ClassDataAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ClassDataAttribute);\n\n\tpublic static INamedTypeSymbol? ClassDataAttributeOfT_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ClassDataAttributeOfT_V3);\n\n\tpublic static INamedTypeSymbol? CollectionAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.CollectionAttribute);\n\n\tpublic static INamedTypeSymbol? CollectionAttributeOfT_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.CollectionAttributeOfT_V3);\n\n\tpublic static INamedTypeSymbol? CollectionDefinitionAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.CollectionDefinitionAttribute);\n\n\tpublic static INamedTypeSymbol? ConfigureAwaitOptions(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.ConfigureAwaitOptions\");\n\n\tpublic static INamedTypeSymbol? ConfiguredTaskAwaitable(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.CompilerServices.ConfiguredTaskAwaitable\");\n\n\tpublic static INamedTypeSymbol? DataAttribute_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.DataAttribute_V2);\n\n\tpublic static INamedTypeSymbol? DataAttribute_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.DataAttribute_V3);\n\n\tpublic static INamedTypeSymbol? DateOnly(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.DateOnly\");\n\n\tpublic static INamedTypeSymbol? DateTimeOffset(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.DateTimeOffset\");\n\n\tpublic static INamedTypeSymbol? DictionaryofTKeyTValue(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.Dictionary`2\");\n\n\tpublic static INamedTypeSymbol? FactAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.FactAttribute);\n\n\tpublic static INamedTypeSymbol? Func(\n\t\tCompilation compilation,\n\t\tint arity = 1) =>\n\t\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName($\"System.Func`{ValidateArity(arity, min: 1, max: 17)}\");\n\n\tpublic static INamedTypeSymbol? Guid(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Guid\");\n\n\tpublic static INamedTypeSymbol? IAssemblyInfo_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IAssemblyInfo_V2);\n\n\tpublic static INamedTypeSymbol? IAsyncEnumerableOfITheoryDataRow(Compilation compilation)\n\t{\n\t\tvar iAsyncEnumerableOfT = IAsyncEnumerableOfT(compilation);\n\t\tif (iAsyncEnumerableOfT is null)\n\t\t\treturn null;\n\n\t\tvar iTheoryDataRow = ITheoryDataRow_V3(compilation);\n\t\tif (iTheoryDataRow is null)\n\t\t\treturn null;\n\n\t\treturn iAsyncEnumerableOfT.Construct(iTheoryDataRow);\n\t}\n\n\tpublic static INamedTypeSymbol? IAsyncEnumerableOfObjectArray(Compilation compilation)\n\t{\n\t\tvar iAsyncEnumerableOfT = IAsyncEnumerableOfT(compilation);\n\t\tif (iAsyncEnumerableOfT is null)\n\t\t\treturn null;\n\n\t\tvar objectArray = ObjectArray(compilation);\n\t\treturn iAsyncEnumerableOfT.Construct(objectArray);\n\t}\n\n\tpublic static INamedTypeSymbol? IAsyncEnumerableOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.IAsyncEnumerable`1\");\n\n\tpublic static INamedTypeSymbol? IAsyncEnumerableOfTuple(Compilation compilation)\n\t{\n\t\tvar iTuple = ITuple(compilation);\n\t\tif (iTuple is null)\n\t\t\treturn null;\n\n\t\treturn IAsyncEnumerableOfT(compilation)?.Construct(iTuple);\n\t}\n\n\tpublic static INamedTypeSymbol? IAsyncLifetime(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IAsyncLifetime);\n\n\tpublic static INamedTypeSymbol? IAttributeInfo_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IAttributeInfo_V2);\n\n\tpublic static INamedTypeSymbol? IClassFixureOfT(Compilation compilation) =>\n\t\t Guard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IClassFixtureOfT);\n\n\tpublic static INamedTypeSymbol? ICollection(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.ICollection\");\n\n\tpublic static INamedTypeSymbol? ICollectionFixtureOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ICollectionFixtureOfT);\n\n\tpublic static INamedTypeSymbol ICollectionOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Collections_Generic_ICollection_T);\n\n\tpublic static INamedTypeSymbol? ICriticalNotifyCompletion(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.CompilerServices.ICriticalNotifyCompletion\");\n\n\tpublic static INamedTypeSymbol? IDataAttribute_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IDataAttribute_V3);\n\n\tpublic static INamedTypeSymbol IDisposable(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_IDisposable);\n\n\tpublic static INamedTypeSymbol? IEnumerableOfITheoryDataRow(Compilation compilation)\n\t{\n\t\tvar iTheoryDataRow = ITheoryDataRow_V3(compilation);\n\t\tif (iTheoryDataRow is null)\n\t\t\treturn null;\n\n\t\treturn IEnumerableOfT(compilation).Construct(iTheoryDataRow);\n\t}\n\n\tpublic static INamedTypeSymbol IEnumerableOfObjectArray(Compilation compilation) =>\n\t\tIEnumerableOfT(compilation).Construct(ObjectArray(compilation));\n\n\tpublic static INamedTypeSymbol IEnumerableOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T);\n\n\tpublic static INamedTypeSymbol? IEnumerableOfTuple(Compilation compilation)\n\t{\n\t\tvar iTuple = ITuple(compilation);\n\t\tif (iTuple is null)\n\t\t\treturn null;\n\n\t\treturn IEnumerableOfT(compilation).Construct(iTuple);\n\t}\n\n\tpublic static INamedTypeSymbol? IFormattable(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.IFormattable\");\n\n\tpublic static INamedTypeSymbol? IMessageSink_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IMessageSink_V2);\n\n\tpublic static INamedTypeSymbol? IMessageSink_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IMessageSink_V3);\n\n\tpublic static INamedTypeSymbol? IMessageSinkMessage_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IMessageSinkMessage_V2);\n\n\tpublic static INamedTypeSymbol? IMethodInfo_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IMethodInfo_V2);\n\n\tpublic static INamedTypeSymbol? Index(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Index\");\n\n\tpublic static INamedTypeSymbol? InlineDataAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.InlineDataAttribute);\n\n\tpublic static INamedTypeSymbol? IParameterInfo_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IParameterInfo_V2);\n\n\tpublic static INamedTypeSymbol? IParsableOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.IParsable`1\");\n\n\tpublic static INamedTypeSymbol IReadOnlyCollectionOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Collections_Generic_IReadOnlyCollection_T);\n\n\tpublic static INamedTypeSymbol? IReadOnlySetOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.IReadOnlySet`1\");\n\n\tpublic static INamedTypeSymbol? IRunnerReporter_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IRunnerReporter_V3);\n\n\tpublic static INamedTypeSymbol? ISetOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.ISet`1\");\n\n\tpublic static INamedTypeSymbol? ISourceInformation_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ISourceInformation_V2);\n\n\tpublic static INamedTypeSymbol? ISourceInformationProvider_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ISourceInformationProvider_V2);\n\n\tpublic static INamedTypeSymbol? ISourceInformationProvider_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ISourceInformationProvider_V3);\n\n\tpublic static INamedTypeSymbol? ITest_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITest_V2);\n\n\tpublic static INamedTypeSymbol? ITest_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITest_V3);\n\n\tpublic static INamedTypeSymbol? ITestAssembly_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestAssembly_V2);\n\n\tpublic static INamedTypeSymbol? ITestAssembly_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestAssembly_V3);\n\n\tpublic static INamedTypeSymbol? ITestCase_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestCase_V2);\n\n\tpublic static INamedTypeSymbol? ITestCase_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestCase_V3);\n\n\tpublic static INamedTypeSymbol? ITestClass_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestClass_V2);\n\n\tpublic static INamedTypeSymbol? ITestClass_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestClass_V3);\n\n\tpublic static INamedTypeSymbol? ITestCollection_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestCollection_V2);\n\n\tpublic static INamedTypeSymbol? ITestCollection_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestCollection_V3);\n\n\tpublic static INamedTypeSymbol? ITestContextAccessor_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestContextAccessor_V3);\n\n\tpublic static INamedTypeSymbol? ITestFramework_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFramework_V2);\n\n\tpublic static INamedTypeSymbol? ITestFramework_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFramework_V3);\n\n\tpublic static INamedTypeSymbol? ITestFrameworkDiscoverer_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFrameworkDiscoverer_V2);\n\n\tpublic static INamedTypeSymbol? ITestFrameworkDiscoverer_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFrameworkDiscoverer_V3);\n\n\tpublic static INamedTypeSymbol? ITestFrameworkExecutor_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFrameworkExecutor_V2);\n\n\tpublic static INamedTypeSymbol? ITestFrameworkExecutor_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestFrameworkExecutor_V3);\n\n\tpublic static INamedTypeSymbol? ITestMethod_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestMethod_V2);\n\n\tpublic static INamedTypeSymbol? ITestMethod_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestMethod_V3);\n\n\tpublic static INamedTypeSymbol? ITestOutputHelper_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestOutputHelper_V2);\n\n\tpublic static INamedTypeSymbol? ITestOutputHelper_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITestOutputHelper_V3);\n\n\tpublic static INamedTypeSymbol? ITheoryDataRow_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITheoryDataRow_V3);\n\n\tpublic static INamedTypeSymbol? ITuple(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.CompilerServices.ITuple\");\n\n\tpublic static INamedTypeSymbol? ITypeInfo_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.ITypeInfo_V2);\n\n\tpublic static INamedTypeSymbol? IValueTaskSource(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.Sources.IValueTaskSource\");\n\n\tpublic static INamedTypeSymbol? IValueTaskSourceOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.Sources.IValueTaskSource`1\");\n\n\tpublic static INamedTypeSymbol? IXunitSerializable_V2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IXunitSerializable_V2);\n\n\tpublic static INamedTypeSymbol? IXunitSerializable_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IXunitSerializable_V3);\n\n\tpublic static INamedTypeSymbol? IXunitSerializer_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.IXunitSerializer_V3);\n\n\tpublic static INamedTypeSymbol? JsonTypeIDAttribute_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.JsonTypeIDAttribute_V3);\n\n\tpublic static INamedTypeSymbol? ListOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.List`1\");\n\n\tpublic static INamedTypeSymbol? LongLivedMarshalByRefObject_ExecutionV2(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.LongLivedMarshalByRefObject_Execution_V2);\n\n\tpublic static INamedTypeSymbol? LongLivedMarshalByRefObject_RunnerUtility(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.LongLivedMarshalByRefObject_RunnerUtility);\n\n\tpublic static INamedTypeSymbol? MemberDataAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.MemberDataAttribute);\n\n\tpublic static INamedTypeSymbol NullableOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Nullable_T);\n\n\tpublic static IArrayTypeSymbol ObjectArray(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).CreateArrayTypeSymbol(Guard.ArgumentNotNull(compilation).ObjectType);\n\n\tpublic static INamedTypeSymbol? ObsoleteAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.System.ObsoleteAttribute);\n\n\tpublic static INamedTypeSymbol? OptionalAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Runtime.InteropServices.OptionalAttribute\");\n\n\tpublic static INamedTypeSymbol? Range(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Range\");\n\n\tpublic static INamedTypeSymbol? Record(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.Record);\n\n\tpublic static INamedTypeSymbol? RegisterXunitSerializerAttribute_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.RegisterXunitSerializerAttribute_V3);\n\n\tpublic static INamedTypeSymbol? SortedSetOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Collections.Generic.SortedSet`1\");\n\n\tpublic static INamedTypeSymbol String(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_String);\n\n\tpublic static INamedTypeSymbol? StringValues(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"Microsoft.Extensions.Primitives.StringValues\");\n\n\tpublic static INamedTypeSymbol? Task(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.Task\");\n\n\tpublic static INamedTypeSymbol? TaskOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.Task`1\");\n\n\tpublic static INamedTypeSymbol? TestContext_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.TestContext_V3);\n\n\tpublic static INamedTypeSymbol? TheoryAttribute(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.TheoryAttribute);\n\n\tpublic static INamedTypeSymbol? TheoryData(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.TheoryData);\n\n\t// Centralized here so we don't repeat knowledge of how many arities exist\n\t// (in case we decide to add more later).\n\tpublic static Dictionary<int, INamedTypeSymbol> TheoryData_ByGenericArgumentCount(Compilation compilation)\n\t{\n\t\tvar result = new Dictionary<int, INamedTypeSymbol>();\n\n\t\tvar type = TheoryData(compilation);\n\t\tif (type is not null)\n\t\t\tresult[0] = type;\n\n\t\tfor (var i = 1; ; i++)\n\t\t{\n\t\t\ttype = compilation.GetTypeByMetadataName(Constants.Types.Xunit.TheoryData + \"`\" + i.ToString(CultureInfo.InvariantCulture));\n\t\t\tif (type is not null)\n\t\t\t\tresult[i] = type;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic static INamedTypeSymbol? TheoryDataRow_V3(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(Constants.Types.Xunit.TheoryDataRow_V3);\n\n\t// Centralized here so we don't repeat knowledge of how many arities exist\n\t// (in case we decide to add more later).\n\tpublic static Dictionary<int, INamedTypeSymbol> TheoryDataRow_ByGenericArgumentCount_V3(Compilation compilation)\n\t{\n\t\tvar result = new Dictionary<int, INamedTypeSymbol>();\n\n\t\tvar type = TheoryDataRow_V3(compilation);\n\t\tif (type is not null)\n\t\t\tresult[0] = type;\n\n\t\tfor (var i = 1; ; i++)\n\t\t{\n\t\t\ttype = compilation.GetTypeByMetadataName(Constants.Types.Xunit.TheoryDataRow_V3 + \"`\" + i.ToString(CultureInfo.InvariantCulture));\n\t\t\tif (type is not null)\n\t\t\t\tresult[i] = type;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic static INamedTypeSymbol? TimeOnly(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.TimeOnly\");\n\n\tpublic static INamedTypeSymbol? TimeSpan(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.TimeSpan\");\n\n\tpublic static INamedTypeSymbol? Type(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Type\");\n\n\tstatic int ValidateArity(\n\t\tint arity,\n\t\tint min,\n\t\tint max)\n\t{\n\t\tif (arity >= min && arity <= max)\n\t\t\treturn arity;\n\n\t\tthrow new ArgumentOutOfRangeException(nameof(arity), $\"Arity {arity} must be between {min} and {max}.\");\n\t}\n\n\tpublic static INamedTypeSymbol? Uri(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Uri\");\n\n\tpublic static INamedTypeSymbol? ValueTask(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.ValueTask\");\n\n\tpublic static INamedTypeSymbol? ValueTaskOfT(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Threading.Tasks.ValueTask`1\");\n\n\tpublic static INamedTypeSymbol? Version(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetTypeByMetadataName(\"System.Version\");\n\n\tpublic static INamedTypeSymbol Void(Compilation compilation) =>\n\t\tGuard.ArgumentNotNull(compilation).GetSpecialType(SpecialType.System_Void);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V2AbstractionsContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V2AbstractionsContext : ICommonContext\n{\n\treadonly Lazy<INamedTypeSymbol?> lazyIAssemblyInfoType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIAttributeInfoType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIMessageSinkMessageType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIMessageSinkType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIMethodInfoType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIParameterInfoType;\n\treadonly Lazy<INamedTypeSymbol?> lazyISourceInformationProviderType;\n\treadonly Lazy<INamedTypeSymbol?> lazyISourceInformationType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestAssemblyType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestCaseType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestClassType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestCollectionType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkDiscovererType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkExecutorType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestMethodType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITypeInfoType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIXunitSerializableType;\n\n\tV2AbstractionsContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyIAssemblyInfoType = new(() => TypeSymbolFactory.IAssemblyInfo_V2(compilation));\n\t\tlazyIAttributeInfoType = new(() => TypeSymbolFactory.IAttributeInfo_V2(compilation));\n\t\tlazyIMessageSinkMessageType = new(() => TypeSymbolFactory.IMessageSinkMessage_V2(compilation));\n\t\tlazyIMessageSinkType = new(() => TypeSymbolFactory.IMessageSink_V2(compilation));\n\t\tlazyIMethodInfoType = new(() => TypeSymbolFactory.IMethodInfo_V2(compilation));\n\t\tlazyIParameterInfoType = new(() => TypeSymbolFactory.IParameterInfo_V2(compilation));\n\t\tlazyISourceInformationProviderType = new(() => TypeSymbolFactory.ISourceInformationProvider_V2(compilation));\n\t\tlazyISourceInformationType = new(() => TypeSymbolFactory.ISourceInformation_V2(compilation));\n\t\tlazyITestAssemblyType = new(() => TypeSymbolFactory.ITestAssembly_V2(compilation));\n\t\tlazyITestCaseType = new(() => TypeSymbolFactory.ITestCase_V2(compilation));\n\t\tlazyITestClassType = new(() => TypeSymbolFactory.ITestClass_V2(compilation));\n\t\tlazyITestCollectionType = new(() => TypeSymbolFactory.ITestCollection_V2(compilation));\n\t\tlazyITestFrameworkDiscovererType = new(() => TypeSymbolFactory.ITestFrameworkDiscoverer_V2(compilation));\n\t\tlazyITestFrameworkExecutorType = new(() => TypeSymbolFactory.ITestFrameworkExecutor_V2(compilation));\n\t\tlazyITestFrameworkType = new(() => TypeSymbolFactory.ITestFramework_V2(compilation));\n\t\tlazyITestMethodType = new(() => TypeSymbolFactory.ITestMethod_V2(compilation));\n\t\tlazyITestType = new(() => TypeSymbolFactory.ITest_V2(compilation));\n\t\tlazyITypeInfoType = new(() => TypeSymbolFactory.ITypeInfo_V2(compilation));\n\t\tlazyIXunitSerializableType = new(() => TypeSymbolFactory.IXunitSerializable_V2(compilation));\n\t}\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IAssemblyInfo</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IAssemblyInfoType =>\n\t\tlazyIAssemblyInfoType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IAttributeInfo</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IAttributeInfoType =>\n\t\tlazyIAttributeInfoType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IMessageSinkMessage</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IMessageSinkMessageType =>\n\t\tlazyIMessageSinkMessageType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? IMessageSinkType =>\n\t\tlazyIMessageSinkType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IMethodInfo</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IMethodInfoType =>\n\t\tlazyIMethodInfoType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IParameterInfo</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IParameterInfoType =>\n\t\tlazyIParameterInfoType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ISourceInformationProviderType =>\n\t\tlazyISourceInformationProviderType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ISourceInformation</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? ISourceInformationType =>\n\t\tlazyISourceInformationType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestAssemblyType =>\n\t\tlazyITestAssemblyType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestCaseType =>\n\t\tlazyITestCaseType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestClassType =>\n\t\tlazyITestClassType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestCollectionType =>\n\t\tlazyITestCollectionType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestFrameworkDiscovererType =>\n\t\tlazyITestFrameworkDiscovererType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestFrameworkExecutorType =>\n\t\tlazyITestFrameworkExecutorType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestFrameworkType =>\n\t\tlazyITestFrameworkType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestMethodType =>\n\t\tlazyITestMethodType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestType =>\n\t\tlazyITestType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITypeInfo</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? ITypeInfoType =>\n\t\tlazyITypeInfoType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? IXunitSerializableType =>\n\t\tlazyIXunitSerializableType.Value;\n\n\t/// <summary>\n\t/// Gets the version number of the <c>xunit.abstractions</c> assembly.\n\t/// </summary>\n\tpublic Version Version { get; }\n\n\tpublic static V2AbstractionsContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.abstractions\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V2AssertContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V2AssertContext : IAssertContext\n{\n\tinternal static readonly Version Version_2_5_0 = new(\"2.5.0\");\n\tinternal static readonly Version Version_2_9_3 = new(\"2.9.3\");\n\n\treadonly Lazy<INamedTypeSymbol?> lazyAssertType;\n\n\tV2AssertContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyAssertType = new(() => TypeSymbolFactory.Assert(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? AssertType =>\n\t\tlazyAssertType.Value;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsAssertFail =>\n\t\tVersion >= Version_2_5_0;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsAssertNullWithPointers =>\n\t\tfalse;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsInexactTypeAssertions =>\n\t\tVersion >= Version_2_9_3;\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V2AssertContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.assert\", StringComparison.OrdinalIgnoreCase) || a.Name.Equals(\"xunit.assert.source\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V2CoreContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V2CoreContext : ICoreContext\n{\n\tinternal static readonly Version Version_2_2_0 = new(\"2.2.0\");\n\tinternal static readonly Version Version_2_4_0 = new(\"2.4.0\");\n\n\treadonly Lazy<INamedTypeSymbol?> lazyClassDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyCollectionAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyCollectionDefinitionAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyFactAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIClassFixtureType;\n\treadonly Lazy<INamedTypeSymbol?> lazyICollectionFixtureType;\n\treadonly Lazy<INamedTypeSymbol?> lazyInlineDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestOutputHelperType;\n\treadonly Lazy<INamedTypeSymbol?> lazyMemberDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyTheoryAttributeType;\n\n\tV2CoreContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyClassDataAttributeType = new(() => TypeSymbolFactory.ClassDataAttribute(compilation));\n\t\tlazyCollectionAttributeType = new(() => TypeSymbolFactory.CollectionAttribute(compilation));\n\t\tlazyCollectionDefinitionAttributeType = new(() => TypeSymbolFactory.CollectionDefinitionAttribute(compilation));\n\t\tlazyDataAttributeType = new(() => TypeSymbolFactory.DataAttribute_V2(compilation));\n\t\tlazyFactAttributeType = new(() => TypeSymbolFactory.FactAttribute(compilation));\n\t\tlazyIClassFixtureType = new(() => TypeSymbolFactory.IClassFixureOfT(compilation));\n\t\tlazyICollectionFixtureType = new(() => TypeSymbolFactory.ICollectionFixtureOfT(compilation));\n\t\tlazyInlineDataAttributeType = new(() => TypeSymbolFactory.InlineDataAttribute(compilation));\n\t\tlazyITestOutputHelperType = new(() => TypeSymbolFactory.ITestOutputHelper_V2(compilation));\n\t\tlazyMemberDataAttributeType = new(() => TypeSymbolFactory.MemberDataAttribute(compilation));\n\t\tlazyTheoryAttributeType = new(() => TypeSymbolFactory.TheoryAttribute(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ClassDataAttributeType =>\n\t\tlazyClassDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? CollectionAttributeType =>\n\t\tlazyCollectionAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? CollectionDefinitionAttributeType =>\n\t\tlazyCollectionDefinitionAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? DataAttributeType =>\n\t\tlazyDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? FactAttributeType =>\n\t\tlazyFactAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? IClassFixtureType =>\n\t\tlazyIClassFixtureType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ICollectionFixtureType =>\n\t\tlazyICollectionFixtureType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? InlineDataAttributeType =>\n\t\tlazyInlineDataAttributeType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>Xunit.Abstractions.ITestOutputHelper</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? ITestOutputHelperType =>\n\t\tlazyITestOutputHelperType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? MemberDataAttributeType =>\n\t\tlazyMemberDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? TheoryAttributeType =>\n\t\tlazyTheoryAttributeType.Value;\n\n\t// See: https://github.com/xunit/xunit/pull/1546\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsConversionFromStringToDateTimeOffsetAndGuid =>\n\t\tVersion >= Version_2_4_0;\n\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsDefaultParameterValues =>\n\t\tVersion >= Version_2_2_0;\n\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsParameterArrays =>\n\t\tVersion >= Version_2_2_0;\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V2CoreContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.core\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V2ExecutionContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V2ExecutionContext\n{\n\tconst string assemblyPrefix = \"xunit.execution.\";\n\treadonly Lazy<INamedTypeSymbol?> lazyLongLivedMarshalByRefObjectType;\n\n\tV2ExecutionContext(\n\t\tCompilation compilation,\n\t\tstring platform,\n\t\tVersion version)\n\t{\n\t\tPlatform = platform;\n\t\tVersion = version;\n\n\t\tlazyLongLivedMarshalByRefObjectType = new(() => TypeSymbolFactory.LongLivedMarshalByRefObject_ExecutionV2(compilation));\n\t}\n\n\t/// <summary>\n\t/// Gets a reference to type <c>Xunit.LongLivedMarshalByRefObject</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? LongLivedMarshalByRefObjectType =>\n\t\tlazyLongLivedMarshalByRefObjectType.Value;\n\n\t/// <summary>\n\t/// Gets a description of the target platform for the execution library (i.e., \"desktop\"). This is\n\t/// typically extracted from the assembly name (i.e., \"xunit.execution.desktop\").\n\t/// </summary>\n\tpublic string Platform { get; }\n\n\t/// <summary>\n\t/// Gets the version number of the execution assembly.\n\t/// </summary>\n\tpublic Version Version { get; }\n\n\tpublic static V2ExecutionContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar assembly =\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.StartsWith(assemblyPrefix, StringComparison.OrdinalIgnoreCase));\n\n\t\tif (assembly is null)\n\t\t\treturn null;\n\n\t\tvar version = versionOverride ?? assembly.Version;\n\t\tvar platform = assembly.Name.Substring(assemblyPrefix.Length);\n\n\t\treturn version is null ? null : new(compilation, platform, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V2RunnerUtilityContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V2RunnerUtilityContext : IRunnerUtilityContext\n{\n\tconst string assemblyPrefix = \"xunit.runner.utility.\";\n\treadonly Lazy<INamedTypeSymbol?> lazyLongLivedMarshalByRefObjectType;\n\n\tV2RunnerUtilityContext(\n\t\tCompilation compilation,\n\t\tstring platform,\n\t\tVersion version)\n\t{\n\t\tPlatform = platform;\n\t\tVersion = version;\n\n\t\tlazyLongLivedMarshalByRefObjectType = new(() => TypeSymbolFactory.LongLivedMarshalByRefObject_RunnerUtility(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? LongLivedMarshalByRefObjectType =>\n\t\tlazyLongLivedMarshalByRefObjectType.Value;\n\n\t/// <inheritdoc/>\n\tpublic string Platform { get; }\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V2RunnerUtilityContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar assembly =\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.StartsWith(assemblyPrefix, StringComparison.OrdinalIgnoreCase));\n\n\t\tif (assembly is null)\n\t\t\treturn null;\n\n\t\tvar version = versionOverride ?? assembly.Version;\n\t\tvar platform = assembly.Name.Substring(assemblyPrefix.Length);\n\n\t\treturn version is null ? null : new(compilation, platform, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V3AssertContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V3AssertContext : IAssertContext\n{\n\tinternal static readonly Version Version_0_6_0 = new(\"0.6.0\");\n\tinternal static readonly Version Version_3_0_1 = new(\"3.0.1\");\n\n\treadonly Lazy<INamedTypeSymbol?> lazyAssertType;\n\n\tV3AssertContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyAssertType = new(() => TypeSymbolFactory.Assert(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? AssertType =>\n\t\tlazyAssertType.Value;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsAssertFail => true;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsAssertNullWithPointers =>\n\t\tVersion >= Version_3_0_1;\n\n\t/// <inheritdoc/>\n\tpublic bool SupportsInexactTypeAssertions =>\n\t\tVersion >= Version_0_6_0;\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V3AssertContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.v3.assert\", StringComparison.OrdinalIgnoreCase) || a.Name.Equals(\"xunit.v3.assert.source\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V3CommonContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V3CommonContext : ICommonContext\n{\n\treadonly Lazy<INamedTypeSymbol?> lazyIMessageSinkType;\n\treadonly Lazy<INamedTypeSymbol?> lazyISourceInformationProviderType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestAssemblyType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestCaseType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestClassType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestCollectionType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkDiscovererType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkExecutorType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestFrameworkType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestMethodType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIXunitSerializableType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIXunitSerializerType;\n\n\tV3CommonContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyIMessageSinkType = new(() => TypeSymbolFactory.IMessageSink_V3(compilation));\n\t\tlazyISourceInformationProviderType = new(() => TypeSymbolFactory.ISourceInformationProvider_V3(compilation));\n\t\tlazyITestAssemblyType = new(() => TypeSymbolFactory.ITestAssembly_V3(compilation));\n\t\tlazyITestCaseType = new(() => TypeSymbolFactory.ITestCase_V3(compilation));\n\t\tlazyITestClassType = new(() => TypeSymbolFactory.ITestClass_V3(compilation));\n\t\tlazyITestCollectionType = new(() => TypeSymbolFactory.ITestCollection_V3(compilation));\n\t\tlazyITestFrameworkDiscovererType = new(() => TypeSymbolFactory.ITestFrameworkDiscoverer_V3(compilation));\n\t\tlazyITestFrameworkExecutorType = new(() => TypeSymbolFactory.ITestFrameworkExecutor_V3(compilation));\n\t\tlazyITestFrameworkType = new(() => TypeSymbolFactory.ITestFramework_V3(compilation));\n\t\tlazyITestMethodType = new(() => TypeSymbolFactory.ITestMethod_V3(compilation));\n\t\tlazyITestType = new(() => TypeSymbolFactory.ITest_V3(compilation));\n\t\tlazyIXunitSerializableType = new(() => TypeSymbolFactory.IXunitSerializable_V3(compilation));\n\t\tlazyIXunitSerializerType = new(() => TypeSymbolFactory.IXunitSerializer_V3(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? IMessageSinkType =>\n\t\tlazyIMessageSinkType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.runner.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ISourceInformationProviderType =>\n\t\tlazyISourceInformationProviderType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestAssemblyType =>\n\t\tlazyITestAssemblyType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestCaseType =>\n\t\tlazyITestCaseType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestClassType =>\n\t\tlazyITestClassType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestCollectionType =>\n\t\tlazyITestCollectionType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.core</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestFrameworkDiscovererType =>\n\t\tlazyITestFrameworkDiscovererType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.core</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestFrameworkExecutorType =>\n\t\tlazyITestFrameworkExecutorType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.core</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestFrameworkType =>\n\t\tlazyITestFrameworkType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestMethodType =>\n\t\tlazyITestMethodType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? ITestType =>\n\t\tlazyITestType.Value;\n\n\t/// <inheritdoc/>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? IXunitSerializableType =>\n\t\tlazyIXunitSerializableType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IXunitSerializer</c>, if available.\n\t/// </summary>\n\t/// <remarks>This type lives in <c>xunit.v3.common</c>.</remarks>\n\tpublic INamedTypeSymbol? IXunitSerializerType =>\n\t\tlazyIXunitSerializerType.Value;\n\n\t/// <summary>\n\t/// Gets the version number of the <c>xunit.v3.common</c> assembly.\n\t/// </summary>\n\tpublic Version Version { get; }\n\n\tpublic static V3CommonContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.v3.common\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V3CoreContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V3CoreContext : ICoreContext\n{\n\treadonly Lazy<INamedTypeSymbol?> lazyAssemblyFixtureAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyClassDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyClassDataAttributeOfTType;\n\treadonly Lazy<INamedTypeSymbol?> lazyCollectionAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyCollectionAttributeOfTType;\n\treadonly Lazy<INamedTypeSymbol?> lazyCollectionDefinitionAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyFactAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIClassFixtureType;\n\treadonly Lazy<INamedTypeSymbol?> lazyICollectionFixtureType;\n\treadonly Lazy<INamedTypeSymbol?> lazyIDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyInlineDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestContextAccessorType;\n\treadonly Lazy<INamedTypeSymbol?> lazyITestOutputHelperType;\n\treadonly Lazy<INamedTypeSymbol?> lazyJsonTypeIDAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyMemberDataAttributeType;\n\treadonly Lazy<INamedTypeSymbol?> lazyTheoryAttributeType;\n\n\tV3CoreContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyAssemblyFixtureAttributeType = new(() => TypeSymbolFactory.AssemblyFixtureAttribute_V3(compilation));\n\t\tlazyClassDataAttributeType = new(() => TypeSymbolFactory.ClassDataAttribute(compilation));\n\t\tlazyClassDataAttributeOfTType = new(() => TypeSymbolFactory.ClassDataAttributeOfT_V3(compilation));\n\t\tlazyCollectionAttributeType = new(() => TypeSymbolFactory.CollectionAttribute(compilation));\n\t\tlazyCollectionAttributeOfTType = new(() => TypeSymbolFactory.CollectionAttributeOfT_V3(compilation));\n\t\tlazyCollectionDefinitionAttributeType = new(() => TypeSymbolFactory.CollectionDefinitionAttribute(compilation));\n\t\tlazyDataAttributeType = new(() => TypeSymbolFactory.DataAttribute_V3(compilation));\n\t\tlazyFactAttributeType = new(() => TypeSymbolFactory.FactAttribute(compilation));\n\t\tlazyIClassFixtureType = new(() => TypeSymbolFactory.IClassFixureOfT(compilation));\n\t\tlazyICollectionFixtureType = new(() => TypeSymbolFactory.ICollectionFixtureOfT(compilation));\n\t\tlazyIDataAttributeType = new(() => TypeSymbolFactory.IDataAttribute_V3(compilation));\n\t\tlazyInlineDataAttributeType = new(() => TypeSymbolFactory.InlineDataAttribute(compilation));\n\t\tlazyITestContextAccessorType = new(() => TypeSymbolFactory.ITestContextAccessor_V3(compilation));\n\t\tlazyITestOutputHelperType = new(() => TypeSymbolFactory.ITestOutputHelper_V3(compilation));\n\t\tlazyJsonTypeIDAttributeType = new(() => TypeSymbolFactory.JsonTypeIDAttribute_V3(compilation));\n\t\tlazyMemberDataAttributeType = new(() => TypeSymbolFactory.MemberDataAttribute(compilation));\n\t\tlazyTheoryAttributeType = new(() => TypeSymbolFactory.TheoryAttribute(compilation));\n\t}\n\n\t/// <summary>\n\t/// Gets a reference to type <c>AssemblyFixtureAttribute</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? AssemblyFixtureAttributeType =>\n\t\tlazyAssemblyFixtureAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ClassDataAttributeType =>\n\t\tlazyClassDataAttributeType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ClassDataAttribute&lt;T&gt;</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? ClassDataAttributeOfTType =>\n\t\tlazyClassDataAttributeOfTType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? CollectionAttributeType =>\n\t\tlazyCollectionAttributeType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>CollectionAttribute&lt;T&gt;</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? CollectionAttributeOfTType =>\n\t\tlazyCollectionAttributeOfTType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? CollectionDefinitionAttributeType =>\n\t\tlazyCollectionDefinitionAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? DataAttributeType =>\n\t\tlazyDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? FactAttributeType =>\n\t\tlazyFactAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? IClassFixtureType =>\n\t\tlazyIClassFixtureType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ICollectionFixtureType =>\n\t\tlazyICollectionFixtureType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>IDataAttribute</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? IDataAttributeType =>\n\t\tlazyIDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? InlineDataAttributeType =>\n\t\tlazyInlineDataAttributeType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>ITestContextAccessor</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? ITestContextAccessorType =>\n\t\tlazyITestContextAccessorType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? ITestOutputHelperType =>\n\t\tlazyITestOutputHelperType.Value;\n\n\t/// <summary>\n\t/// Gets a reference to type <c>JsonTypeIDAttribute</c>, if available.\n\t/// </summary>\n\tpublic INamedTypeSymbol? JsonTypeIDAttributeType =>\n\t\tlazyJsonTypeIDAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? MemberDataAttributeType =>\n\t\tlazyMemberDataAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? TheoryAttributeType =>\n\t\tlazyTheoryAttributeType.Value;\n\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsConversionFromStringToDateTimeOffsetAndGuid => true;\n\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsDefaultParameterValues => true;\n\n\t/// <inheritdoc/>\n\tpublic bool TheorySupportsParameterArrays => true;\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V3CoreContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar version =\n\t\t\tversionOverride ??\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.v3.core\", StringComparison.OrdinalIgnoreCase))\n\t\t\t\t?.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V3RunnerCommonContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V3RunnerCommonContext\n{\n\treadonly Lazy<INamedTypeSymbol?> lazyIRunnerReporterType;\n\n\tV3RunnerCommonContext(\n\t\tCompilation compilation,\n\t\tVersion version)\n\t{\n\t\tVersion = version;\n\n\t\tlazyIRunnerReporterType = new(() => TypeSymbolFactory.IRunnerReporter_V3(compilation));\n\t}\n\n\tpublic INamedTypeSymbol? IRunnerReporterType =>\n\t\tlazyIRunnerReporterType.Value;\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V3RunnerCommonContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar assembly =\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.Equals(\"xunit.v3.runner.common\", StringComparison.OrdinalIgnoreCase));\n\n\t\tif (assembly is null)\n\t\t\treturn null;\n\n\t\tvar version = versionOverride ?? assembly.Version;\n\n\t\treturn version is null ? null : new(compilation, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/V3RunnerUtilityContext.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\npublic class V3RunnerUtilityContext : IRunnerUtilityContext\n{\n\tconst string assemblyPrefix = \"xunit.v3.runner.utility.\";\n\treadonly Lazy<INamedTypeSymbol?> lazyLongLivedMarshalByRefObjectType;\n\n\tV3RunnerUtilityContext(\n\t\tCompilation compilation,\n\t\tstring platform,\n\t\tVersion version)\n\t{\n\t\tPlatform = platform;\n\t\tVersion = version;\n\n\t\tlazyLongLivedMarshalByRefObjectType = new(() => TypeSymbolFactory.LongLivedMarshalByRefObject_RunnerUtility(compilation));\n\t}\n\n\t/// <inheritdoc/>\n\tpublic INamedTypeSymbol? LongLivedMarshalByRefObjectType =>\n\t\tlazyLongLivedMarshalByRefObjectType.Value;\n\n\t/// <inheritdoc/>\n\tpublic string Platform { get; }\n\n\t/// <inheritdoc/>\n\tpublic Version Version { get; }\n\n\tpublic static V3RunnerUtilityContext? Get(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\n\t\tvar assembly =\n\t\t\tcompilation\n\t\t\t\t.ReferencedAssemblyNames\n\t\t\t\t.FirstOrDefault(a => a.Name.StartsWith(assemblyPrefix, StringComparison.OrdinalIgnoreCase));\n\n\t\tif (assembly is null)\n\t\t\treturn null;\n\n\t\tvar version = versionOverride ?? assembly.Version;\n\t\tvar platform = assembly.Name.Substring(assemblyPrefix.Length);\n\n\t\treturn version is null ? null : new(compilation, platform, version);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitContext.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\n/// <summary>\n/// Class which provides information about references to xUnit.net assemblies.\n/// </summary>\npublic class XunitContext\n{\n\tIAssertContext? assert;\n\tICommonContext? common;\n\tICoreContext? core;\n\tIRunnerUtilityContext? runnerUtility;\n\tstatic readonly Version v2AbstractionsVersion = new(2, 0, 3);\n\n\tXunitContext()\n\t{ }\n\n\t/// <summary>\n\t/// Initializes a new instance of the <see cref=\"XunitContext\"/> class.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types and\n\t/// inspect references</param>\n\tpublic XunitContext(Compilation compilation)\n\t{\n\t\tV2Abstractions = V2AbstractionsContext.Get(compilation);\n\t\tV2Assert = V2AssertContext.Get(compilation);\n\t\tV2Core = V2CoreContext.Get(compilation);\n\t\tV2Execution = V2ExecutionContext.Get(compilation);\n\t\tV2RunnerUtility = V2RunnerUtilityContext.Get(compilation);\n\n\t\tV3Assert = V3AssertContext.Get(compilation);\n\t\tV3Common = V3CommonContext.Get(compilation);\n\t\tV3Core = V3CoreContext.Get(compilation);\n\t\tV3RunnerCommon = V3RunnerCommonContext.Get(compilation);\n\t}\n\n\t/// <summary>\n\t/// Gets a combined view of the assertion library features available to either v2 tests (linked\n\t/// against <c>xunit.assert</c> or <c>xunit.assert.source</c>) or v3 tests (linked against\n\t/// <c>xunit.v3.assert</c> or <c>xunit.v3.assert.source</c>).\n\t/// </summary>\n\tpublic IAssertContext Assert\n\t{\n\t\tget\n\t\t{\n\t\t\tassert ??= V3Assert ?? (IAssertContext?)V2Assert ?? EmptyAssertContext.Instance;\n\t\t\treturn assert;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Gets a combined view of features that are common to both tests and runners, available to either\n\t/// v2 tests (linked against <c>xunit.abstractions</c>) or v3 tests (linked against <c>xunit.v3.common</c>).\n\t/// </summary>\n\tpublic ICommonContext Common\n\t{\n\t\tget\n\t\t{\n\t\t\tcommon ??= V3Common ?? (ICommonContext?)V2Abstractions ?? EmptyCommonContext.Instance;\n\t\t\treturn common;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Gets a combined view of features available to either v2 tests (linked against <c>xunit.core</c>)\n\t/// or v3 tests (linked against <c>xunit.v3.core</c>).\n\t/// </summary>\n\tpublic ICoreContext Core\n\t{\n\t\tget\n\t\t{\n\t\t\tcore ??= V3Core ?? (ICoreContext?)V2Core ?? EmptyCoreContext.Instance;\n\t\t\treturn core;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Gets a flag which indicates whether there are any xUnit.net v2 references in the project\n\t/// (including abstractions, assert, core, execution, and runner utility references).\n\t/// </summary>\n\tpublic bool HasV2References =>\n\t\tV2Abstractions is not null || V2Assert is not null || V2Core is not null || V2Execution is not null || V2RunnerUtility is not null;\n\n\t/// <summary>\n\t/// Gets a flag which indicates whether there are any xUnit.net v3 references in the project\n\t/// (including assert, common, and core references).\n\t/// </summary>\n\tpublic bool HasV3References =>\n\t\tV3Assert is not null || V3Common is not null || V3Core is not null;\n\n\t/// <summary>\n\t/// Gets a combined view of features available to either v2 runners (linked against <c>xunit.runner.utility</c>)\n\t/// or v3 runners (linked against <c>xunit.v3.runner.utility</c>).\n\t/// </summary>\n\tpublic IRunnerUtilityContext RunnerUtility\n\t{\n\t\tget\n\t\t{\n\t\t\trunnerUtility ??= V3RunnerUtility ?? (IRunnerUtilityContext?)V2RunnerUtility ?? EmptyRunnerUtilityContext.Instance;\n\t\t\treturn runnerUtility;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.abstractions</c> (v2). If the project does\n\t/// not reference the v2 abstractions library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V2AbstractionsContext? V2Abstractions { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.assert</c> or <c>xunit.assert.source</c> (v2). If\n\t/// the project does not reference the v2 assertion library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V2AssertContext? V2Assert { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.core</c>(v2). If the project does not\n\t/// reference the v2 core library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V2CoreContext? V2Core { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.execution</c> (v2). If the project does\n\t/// not reference the v2 execution library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V2ExecutionContext? V2Execution { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.runner.utility</c> (v2). If the project does\n\t/// not reference the v2 runner utility library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V2RunnerUtilityContext? V2RunnerUtility { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.v3.assert</c> or <c>xunit.v3.assert.source</c>\n\t/// (v3). If the project does not reference the v3 assertion library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V3AssertContext? V3Assert { get; private set; }\n\n\t/// <summary>\n\t/// Gets types that exist in <c>xunit.v3.common</c> (v3). If the project does not reference\n\t/// the v3 common library, then returns <c>null</c>.\n\t/// </summary>\n\t/// <remarks>\n\t/// This also contains a few selected types from <c>xunit.v3.core</c> and <c>xunit.v3.runner.common</c>\n\t/// to align with the types that were all originally in <c>xunit.abstractions</c> in v2, to support\n\t/// the composite view from <see cref=\"ICommonContext\"/>.\n\t/// </remarks>\n\tpublic V3CommonContext? V3Common { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.v3.core</c> (v3). If the project does not\n\t/// reference the v3 core library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V3CoreContext? V3Core { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.v3.runner.common</c> (v3). If the project does\n\t/// not reference the v3 runner common library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V3RunnerCommonContext? V3RunnerCommon { get; private set; }\n\n\t/// <summary>\n\t/// Gets information about the reference to <c>xunit.v3.runner.utility</c> (v3). If the project does\n\t/// not reference the v3 runner utility library, then returns <c>null</c>.\n\t/// </summary>\n\tpublic V3RunnerUtilityContext? V3RunnerUtility { get; private set; }\n\n\t/// <summary>\n\t/// Used to create a context object for testing v2 analyzers and fixers. This includes references\n\t/// to <c>xunit.abstractions</c> (at version 2.0.3) and <c>xunit.core</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for <c>xunit.core</c></param>\n\tpublic static XunitContext ForV2(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV2Abstractions = V2AbstractionsContext.Get(compilation, v2AbstractionsVersion),\n\t\t\t\tV2Core = V2CoreContext.Get(compilation, versionOverride),\n\t\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v2 analyzers and fixers. This includes references\n\t/// to <c>xunit.abstactions</c> (at version 2.0.3).\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// </summary>\n\tpublic static XunitContext ForV2Abstractions(Compilation compilation) =>\n\t\tnew()\n\t\t{\n\t\t\tV2Abstractions = V2AbstractionsContext.Get(compilation, v2AbstractionsVersion),\n\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v2 analyzers and fixers. This includes references\n\t/// to <c>xunit.assert</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for <c>xunit.assert</c></param>\n\tpublic static XunitContext ForV2Assert(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV2Assert = V2AssertContext.Get(compilation, versionOverride),\n\t\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v2 analyzers and fixers. This includes references\n\t/// to <c>xunit.abstractions</c> (at version 2.0.3) and <c>xunit.execution</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for <c>xunit.execution</c></param>\n\tpublic static XunitContext ForV2Execution(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV2Abstractions = V2AbstractionsContext.Get(compilation, v2AbstractionsVersion),\n\t\t\t\tV2Execution = V2ExecutionContext.Get(compilation, versionOverride),\n\t\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v2 analyzers and fixers. This includes references\n\t/// to <c>xunit.abstractions</c> (at version 2.0.3) and <c>xunit.runner.utility</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for <c>xunit.runner.utility</c></param>\n\tpublic static XunitContext ForV2RunnerUtility(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV2Abstractions = V2AbstractionsContext.Get(compilation, v2AbstractionsVersion),\n\t\t\t\tV2RunnerUtility = V2RunnerUtilityContext.Get(compilation, versionOverride),\n\t\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v3 analyzers and fixers. This includes references\n\t/// for <c>xunit.v3.assert</c>, <c>xunit.v3.common</c>, <c>xunit.v3.core</c>, and\n\t/// <c>xunit.v3.runner.common</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for all libraries</param>\n\tpublic static XunitContext ForV3(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV3Assert = V3AssertContext.Get(compilation, versionOverride),\n\t\t\t\tV3Common = V3CommonContext.Get(compilation, versionOverride),\n\t\t\t\tV3Core = V3CoreContext.Get(compilation, versionOverride),\n\t\t\t\tV3RunnerCommon = V3RunnerCommonContext.Get(compilation, versionOverride),\n\t\t\t};\n\n\t/// <summary>\n\t/// Used to create a context object for testing v3 analyzers and fixers. This includes references\n\t/// for <c>xunit.v3.assert</c>.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation object used to look up types</param>\n\t/// <param name=\"versionOverride\">The overridden version for <c>xunit.v3.assert</c></param>\n\tpublic static XunitContext ForV3Assert(\n\t\tCompilation compilation,\n\t\tVersion? versionOverride = null) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\tV3Assert = V3AssertContext.Get(compilation, versionOverride),\n\t\t\t};\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitDiagnosticAnalyzer.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n/// <summary>\n/// Base class for diagnostic analyzers which support xUnit.net v2 and v3.\n/// </summary>\npublic abstract class XunitDiagnosticAnalyzer(params DiagnosticDescriptor[] descriptors) :\n\tDiagnosticAnalyzer\n{\n\t/// <inheritdoc/>\n#pragma warning disable IDE0305  // Cannot convert this due to Roslyn 3.11\n\tpublic sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = descriptors.ToImmutableArray();\n#pragma warning restore IDE0305\n\n\t/// <summary>\n\t/// Analyzes compilation to discover diagnostics.\n\t/// </summary>\n\t/// <param name=\"context\">The Roslyn diagnostic context</param>\n\t/// <param name=\"xunitContext\">The xUnit.net context</param>\n\tpublic abstract void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext);\n\n\t/// <summary>\n\t/// Override this factory method to influence the creation of <see cref=\"XunitContext\"/>.\n\t/// Typically used by derived classes wanting to provide version overrides for specific\n\t/// references.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation context</param>\n\tprotected virtual XunitContext CreateXunitContext(Compilation compilation) =>\n\t\tnew(compilation);\n\n\t/// <inheritdoc/>\n\tpublic sealed override void Initialize(AnalysisContext context)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\n\t\tcontext.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);\n\t\tcontext.EnableConcurrentExecution();\n\n\t\tcontext.RegisterCompilationStartAction(context =>\n\t\t{\n\t\t\tvar xunitContext = CreateXunitContext(context.Compilation);\n\t\t\tif (ShouldAnalyze(xunitContext))\n\t\t\t\tAnalyzeCompilation(context, xunitContext);\n\t\t});\n\t}\n\n\t/// <summary>\n\t/// Override this method to influence when we should consider diagnostic analysis. By\n\t/// default analyzes all assemblies that have a reference to xUnit.net v2 or v3.\n\t/// </summary>\n\t/// <param name=\"xunitContext\">The xUnit.net context</param>\n\t/// <returns>Return <c>true</c> to analyze source; return <c>false</c> to skip analysis</returns>\n\tprotected virtual bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV2References || xunitContext.HasV3References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitDiagnosticSuppressor.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n/// <summary>\n/// Base class for diagnostic suppressors which support xUnit.net v2 and v3.\n/// </summary>\npublic abstract class XunitDiagnosticSuppressor(SuppressionDescriptor descriptor) :\n\tDiagnosticSuppressor\n{\n\tprotected SuppressionDescriptor Descriptor => SupportedSuppressions[0];\n\n\t/// <inheritdoc/>\n#pragma warning disable IDE0305  // Cannot convert this due to Roslyn 3.11\n\tpublic override ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; } = new[] { descriptor }.ToImmutableArray();\n#pragma warning restore IDE0305\n\n\t/// <summary>\n\t/// Override this factory method to influence the creation of <see cref=\"XunitContext\"/>.\n\t/// Typically used by derived classes wanting to provide version overrides for specific\n\t/// references.\n\t/// </summary>\n\t/// <param name=\"compilation\">The Roslyn compilation context</param>\n\tprotected virtual XunitContext CreateXunitContext(Compilation compilation) =>\n\t\tnew(compilation);\n\n\t/// <inheritdoc/>\n\tpublic sealed override void ReportSuppressions(SuppressionAnalysisContext context)\n\t{\n\t\tvar xunitContext = CreateXunitContext(context.Compilation);\n\n\t\tif (ShouldAnalyze(xunitContext))\n\t\t\tforeach (var diagnostic in context.ReportedDiagnostics)\n\t\t\t\tif (ShouldSuppress(diagnostic, context, xunitContext))\n\t\t\t\t\tcontext.ReportSuppression(Suppression.Create(Descriptor, diagnostic));\n\t}\n\n\t/// <summary>\n\t/// Override this method to influence when we should consider diagnostic analysis. By\n\t/// default analyzes all assemblies that have a reference to xUnit.net v2 or v3.\n\t/// </summary>\n\t/// <param name=\"xunitContext\">The xUnit.net context</param>\n\t/// <returns>Return <c>true</c> to analyze source; return <c>false</c> to skip analysis</returns>\n\tprotected virtual bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV2References || xunitContext.HasV3References;\n\n\t/// <summary>\n\t/// Analyzes the given diagnostic to determine if it should be suppressed.\n\t/// </summary>\n\t/// <param name=\"diagnostic\">The diagnostic to analyze</param>\n\t/// <param name=\"context\">The Roslyn supression analysis context</param>\n\t/// <param name=\"xunitContext\">The xUnit.net context</param>\n\tprotected abstract bool ShouldSuppress(\n\t\tDiagnostic diagnostic,\n\t\tSuppressionAnalysisContext context,\n\t\tXunitContext xunitContext);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitV2DiagnosticAnalyzer.cs",
    "content": "using Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\n/// <summary>\n/// Base class for diagnostic analyzers which support xUnit.net v2 only.\n/// </summary>\npublic abstract class XunitV2DiagnosticAnalyzer(params DiagnosticDescriptor[] descriptors) :\n\tXunitDiagnosticAnalyzer(descriptors)\n{\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV2References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitV2DiagnosticSuppressor.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n/// <summary>\n/// Base class for diagnostic suppressors which support xUnit.net v2 only.\n/// </summary>\npublic abstract class XunitV2DiagnosticSuppressor(SuppressionDescriptor descriptor) :\n\tXunitDiagnosticSuppressor(descriptor)\n{\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV2References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitV3DiagnosticAnalyzer.cs",
    "content": "using Microsoft.CodeAnalysis;\n\nnamespace Xunit.Analyzers;\n\n/// <summary>\n/// Base class for diagnostic analyzers which support xUnit.net v3 only.\n/// </summary>\npublic abstract class XunitV3DiagnosticAnalyzer(params DiagnosticDescriptor[] descriptors) :\n\tXunitDiagnosticAnalyzer(descriptors)\n{\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV3References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/Utility/XunitV3DiagnosticSuppressor.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Xunit.Analyzers;\n\nnamespace Xunit.Suppressors;\n\n/// <summary>\n/// Base class for diagnostic suppressors which support xUnit.net v3 only.\n/// </summary>\npublic abstract class XunitV3DiagnosticSuppressor(SuppressionDescriptor descriptor) :\n\tXunitDiagnosticSuppressor(descriptor)\n{\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV3References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/ClassDataAttributeMustPointAtValidClass.cs",
    "content": "using System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Reflection;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class ClassDataAttributeMustPointAtValidClass : XunitDiagnosticAnalyzer\n{\n\tconst string typesV2 = \"IEnumerable<object[]>\";\n\tconst string typesV3 = \"IEnumerable<object[]>, IAsyncEnumerable<object[]>, IEnumerable<ITheoryDataRow>, or IAsyncEnumerable<ITheoryDataRow>\";\n\n\tpublic ClassDataAttributeMustPointAtValidClass() :\n\t\tbase(\n\t\t\tDescriptors.X1007_ClassDataAttributeMustPointAtValidClass,\n\t\t\tDescriptors.X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters,\n\t\t\tDescriptors.X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters,\n\t\t\tDescriptors.X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes,\n\t\t\tDescriptors.X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability,\n\t\t\tDescriptors.X1050_ClassDataTheoryDataRowIsRecommendedForStronglyTypedAnalysis\n\t\t)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar compilation = context.Compilation;\n\t\tvar iEnumerableOfObjectArray = TypeSymbolFactory.IEnumerableOfObjectArray(compilation);\n\t\tvar iEnumerableOfTheoryDataRow = TypeSymbolFactory.IEnumerableOfITheoryDataRow(compilation);\n\t\tvar iAsyncEnumerableOfObjectArray = TypeSymbolFactory.IAsyncEnumerableOfObjectArray(compilation);\n\t\tvar iAsyncEnumerableOfTheoryDataRow = TypeSymbolFactory.IAsyncEnumerableOfITheoryDataRow(compilation);\n\t\tvar theoryDataRowTypes = TypeSymbolFactory.TheoryDataRow_ByGenericArgumentCount_V3(compilation);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (context.Node is not MethodDeclarationSyntax testMethod)\n\t\t\t\treturn;\n\n\t\t\tvar attributeLists = testMethod.AttributeLists;\n\t\t\tvar semanticModel = context.SemanticModel;\n\n\t\t\tforeach (var attributeSyntax in attributeLists.WhereNotNull().SelectMany(attList => attList.Attributes))\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tvar attributeType = semanticModel.GetTypeInfo(attributeSyntax).Type as INamedTypeSymbol;\n\t\t\t\tif (attributeType is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar classType = default(INamedTypeSymbol);\n\n\t\t\t\t// [ClassData(typeof(...))]\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(attributeType, xunitContext.Core.ClassDataAttributeType))\n\t\t\t\t{\n\t\t\t\t\tif (attributeSyntax.ArgumentList is null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (attributeSyntax.ArgumentList.Arguments[0].Expression is not TypeOfExpressionSyntax typeOfExpression)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tclassType = semanticModel.GetTypeInfo(typeOfExpression.Type).Type as INamedTypeSymbol;\n\t\t\t\t}\n\t\t\t\t// [ClassData<...>]\n\t\t\t\telse if (attributeType.IsGenericType)\n\t\t\t\t{\n\t\t\t\t\tvar classDataOfTType = xunitContext.V3Core?.ClassDataAttributeOfTType?.ConstructUnboundGenericType();\n\t\t\t\t\tif (classDataOfTType is not null && SymbolEqualityComparer.Default.Equals(attributeType.ConstructUnboundGenericType(), classDataOfTType))\n\t\t\t\t\t\tclassType = attributeType.TypeArguments[0] as INamedTypeSymbol;\n\t\t\t\t}\n\n\t\t\t\tif (classType is null || classType.Kind == SymbolKind.ErrorType)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Make sure the class implements a compatible interface\n\t\t\t\tvar isValidDeclaration = VerifyDataSourceDeclaration(context, compilation, xunitContext, classType, attributeSyntax);\n\n\t\t\t\t// Everything from here is based on ensuring I(Async)Enumerable<TheoryDataRow<>>, which is\n\t\t\t\t// only available in v3.\n\t\t\t\tif (!xunitContext.HasV3References)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar rowType = classType.UnwrapEnumerable(compilation);\n\t\t\t\tif (rowType is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (IsGenericTheoryDataRowType(rowType, theoryDataRowTypes, out var theoryDataReturnType))\n\t\t\t\t\tVerifyGenericArgumentTypes(semanticModel, context, testMethod, theoryDataRowTypes[0], theoryDataReturnType, classType, attributeSyntax);\n\t\t\t\telse if (isValidDeclaration)\n\t\t\t\t\tReportClassReturnsUnsafeTypeValue(context, attributeSyntax);\n\t\t\t}\n\t\t}, SyntaxKind.MethodDeclaration);\n\t}\n\n\tstatic bool IsGenericTheoryDataRowType(\n\t\tITypeSymbol? rowType,\n\t\tDictionary<int, INamedTypeSymbol> theoryDataRowTypes,\n\t\t[NotNullWhen(true)] out INamedTypeSymbol? theoryReturnType)\n\t{\n\t\ttheoryReturnType = default;\n\n\t\tvar working = rowType as INamedTypeSymbol;\n\t\tfor (; working is not null; working = working.BaseType)\n\t\t{\n\t\t\tvar returnTypeArguments = working.TypeArguments;\n\t\t\tif (returnTypeArguments.Length != 0\n\t\t\t\t&& theoryDataRowTypes.TryGetValue(returnTypeArguments.Length, out var theoryDataType)\n\t\t\t\t&& SymbolEqualityComparer.Default.Equals(theoryDataType, working.OriginalDefinition))\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (working is null)\n\t\t\treturn false;\n\n\t\ttheoryReturnType = working;\n\t\treturn true;\n\t}\n\n\tstatic void ReportClassReturnsUnsafeTypeValue(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1050_ClassDataTheoryDataRowIsRecommendedForStronglyTypedAnalysis,\n\t\t\t\t\tattribute.GetLocation()\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportExtraTypeArguments(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tINamedTypeSymbol theoryDataType) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataType)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportIncompatibleType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tTypeSyntax parameterType,\n\t\tITypeSymbol theoryDataTypeParameter,\n\t\tINamedTypeSymbol namedClassType,\n\t\tIParameterSymbol parameter) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes,\n\t\t\t\t\tparameterType.GetLocation(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataTypeParameter),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(namedClassType),\n\t\t\t\t\tparameter.Name\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportIncorrectImplementationType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tstring validSymbols,\n\t\tAttributeSyntax attribute,\n\t\tITypeSymbol classType) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1007_ClassDataAttributeMustPointAtValidClass,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tclassType.Name,\n\t\t\t\t\tvalidSymbols\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportNullabilityMismatch(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tTypeSyntax parameterType,\n\t\tITypeSymbol theoryDataTypeParameter,\n\t\tINamedTypeSymbol namedClassType,\n\t\tIParameterSymbol parameter) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability,\n\t\t\t\t\tparameterType.GetLocation(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataTypeParameter),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(namedClassType),\n\t\t\t\t\tparameter.Name\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportTooFewTypeArguments(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tINamedTypeSymbol theoryDataType) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataType)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic bool VerifyDataSourceDeclaration(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext,\n\t\tINamedTypeSymbol classType,\n\t\tAttributeSyntax attribute)\n\t{\n\t\tvar v3 = xunitContext.HasV3References;\n\t\tvar iEnumerableOfObjectArrayType = TypeSymbolFactory.IEnumerableOfObjectArray(compilation);\n\t\tvar iEnumerableOfTheoryDataRowType = TypeSymbolFactory.IEnumerableOfITheoryDataRow(compilation);\n\t\tvar iAsyncEnumerableOfObjectArrayType = TypeSymbolFactory.IAsyncEnumerableOfObjectArray(compilation);\n\t\tvar iAsyncEnumerableOfTheoryDataRowType = TypeSymbolFactory.IAsyncEnumerableOfITheoryDataRow(compilation);\n\n\t\t// Make sure we implement one of the interfaces\n\t\tvar valid = iEnumerableOfObjectArrayType.IsAssignableFrom(classType);\n\n\t\tif (!valid && v3 && iAsyncEnumerableOfObjectArrayType is not null)\n\t\t\tvalid = iAsyncEnumerableOfObjectArrayType.IsAssignableFrom(classType);\n\n\t\tif (!valid && v3 && iEnumerableOfTheoryDataRowType is not null)\n\t\t\tvalid = iEnumerableOfTheoryDataRowType.IsAssignableFrom(classType);\n\n\t\tif (!valid && v3 && iAsyncEnumerableOfTheoryDataRowType is not null)\n\t\t\tvalid = iAsyncEnumerableOfTheoryDataRowType.IsAssignableFrom(classType);\n\n\t\t// Also make sure we're non-abstract and have an empty constructor\n\t\tvalid =\n\t\t\tvalid &&\n\t\t\t!classType.IsAbstract &&\n\t\t\tclassType.InstanceConstructors.Any(c => c.Parameters.IsEmpty && c.DeclaredAccessibility == Accessibility.Public);\n\n\t\tif (!valid)\n\t\t\tReportIncorrectImplementationType(\n\t\t\t\tcontext,\n\t\t\t\txunitContext.HasV3References ? typesV3 : typesV2,\n\t\t\t\tattribute,\n\t\t\t\tclassType\n\t\t\t);\n\n\t\treturn valid;\n\t}\n\n\tstatic void VerifyGenericArgumentTypes(\n\t\tSemanticModel semanticModel,\n\t\tSyntaxNodeAnalysisContext context,\n\t\tMethodDeclarationSyntax testMethod,\n\t\tINamedTypeSymbol theoryDataType,\n\t\tINamedTypeSymbol theoryReturnType,\n\t\tITypeSymbol classType,\n\t\tAttributeSyntax attribute)\n\t{\n\t\tif (classType is not INamedTypeSymbol namedClassType)\n\t\t\treturn;\n\n\t\tvar returnTypeArguments = theoryReturnType.TypeArguments;\n\t\tvar testMethodSymbol = semanticModel.GetDeclaredSymbol(testMethod, context.CancellationToken);\n\t\tif (testMethodSymbol is null)\n\t\t\treturn;\n\n\t\tvar testMethodParameterSymbols = testMethodSymbol.Parameters;\n\t\tvar testMethodParameterSyntaxes = testMethod.ParameterList.Parameters;\n\n\t\tif (testMethodParameterSymbols.Length > returnTypeArguments.Length\n\t\t\t&& testMethodParameterSymbols.Skip(returnTypeArguments.Length).Any(p => !p.IsOptional && !p.IsParams))\n\t\t{\n\t\t\tReportTooFewTypeArguments(context, attribute, theoryDataType);\n\t\t\treturn;\n\t\t}\n\n\t\tint typeArgumentIdx = 0, parameterTypeIdx = 0;\n\t\tfor (; typeArgumentIdx < returnTypeArguments.Length && parameterTypeIdx < testMethodParameterSymbols.Length; typeArgumentIdx++)\n\t\t{\n\t\t\tvar parameterSyntax = testMethodParameterSyntaxes[parameterTypeIdx];\n\t\t\tif (parameterSyntax.Type is null)\n\t\t\t\tcontinue;\n\n\t\t\tvar parameter = testMethodParameterSymbols[parameterTypeIdx];\n\t\t\tif (parameter.Type is null)\n\t\t\t\tcontinue;\n\n\t\t\tvar parameterType =\n\t\t\t\tparameter.IsParams && parameter.Type is IArrayTypeSymbol paramsArraySymbol\n\t\t\t\t\t? paramsArraySymbol.ElementType\n\t\t\t\t\t: parameter.Type;\n\n\t\t\tvar typeArgument = returnTypeArguments[typeArgumentIdx];\n\t\t\tif (typeArgument is null)\n\t\t\t\tcontinue;\n\n\t\t\tif (parameterType.Kind != SymbolKind.TypeParameter && !parameterType.IsAssignableFrom(typeArgument))\n\t\t\t{\n\t\t\t\tvar report = true;\n\n\t\t\t\t// The user might be providing the full array for 'params'; if they do, we need to move\n\t\t\t\t// the parameter type index forward because it's been consumed by the array\n\t\t\t\tif (parameter.IsParams && parameter.Type.IsAssignableFrom(typeArgument))\n\t\t\t\t{\n\t\t\t\t\treport = false;\n\t\t\t\t\tparameterTypeIdx++;\n\t\t\t\t}\n\n\t\t\t\tif (report)\n\t\t\t\t\tReportIncompatibleType(context, parameterSyntax.Type, typeArgument, namedClassType, parameter);\n\t\t\t}\n\n\t\t\t// Nullability of value types is handled by the type compatibility test,\n\t\t\t// but nullability of reference types isn't\n\t\t\tif (parameterType.IsReferenceType\n\t\t\t\t\t&& typeArgument.IsReferenceType\n\t\t\t\t\t&& parameterType.NullableAnnotation == NullableAnnotation.NotAnnotated\n\t\t\t\t\t&& typeArgument.NullableAnnotation == NullableAnnotation.Annotated)\n\t\t\t\tReportNullabilityMismatch(context, parameterSyntax.Type, typeArgument, namedClassType, parameter);\n\n\t\t\t// Only move the parameter type index forward when the current parameter is not a 'params'\n\t\t\tif (!parameter.IsParams)\n\t\t\t\tparameterTypeIdx++;\n\t\t}\n\n\t\tif (typeArgumentIdx < returnTypeArguments.Length)\n\t\t\tReportExtraTypeArguments(context, attribute, theoryDataType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/CollectionDefinitionsMustBePublic.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class CollectionDefinitionClassesMustBePublic : XunitDiagnosticAnalyzer\n{\n\tpublic CollectionDefinitionClassesMustBePublic() :\n\t\tbase(Descriptors.X1027_CollectionDefinitionClassMustBePublic)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.CollectionDefinitionAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol classSymbol)\n\t\t\t\treturn;\n\n\t\t\tvar doesClassContainCollectionDefinitionAttribute =\n\t\t\t\tclassSymbol\n\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t.Any(a => xunitContext.Core.CollectionDefinitionAttributeType.IsAssignableFrom(a.AttributeClass));\n\n\t\t\tif (!doesClassContainCollectionDefinitionAttribute)\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1027_CollectionDefinitionClassMustBePublic,\n\t\t\t\t\tclassSymbol.Locations.First(),\n\t\t\t\t\tclassSymbol.Locations.Skip(1)\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/ConstructorsOnFactAttributeSubclassShouldBePublic.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class ConstructorsOnFactAttributeSubclassShouldBePublic : XunitDiagnosticAnalyzer\n{\n\tpublic ConstructorsOnFactAttributeSubclassShouldBePublic() :\n\t\tbase(Descriptors.X1043_ConstructorOnFactAttributeSubclassShouldBePublic)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = method.GetAttributes();\n\t\t\tforeach (var attribute in attributes)\n\t\t\t{\n\t\t\t\tvar attributeClass = attribute.AttributeClass;\n\t\t\t\tif (attributeClass is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!xunitContext.Core.FactAttributeType.IsAssignableFrom(attributeClass))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar constructor = attribute.AttributeConstructor;\n\t\t\t\tif (constructor is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (constructor.DeclaredAccessibility is Accessibility.ProtectedOrInternal or Accessibility.Internal)\n\t\t\t\t{\n\t\t\t\t\tif (attribute.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken) is not AttributeSyntax attributeSyntax)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1043_ConstructorOnFactAttributeSubclassShouldBePublic,\n\t\t\t\t\t\t\tattributeSyntax.GetLocation(),\n\t\t\t\t\t\t\tconstructor.ToDisplayString()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/DataAttributeShouldBeUsedOnATheory.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DataAttributeShouldBeUsedOnATheory : XunitDiagnosticAnalyzer\n{\n\tpublic DataAttributeShouldBeUsedOnATheory() :\n\t\tbase(Descriptors.X1008_DataAttributeShouldBeUsedOnATheory)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.DataAttributeType is null)\n\t\t\t\treturn;\n\n\t\t\tif (context.Symbol is not IMethodSymbol methodSymbol)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = methodSymbol.GetAttributes();\n\t\t\tif (attributes.Length == 0)\n\t\t\t\treturn;\n\n\t\t\t// Instead of checking for Theory, we check for any Fact. If it is a Fact which is not a Theory,\n\t\t\t// we will let other rules (i.e. FactMethodShouldNotHaveTestData) handle that case.\n\t\t\tif (!attributes.ContainsAttributeType(xunitContext.Core.FactAttributeType) && attributes.ContainsAttributeType(xunitContext.Core.DataAttributeType))\n\t\t\t{\n\t\t\t\tvar properties = new Dictionary<string, string?>\n\t\t\t\t{\n\t\t\t\t\t[Constants.Properties.DataAttributeTypeName] =\n\t\t\t\t\t\txunitContext.HasV3References\n\t\t\t\t\t\t\t? Constants.Types.Xunit.DataAttribute_V3\n\t\t\t\t\t\t\t: Constants.Types.Xunit.DataAttribute_V2\n\t\t\t\t}.ToImmutableDictionary();\n\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1008_DataAttributeShouldBeUsedOnATheory,\n\t\t\t\t\t\tmethodSymbol.Locations.First(),\n\t\t\t\t\t\tproperties\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/DoNotUseAsyncVoidForTestMethods.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotUseAsyncVoidForTestMethods : XunitDiagnosticAnalyzer\n{\n\tpublic DoNotUseAsyncVoidForTestMethods() :\n\t\tbase([\n\t\t\tDescriptors.X1048_DoNotUseAsyncVoidForTestMethods_V2,\n\t\t\tDescriptors.X1049_DoNotUseAsyncVoidForTestMethods_V3,\n\t\t])\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar attributeUsageType = TypeSymbolFactory.AttributeUsageAttribute(context.Compilation);\n\t\tif (attributeUsageType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\n\t\t\tif (!method.IsAsync || !method.ReturnsVoid)\n\t\t\t\treturn;\n\n\t\t\tif (!method.IsTestMethod(xunitContext, attributeUsageType, strict: true))\n\t\t\t\treturn;\n\n\t\t\tvar location = context.Symbol.Locations.FirstOrDefault();\n\t\t\tif (location is null)\n\t\t\t\treturn;\n\n\t\t\tvar propertiesBuilder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tpropertiesBuilder.Add(Constants.Properties.DeclaringType, method.ContainingType.ToDisplayString());\n\t\t\tpropertiesBuilder.Add(Constants.Properties.MemberName, method.Name);\n\t\t\tvar properties = propertiesBuilder.ToImmutableDictionary();\n\n\t\t\tif (xunitContext.HasV3References)\n\t\t\t\tcontext.ReportDiagnostic(Diagnostic.Create(Descriptors.X1049_DoNotUseAsyncVoidForTestMethods_V3, location, properties));\n\t\t\telse\n\t\t\t\tcontext.ReportDiagnostic(Diagnostic.Create(Descriptors.X1048_DoNotUseAsyncVoidForTestMethods_V2, location, properties));\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/DoNotUseBlockingTaskOperations.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Threading.Tasks.Sources;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotUseBlockingTaskOperations : XunitDiagnosticAnalyzer\n{\n\tstatic readonly string[] blockingAwaiterMethods =\n\t[\n\t\t// We will \"steal\" the name from TaskAwaiter, but we look for it by pattern: if the type is\n\t\t// assignable from ICriticalNotifyCompletion and it contains a method with this name. We\n\t\t// also explicitly look for IValueTaskSource and IValueTaskSource<T>.\n\t\tnameof(IValueTaskSource.GetResult),\n\t];\n\tstatic readonly string[] blockingTaskMethods =\n\t[\n\t\t// These are only on Task, and not on ValueTask\n\t\tnameof(Task.Wait),\n\t\tnameof(Task.WaitAny),\n\t\tnameof(Task.WaitAll),\n\t];\n\tstatic readonly string[] blockingTaskProperties =\n\t[\n\t\t// These are on both Task<T> and ValueTask<T>\n\t\tnameof(Task<int>.Result),\n\t];\n\tstatic readonly string[] whenAll =\n\t[\n\t\tnameof(Task.WhenAll),\n\t];\n\tstatic readonly string[] whenAny =\n\t[\n\t\tnameof(Task.WhenAny),\n\t];\n\n\tpublic DoNotUseBlockingTaskOperations() :\n\t\tbase(Descriptors.X1031_DoNotUseBlockingTaskOperations)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.TheoryAttributeType is null)\n\t\t\treturn;\n\n\t\tvar iCriticalNotifyCompletionType = TypeSymbolFactory.ICriticalNotifyCompletion(context.Compilation);\n\t\tvar iValueTaskSourceType = TypeSymbolFactory.IValueTaskSource(context.Compilation);\n\t\tvar iValueTaskSourceOfTType = TypeSymbolFactory.IValueTaskSourceOfT(context.Compilation);\n\t\tvar taskType = TypeSymbolFactory.Task(context.Compilation);\n\t\tvar taskOfTType = TypeSymbolFactory.TaskOfT(context.Compilation);\n\t\tvar valueTaskOfTType = TypeSymbolFactory.ValueTaskOfT(context.Compilation);\n\n\t\tif (taskType is null)\n\t\t\treturn;\n\n\t\t// Need to dynamically look for ICriticalNotifyCompletion, for use with blockingAwaiterMethods\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IInvocationOperation invocation)\n\t\t\t\treturn;\n\n\t\t\tvar foundSymbol =\n\t\t\t\tFindSymbol(invocation.TargetMethod, invocation, taskType, blockingTaskMethods, xunitContext, out var foundSymbolName) ||\n\t\t\t\tFindSymbol(invocation.TargetMethod, invocation, iCriticalNotifyCompletionType, blockingAwaiterMethods, xunitContext, out foundSymbolName) ||\n\t\t\t\tFindSymbol(invocation.TargetMethod, invocation, iValueTaskSourceType, blockingAwaiterMethods, xunitContext, out foundSymbolName) ||\n\t\t\t\tFindSymbol(invocation.TargetMethod, invocation, iValueTaskSourceOfTType, blockingAwaiterMethods, xunitContext, out foundSymbolName);\n\n\t\t\tif (!foundSymbol)\n\t\t\t\treturn;\n\n\t\t\t// Ignore anything inside a lambda expression or a local function\n\t\t\tfor (var current = context.Operation; current is not null; current = current.Parent)\n\t\t\t\tif (current is IAnonymousFunctionOperation or ILocalFunctionOperation)\n\t\t\t\t\treturn;\n\n\t\t\tvar symbolsForSearch = default(IEnumerable<ILocalSymbol>);\n\t\t\tswitch (foundSymbolName)\n\t\t\t{\n\t\t\t\tcase nameof(IValueTaskSource.GetResult):\n\t\t\t\t\t{\n\t\t\t\t\t\t// Only handles 'task.GetAwaiter().GetResult()', which gives us direct access to the task\n\t\t\t\t\t\t// TODO: How hard would it be to trace back something like:\n\t\t\t\t\t\t//    var awaiter = task.GetAwaiter();\n\t\t\t\t\t\t//    var result = awaiter.GetResult();\n\t\t\t\t\t\tif (invocation.Instance is IInvocationOperation getAwaiterOperation &&\n\t\t\t\t\t\t\t\tgetAwaiterOperation.TargetMethod.Name == nameof(Task.GetAwaiter) &&\n\t\t\t\t\t\t\t\tgetAwaiterOperation.Instance is ILocalReferenceOperation localReferenceOperation)\n\t\t\t\t\t\t\tsymbolsForSearch = [localReferenceOperation.Local];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\tcase nameof(Task.Wait):\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Instance is ILocalReferenceOperation localReferenceOperation)\n\t\t\t\t\t\t\tsymbolsForSearch = [localReferenceOperation.Local];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\tcase nameof(Task.WaitAll):\n\t\t\t\tcase nameof(Task.WaitAny):\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Length == 1 &&\n\t\t\t\t\t\t\t\tinvocation.Arguments[0].Value is IArrayCreationOperation arrayCreationOperation &&\n\t\t\t\t\t\t\t\tarrayCreationOperation.Initializer is not null)\n\t\t\t\t\t\t\tsymbolsForSearch = arrayCreationOperation.Initializer.ElementValues.OfType<ILocalReferenceOperation>().Select(l => l.Local);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (symbolsForSearch is not null)\n\t\t\t\tif (TaskIsKnownToBeCompleted(invocation, symbolsForSearch, taskType, xunitContext))\n\t\t\t\t\treturn;\n\n\t\t\t// Should have two child nodes: \"(some other code).(target method)\" and the arguments\n\t\t\tvar invocationChildren = invocation.Syntax.ChildNodes().ToList();\n\t\t\tif (invocationChildren.Count != 2)\n\t\t\t\treturn;\n\n\t\t\t// First child node should be split into two nodes: \"(some other code)\" and \"(target method)\"\n\t\t\tvar methodCallChildren = invocationChildren[0].ChildNodes().ToList();\n\t\t\tif (methodCallChildren.Count != 2)\n\t\t\t\treturn;\n\n\t\t\t// Construct a location that covers the target method and arguments\n\t\t\tvar length = methodCallChildren[1].Span.Length + invocationChildren[1].Span.Length;\n\t\t\tvar textSpan = new TextSpan(methodCallChildren[1].SpanStart, length);\n\t\t\tvar location = Location.Create(invocation.Syntax.SyntaxTree, textSpan);\n\t\t\tcontext.ReportDiagnostic(Diagnostic.Create(Descriptors.X1031_DoNotUseBlockingTaskOperations, location));\n\t\t}, OperationKind.Invocation);\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IPropertyReferenceOperation reference)\n\t\t\t\treturn;\n\n\t\t\tvar foundSymbol =\n\t\t\t\tFindSymbol(reference.Property, reference, taskOfTType, blockingTaskProperties, xunitContext, out var foundSymbolName) ||\n\t\t\t\tFindSymbol(reference.Property, reference, valueTaskOfTType, blockingTaskProperties, xunitContext, out foundSymbolName);\n\n\t\t\tif (!foundSymbol)\n\t\t\t\treturn;\n\n\t\t\tif (foundSymbolName == nameof(Task<int>.Result) &&\n\t\t\t\t\treference.Instance is ILocalReferenceOperation localReferenceOperation &&\n\t\t\t\t\tTaskIsKnownToBeCompleted(reference, [localReferenceOperation.Local], taskType, xunitContext))\n\t\t\t\treturn;\n\n\t\t\t// Should have two child nodes: \"(some other code)\" and \"(property name)\"\n\t\t\tvar propertyChildren = reference.Syntax.ChildNodes().ToList();\n\t\t\tif (propertyChildren.Count != 2)\n\t\t\t\treturn;\n\n\t\t\tvar location = propertyChildren[1].GetLocation();\n\t\t\tcontext.ReportDiagnostic(Diagnostic.Create(Descriptors.X1031_DoNotUseBlockingTaskOperations, location));\n\t\t}, OperationKind.PropertyReference);\n\t}\n\n\tstatic bool FindSymbol(\n\t\tISymbol symbol,\n\t\tIOperation operation,\n\t\tINamedTypeSymbol? targetType,\n\t\tstring[] targetNames,\n\t\tXunitContext xunitContext,\n\t\t[NotNullWhen(true)]\n\t\tout string? foundSymbolName)\n\t{\n\t\tfoundSymbolName = default;\n\n\t\tif (targetType is null)\n\t\t\treturn false;\n\n\t\tvar containingType = symbol.ContainingType;\n\t\tif (containingType.IsGenericType && targetType.IsGenericType)\n\t\t{\n\t\t\tcontainingType = containingType.ConstructUnboundGenericType();\n\t\t\ttargetType = targetType.ConstructUnboundGenericType();\n\t\t}\n\n\t\tif (!targetType.IsAssignableFrom(containingType))\n\t\t\treturn false;\n\n\t\tif (!targetNames.Contains(symbol.Name))\n\t\t\treturn false;\n\n\t\t// Only trigger when you're inside a test method\n\t\tvar (foundSymbol, lambdaOwner) = operation.IsInTestMethod(xunitContext);\n\t\tif (!foundSymbol || lambdaOwner is not null)\n\t\t\treturn false;\n\n\t\tfoundSymbolName = symbol.Name;\n\t\treturn true;\n\t}\n\n\tstatic bool TaskIsKnownToBeCompleted(\n\t\tIOperation? operation,\n\t\tIEnumerable<ILocalSymbol> symbols,\n\t\tINamedTypeSymbol taskType,\n\t\tXunitContext xunitContext)\n\t{\n\t\tvar ourOperations = new List<IOperation>();\n\t\tvar unfoundSymbols = new HashSet<ILocalSymbol>(symbols, SymbolEqualityComparer.Default);\n\n\t\tbool validateSafeTasks(IOperation op)\n\t\t{\n#if ROSLYN_LATEST\n\t\t\tforeach (var childOperation in op.ChildOperations)\n#else\n\t\t\tforeach (var childOperation in op.Children)\n#endif\n\t\t\t{\n\t\t\t\t// Stop looking once we've found the operation that is ours, since any\n\t\t\t\t// code after that operation isn't something we should consider\n\t\t\t\tif (ourOperations.Contains(childOperation))\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Could be marked as safe because of \"Task.WhenAll(..., symbol, ...)\"\n\t\t\t\tif (childOperation is IInvocationOperation childInvocationOperation)\n\t\t\t\t\tValidateTasksInWhenAll(childInvocationOperation, unfoundSymbols, taskType, xunitContext);\n\n\t\t\t\t// Could be marked as safe because of \"var symbol = await WhenAny(...)\"\n\t\t\t\tif (childOperation is IVariableDeclaratorOperation variableDeclaratorOperation)\n\t\t\t\t\tValidateTaskFromWhenAny(variableDeclaratorOperation, unfoundSymbols, taskType, xunitContext);\n\n\t\t\t\t// If we've run out of symbols to validate, we're done\n\t\t\t\tif (unfoundSymbols.Count == 0)\n\t\t\t\t\treturn true;\n\n#if ROSLYN_LATEST\n\t\t\t\tif (childOperation.ChildOperations.Any(c => validateSafeTasks(c)))\n#else\n\t\t\t\tif (childOperation.Children.Any(c => validateSafeTasks(c)))\n#endif\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (; operation is not null && unfoundSymbols.Count != 0; operation = operation.Parent)\n\t\t{\n\t\t\tif (operation is IBlockOperation blockOperation)\n\t\t\t\tif (validateSafeTasks(blockOperation))\n\t\t\t\t\treturn true;\n\n\t\t\tourOperations.Add(operation);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tstatic void ValidateTaskFromWhenAny(\n\t\tIVariableDeclaratorOperation operation,\n\t\tHashSet<ILocalSymbol> unfoundSymbols,\n\t\tINamedTypeSymbol taskType,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (!unfoundSymbols.Contains(operation.Symbol))\n\t\t\treturn;\n\n#if ROSLYN_LATEST\n\t\tif (operation.ChildOperations.FirstOrDefault() is not IVariableInitializerOperation variableInitializerOperation)\n#else\n\t\tif (operation.Children.FirstOrDefault() is not IVariableInitializerOperation variableInitializerOperation)\n#endif\n\t\t\treturn;\n\n#if ROSLYN_LATEST\n\t\tif (variableInitializerOperation.Value.ChildOperations.FirstOrDefault() is not IInvocationOperation variableInitializerInvocationOperation)\n#else\n\t\tif (variableInitializerOperation.Value.Children.FirstOrDefault() is not IInvocationOperation variableInitializerInvocationOperation)\n#endif\n\t\t\treturn;\n\n\t\tif (!FindSymbol(variableInitializerInvocationOperation.TargetMethod, variableInitializerInvocationOperation, taskType, whenAny, xunitContext, out var _))\n\t\t\treturn;\n\n\t\tunfoundSymbols.Remove(operation.Symbol);\n\t}\n\n\tstatic void ValidateTasksInWhenAll(\n\t\tIInvocationOperation operation,\n\t\tHashSet<ILocalSymbol> unfoundSymbols,\n\t\tINamedTypeSymbol taskType,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (!FindSymbol(operation.TargetMethod, operation, taskType, whenAll, xunitContext, out var _))\n\t\t\treturn;\n\n\t\tvar argument = operation.Arguments.FirstOrDefault();\n\t\tif (argument is null)\n\t\t\treturn;\n\t\tif (argument.Value is not IArrayCreationOperation arrayCreation)\n\t\t\treturn;\n\t\tif (arrayCreation.Initializer is null)\n\t\t\treturn;\n\n\t\tforeach (var arrayElement in arrayCreation.Initializer.ElementValues.OfType<ILocalReferenceOperation>())\n\t\t\tunfoundSymbols.Remove(arrayElement.Local);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/DoNotUseConfigureAwait.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotUseConfigureAwait : XunitDiagnosticAnalyzer\n{\n\tpublic DoNotUseConfigureAwait() :\n\t\tbase(Descriptors.X1030_DoNotUseConfigureAwait)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar taskType = TypeSymbolFactory.Task(context.Compilation);\n\t\tvar taskOfTType = TypeSymbolFactory.TaskOfT(context.Compilation)?.ConstructUnboundGenericType();\n\t\tvar valueTaskType = TypeSymbolFactory.ValueTask(context.Compilation);\n\t\tvar valueTaskOfTType = TypeSymbolFactory.ValueTaskOfT(context.Compilation)?.ConstructUnboundGenericType();\n\n\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.TheoryAttributeType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IInvocationOperation invocation)\n\t\t\t\treturn;\n\n\t\t\tvar methodSymbol = invocation.TargetMethod;\n\t\t\tif (methodSymbol.MethodKind != MethodKind.Ordinary || methodSymbol.Name != nameof(Task.ConfigureAwait))\n\t\t\t\treturn;\n\n\t\t\tbool match;\n\n\t\t\tif (methodSymbol.ContainingType.IsGenericType)\n\t\t\t{\n\t\t\t\tvar unboundGeneric = methodSymbol.ContainingType.ConstructUnboundGenericType();\n\n\t\t\t\tmatch =\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(unboundGeneric, taskOfTType) ||\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(unboundGeneric, valueTaskOfTType);\n\t\t\t}\n\t\t\telse\n\t\t\t\tmatch =\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(methodSymbol.ContainingType, taskType) ||\n\t\t\t\t\tSymbolEqualityComparer.Default.Equals(methodSymbol.ContainingType, valueTaskType);\n\n\t\t\tif (!match)\n\t\t\t\treturn;\n\n\t\t\tvar (foundSymbol, lambdaOwner) = invocation.IsInTestMethod(xunitContext);\n\t\t\tif (!foundSymbol || lambdaOwner is not null)\n\t\t\t\treturn;\n\n\t\t\t// invocation should be two nodes: \"(some other code).ConfigureAwait\" and the arguments (like \"(false)\")\n\t\t\tvar invocationChildren = invocation.Syntax.ChildNodes().ToList();\n\t\t\tif (invocationChildren.Count != 2)\n\t\t\t\treturn;\n\n\t\t\t// We only care about invocations with a single parameter\n\t\t\tvar arguments = invocationChildren[1];\n\t\t\tvar argumentChildren = arguments.ChildNodes().ToList();\n\t\t\tif (argumentChildren.Count != 1 || argumentChildren[0] is not ArgumentSyntax argumentSyntax)\n\t\t\t\treturn;\n\n\t\t\t// Determine the invocation type and resolution\n\t\t\tvar parameterType = invocation.TargetMethod.Parameters[0].Type;\n\t\t\tvar configureAwaitOptions = TypeSymbolFactory.ConfigureAwaitOptions(context.Compilation);\n\t\t\tvar argumentValue = argumentSyntax.ToFullString();\n\t\t\tstring resolution;\n\t\t\tstring replacement;\n\n\t\t\t// We want to exempt calls with \"(true)\" because of CA2007\n\t\t\tif (SymbolEqualityComparer.Default.Equals(parameterType, context.Compilation.GetSpecialType(SpecialType.System_Boolean)))\n\t\t\t{\n\t\t\t\tif (argumentSyntax.Expression is LiteralExpressionSyntax literalExpression && literalExpression.IsKind(SyntaxKind.TrueLiteralExpression))\n\t\t\t\t\treturn;\n\n\t\t\t\tresolution = \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\";\n\t\t\t\treplacement = \"true\";\n\t\t\t}\n\t\t\t// We want to exempt calls which include ConfigureAwaitOptions.ContinueOnCapturedContext\n\t\t\telse if (SymbolEqualityComparer.Default.Equals(parameterType, configureAwaitOptions))\n\t\t\t{\n\t\t\t\tif (invocation.SemanticModel is null)\n\t\t\t\t\treturn;\n\t\t\t\tif (ContainsContinueOnCapturedContext(argumentSyntax.Expression, invocation.SemanticModel, configureAwaitOptions, context.CancellationToken))\n\t\t\t\t\treturn;\n\n\t\t\t\tresolution = \"Ensure ConfigureAwaitOptions.ContinueOnCapturedContext in the flags.\";\n\t\t\t\treplacement = argumentValue + \" | ConfigureAwaitOptions.ContinueOnCapturedContext\";\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn;\n\n\t\t\t// First child node should be split into three pieces: \"(some other code)\", \".\", and \"ConfigureAwait\"\n\t\t\tvar methodCallChildren = invocationChildren[0].ChildNodesAndTokens().ToList();\n\t\t\tif (methodCallChildren.Count != 3)\n\t\t\t\treturn;\n\n\t\t\t// Construct a location that covers \"ConfigureAwait(arguments)\"\n\t\t\tvar length = methodCallChildren[2].Span.Length + invocationChildren[1].Span.Length;\n\t\t\tvar textSpan = new TextSpan(methodCallChildren[2].SpanStart, length);\n\t\t\tvar location = Location.Create(invocation.Syntax.SyntaxTree, textSpan);\n\n\t\t\t// Provide the original value and replacement value to the fixer\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.ArgumentValue] = argumentValue;\n\t\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1030_DoNotUseConfigureAwait,\n\t\t\t\t\tlocation,\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\targumentValue,\n\t\t\t\t\tresolution\n\t\t\t\t)\n\t\t\t);\n\t\t}, OperationKind.Invocation);\n\t}\n\n\tstatic bool ContainsContinueOnCapturedContext(\n\t\tExpressionSyntax expression,\n\t\tSemanticModel semanticModel,\n\t\tINamedTypeSymbol configureAwaitOptions,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\t// If we have a binary expression of bitwise OR, we evaluate both sides of the expression\n\t\tif (expression is BinaryExpressionSyntax binaryExpression && binaryExpression.Kind() == SyntaxKind.BitwiseOrExpression)\n\t\t\treturn ContainsContinueOnCapturedContext(binaryExpression.Left, semanticModel, configureAwaitOptions, cancellationToken)\n\t\t\t\t|| ContainsContinueOnCapturedContext(binaryExpression.Right, semanticModel, configureAwaitOptions, cancellationToken);\n\n\t\t// Look for constant value of enum type\n\t\tvar symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;\n\t\tif (symbol is not null && SymbolEqualityComparer.Default.Equals(symbol.ContainingType, configureAwaitOptions) && symbol.Name == \"ContinueOnCapturedContext\")\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/EnsureFixturesHaveASource.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class EnsureFixturesHaveASource : XunitDiagnosticAnalyzer\n{\n\tpublic EnsureFixturesHaveASource() :\n\t\tbase(Descriptors.X1041_EnsureFixturesHaveASource)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar collectionAttributeType = xunitContext.Core.CollectionAttributeType;\n\t\tvar collectionAttributeOfTType = xunitContext.V3Core?.CollectionAttributeOfTType?.ConstructUnboundGenericType();\n\t\tvar collectionDefinitionAttributeType = xunitContext.Core.CollectionDefinitionAttributeType;\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not INamedTypeSymbol namedType)\n\t\t\t\treturn;\n\t\t\tif (namedType.IsAbstract)\n\t\t\t\treturn;\n\t\t\tif (!namedType.IsTestClass(xunitContext, strict: true))\n\t\t\t\treturn;\n\n\t\t\t// Only evaluate if there's a single public constructor\n\t\t\tvar ctors =\n\t\t\t\tnamedType\n\t\t\t\t\t.Constructors\n\t\t\t\t\t.Where(c => c is { IsStatic: false, DeclaredAccessibility: Accessibility.Public })\n\t\t\t\t\t.ToImmutableArray();\n\t\t\tif (ctors.Length != 1)\n\t\t\t\treturn;\n\n\t\t\t// Get the collection name from [Collection], if present\n\t\t\tobject? collectionDefinition = null;\n\n\t\t\tfor (var type = namedType; type is not null && collectionDefinition is null; type = type.BaseType)\n\t\t\t{\n\t\t\t\t// Check [Collection(\"name\"))] or [Collection(typeof(T))]\n\t\t\t\tcollectionDefinition =\n\t\t\t\t\ttype\n\t\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t\t.FirstOrDefault(a => collectionAttributeType.IsAssignableFrom(a.AttributeClass))\n\t\t\t\t\t\t?.ConstructorArguments\n\t\t\t\t\t\t.FirstOrDefault()\n\t\t\t\t\t\t.Value;\n\n\t\t\t\t// Check [Collection<T>]\n\t\t\t\tif (collectionDefinition is null && collectionAttributeOfTType is not null)\n\t\t\t\t\tcollectionDefinition =\n\t\t\t\t\t\ttype\n\t\t\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t\t\t.FirstOrDefault(a => collectionAttributeOfTType.IsAssignableFrom(a.AttributeClass))\n\t\t\t\t\t\t\t?.AttributeClass\n\t\t\t\t\t\t\t?.TypeArguments\n\t\t\t\t\t\t\t.FirstOrDefault();\n\t\t\t}\n\n\t\t\t// Need to construct a full set of types we know can be resolved. Start with things\n\t\t\t// like ITestOutputHelper and ITestContextAccessor (since they're injected by the framework)\n\t\t\tvar validConstructorArgumentTypes = new HashSet<ITypeSymbol?>(SymbolEqualityComparer.Default)\n\t\t\t{\n\t\t\t\txunitContext.Core.ITestOutputHelperType,\n\t\t\t\txunitContext.V3Core?.ITestContextAccessorType\n\t\t\t};\n\n\t\t\t// Add types from IClassFixture<> on the class\n\t\t\tvar classFixtureType = xunitContext.Core.IClassFixtureType?.ConstructUnboundGenericType();\n\t\t\tvalidConstructorArgumentTypes.AddRange(\n\t\t\t\tnamedType\n\t\t\t\t\t.AllInterfaces\n\t\t\t\t\t.Where(i => i.IsGenericType && SymbolEqualityComparer.Default.Equals(classFixtureType, i.ConstructUnboundGenericType()))\n\t\t\t\t\t.Select(i => i.TypeArguments.First())\n\t\t\t);\n\n\t\t\t// Determine how we've referenced the collection, and whether there's an associated type\n\t\t\tvar collectionDefinitionType = collectionDefinition as ITypeSymbol;\n\t\t\tif (collectionDefinitionType is null && collectionDefinition is string collectionDefinitionName)\n\t\t\t\tcollectionDefinitionType = namedType.ContainingAssembly.FindNamedType(\n\t\t\t\t\tsymbol =>\n\t\t\t\t\t\tsymbol.GetAttributes().Any(a =>\n\t\t\t\t\t\t\ta.AttributeClass.IsAssignableFrom(collectionDefinitionAttributeType) &&\n\t\t\t\t\t\t\t!a.ConstructorArguments.IsDefaultOrEmpty &&\n\t\t\t\t\t\t\ta.ConstructorArguments[0].Value?.ToString() == collectionDefinitionName\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t// Add types from IClassFixture<> and ICollectionFixture<> on the collection definition\n\t\t\tif (collectionDefinitionType is not null)\n\t\t\t{\n\t\t\t\tvar collectionFixtureType = xunitContext.Core.ICollectionFixtureType?.ConstructUnboundGenericType();\n\t\t\t\tforeach (var @interface in collectionDefinitionType.AllInterfaces.Where(i => i.IsGenericType))\n\t\t\t\t{\n\t\t\t\t\tvar unboundGeneric = @interface.ConstructUnboundGenericType();\n\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(classFixtureType, unboundGeneric)\n\t\t\t\t\t\t|| SymbolEqualityComparer.Default.Equals(collectionFixtureType, unboundGeneric))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar fixtureTypeSymbol = @interface.TypeArguments.First();\n\t\t\t\t\t\tif (fixtureTypeSymbol is INamedTypeSymbol namedFixtureType)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (xunitContext.HasV3References && namedFixtureType.IsGenericType && namedFixtureType.TypeArguments.Any(t => t is ITypeParameterSymbol))\n\t\t\t\t\t\t\t\tnamedFixtureType = namedFixtureType.ConstructedFrom;\n\n\t\t\t\t\t\t\tvalidConstructorArgumentTypes.Add(namedFixtureType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add types from AssemblyFixtureAttribute on the assembly\n\t\t\tvar assemblyFixtureAttributeType = xunitContext.V3Core?.AssemblyFixtureAttributeType;\n\t\t\tif (assemblyFixtureAttributeType is not null)\n\t\t\t\tvalidConstructorArgumentTypes.AddRange(\n\t\t\t\t\tnamedType\n\t\t\t\t\t\t.ContainingAssembly\n\t\t\t\t\t\t.GetAttributes()\n\t\t\t\t\t\t.Where(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, assemblyFixtureAttributeType))\n\t\t\t\t\t\t.Select(a => a.ConstructorArguments[0].Value as ITypeSymbol)\n\t\t\t\t);\n\n\t\t\tforeach (var parameter in ctors[0].Parameters.Where(p => !p.IsOptional\n\t\t\t\t\t&& !p.IsParams\n\t\t\t\t\t&& !validConstructorArgumentTypes.Contains(p.Type)\n\t\t\t\t\t&& (xunitContext.HasV2References || p.Type is not INamedTypeSymbol nts || !nts.IsGenericType || !validConstructorArgumentTypes.Contains(nts.ConstructedFrom))))\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1041_EnsureFixturesHaveASource,\n\t\t\t\t\t\tparameter.Locations.FirstOrDefault(),\n\t\t\t\t\t\tparameter.Name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/FactMethodMustNotHaveParameters.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class FactMethodMustNotHaveParameters : XunitDiagnosticAnalyzer\n{\n\tpublic FactMethodMustNotHaveParameters() :\n\t\tbase(Descriptors.X1001_FactMethodMustNotHaveParameters)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not IMethodSymbol symbol)\n\t\t\t\treturn;\n\t\t\tif (symbol.Parameters.IsEmpty)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = symbol.GetAttributes();\n\t\t\tif (!attributes.IsEmpty && attributes.ContainsAttributeType(xunitContext.Core.FactAttributeType, exactMatch: true))\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1001_FactMethodMustNotHaveParameters,\n\t\t\t\t\t\tsymbol.Locations.First(),\n\t\t\t\t\t\tsymbol.Name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/FactMethodShouldNotHaveTestData.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class FactMethodShouldNotHaveTestData : XunitDiagnosticAnalyzer\n{\n\tpublic FactMethodShouldNotHaveTestData() :\n\t\tbase(Descriptors.X1005_FactMethodShouldNotHaveTestData)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.TheoryAttributeType is null || xunitContext.Core.DataAttributeType is null)\n\t\t\t\treturn;\n\n\t\t\tif (context.Symbol is not IMethodSymbol symbol)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = symbol.GetAttributes();\n\t\t\tif (attributes.Length > 1 &&\n\t\t\t\tattributes.ContainsAttributeType(xunitContext.Core.FactAttributeType, exactMatch: true) &&\n\t\t\t\t!attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType) &&\n\t\t\t\tattributes.ContainsAttributeType(xunitContext.Core.DataAttributeType))\n\t\t\t{\n\t\t\t\tvar properties = new Dictionary<string, string?>\n\t\t\t\t{\n\t\t\t\t\t[Constants.Properties.DataAttributeTypeName] =\n\t\t\t\t\t\txunitContext.HasV3References\n\t\t\t\t\t\t\t? Constants.Types.Xunit.DataAttribute_V3\n\t\t\t\t\t\t\t: Constants.Types.Xunit.DataAttribute_V2\n\t\t\t\t}.ToImmutableDictionary();\n\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1005_FactMethodShouldNotHaveTestData,\n\t\t\t\t\t\tsymbol.Locations.First(),\n\t\t\t\t\t\tproperties\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/InlineDataMustMatchTheoryParameters.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class InlineDataMustMatchTheoryParameters : XunitDiagnosticAnalyzer\n{\n\tpublic InlineDataMustMatchTheoryParameters() :\n\t\tbase(\n\t\t\tDescriptors.X1009_InlineDataMustMatchTheoryParameters_TooFewValues,\n\t\t\tDescriptors.X1010_InlineDataMustMatchTheoryParameters_IncompatibleValueType,\n\t\t\tDescriptors.X1011_InlineDataMustMatchTheoryParameters_ExtraValue,\n\t\t\tDescriptors.X1012_InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameter\n\t\t)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.TheoryAttributeType is null || xunitContext.Core.InlineDataAttributeType is null)\n\t\t\treturn;\n\n\t\tvar xunitSupportsParameterArrays = xunitContext.Core.TheorySupportsParameterArrays;\n\t\tvar xunitSupportsDefaultParameterValues = xunitContext.Core.TheorySupportsDefaultParameterValues;\n\t\tvar compilation = context.Compilation;\n\t\tvar systemRuntimeInteropServicesOptionalAttribute = TypeSymbolFactory.OptionalAttribute(compilation);\n\t\tvar objectArrayType = compilation.CreateArrayTypeSymbol(compilation.ObjectType);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = method.GetAttributes();\n\t\t\tif (!attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\treturn;\n\n\t\t\tforeach (var attribute in attributes)\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tif (!SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, xunitContext.Core.InlineDataAttributeType))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Check if the semantic model indicates there are no syntax/compilation errors\n\t\t\t\tif (attribute.ConstructorArguments.Length != 1 || !SymbolEqualityComparer.Default.Equals(objectArrayType, attribute.ConstructorArguments.FirstOrDefault().Type))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (attribute.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken) is not AttributeSyntax attributeSyntax)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar arrayStyle = ParameterArrayStyleType.Initializer;\n\t\t\t\tvar dataParameterExpressions = GetParameterExpressionsFromArrayArgument(attributeSyntax);\n\t\t\t\tif (dataParameterExpressions is null)\n\t\t\t\t{\n\t\t\t\t\tarrayStyle = ParameterArrayStyleType.Params;\n\t\t\t\t\tdataParameterExpressions =\n\t\t\t\t\t\tattributeSyntax\n\t\t\t\t\t\t\t.ArgumentList\n\t\t\t\t\t\t\t?.Arguments\n\t\t\t\t\t\t\t.Select(a => a.Expression)\n\t\t\t\t\t\t\t.ToList()\n\t\t\t\t\t\t\t?? [];\n\t\t\t\t}\n\n\t\t\t\tvar dataArrayArgument = attribute.ConstructorArguments.Single();\n\t\t\t\t// Need to special case InlineData(null) as the compiler will treat the whole data array as being initialized to null\n#pragma warning disable IDE0303  // Cannot convert this due to Roslyn 3.11\n\t\t\t\tvar values = dataArrayArgument.IsNull ? ImmutableArray.Create(dataArrayArgument) : dataArrayArgument.Values;\n#pragma warning restore IDE0303\n\t\t\t\tif (values.Length < method.Parameters.Count(p => RequiresMatchingValue(p, xunitSupportsParameterArrays, xunitSupportsDefaultParameterValues, systemRuntimeInteropServicesOptionalAttribute)))\n\t\t\t\t{\n\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\tbuilder[Constants.Properties.ParameterArrayStyle] = arrayStyle.ToString();\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1009_InlineDataMustMatchTheoryParameters_TooFewValues,\n\t\t\t\t\t\t\tattributeSyntax.GetLocation(),\n\t\t\t\t\t\t\tbuilder.ToImmutable()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tint valueIdx = 0, paramIdx = 0;\n\t\t\t\tfor (; valueIdx < values.Length && paramIdx < method.Parameters.Length; valueIdx++)\n\t\t\t\t{\n\t\t\t\t\tvar parameter = method.Parameters[paramIdx];\n\t\t\t\t\tvar value = values[valueIdx];\n\n\t\t\t\t\t// If the value isn't legal (malformed or illegal type), then just skip validation and let\n\t\t\t\t\t// the compiler report the problem.\n\t\t\t\t\tif (value.Kind == TypedConstantKind.Error)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// If the parameter type is object, everything is compatible, though we still need to check for nullability\n\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(parameter.Type, compilation.ObjectType)\n\t\t\t\t\t\t&& (!value.IsNull || parameter.Type.NullableAnnotation != NullableAnnotation.NotAnnotated))\n\t\t\t\t\t{\n\t\t\t\t\t\tparamIdx++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If this is a params array (and we're using a version of xUnit.net that supports params arrays),\n\t\t\t\t\t// get the element type so we can compare it appropriately.\n\t\t\t\t\tvar paramsElementType =\n\t\t\t\t\t\txunitSupportsParameterArrays && parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayParam\n\t\t\t\t\t\t\t? arrayParam.ElementType\n\t\t\t\t\t\t\t: null;\n\n\t\t\t\t\t// For params array of object, just consume everything that's left\n\t\t\t\t\tif (paramsElementType is not null\n\t\t\t\t\t\t&& SymbolEqualityComparer.Default.Equals(paramsElementType, compilation.ObjectType)\n\t\t\t\t\t\t&& paramsElementType.NullableAnnotation != NullableAnnotation.NotAnnotated)\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueIdx = values.Length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value.IsNull)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Special case: if this is the only value of the params array, and it's null,\n\t\t\t\t\t\t// and the params array itself is nullable, then this is allowable, since we'll\n\t\t\t\t\t\t// end up passing null for the array itself.\n\t\t\t\t\t\tif (paramsElementType is not null &&\n\t\t\t\t\t\t\tvalueIdx == values.Length - 1 &&\n\t\t\t\t\t\t\tparameter.Type.NullableAnnotation == NullableAnnotation.Annotated)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalueIdx = values.Length;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar isValueTypeParam =\n\t\t\t\t\t\t\tparamsElementType is not null\n\t\t\t\t\t\t\t\t? paramsElementType.IsValueType && paramsElementType.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T\n\t\t\t\t\t\t\t\t: parameter.Type.IsValueType && parameter.Type.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T;\n\n\t\t\t\t\t\tvar isNonNullableReferenceTypeParam =\n\t\t\t\t\t\t\tparamsElementType is not null\n\t\t\t\t\t\t\t\t? paramsElementType.IsReferenceType && paramsElementType.NullableAnnotation == NullableAnnotation.NotAnnotated\n\t\t\t\t\t\t\t\t: parameter.Type.IsReferenceType && parameter.Type.NullableAnnotation == NullableAnnotation.NotAnnotated;\n\n\t\t\t\t\t\tif (isValueTypeParam || isNonNullableReferenceTypeParam)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\t\t\tbuilder[Constants.Properties.ParameterIndex] = paramIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\t\t\tbuilder[Constants.Properties.ParameterName] = parameter.Name;\n\n\t\t\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\t\t\tDescriptors.X1012_InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameter,\n\t\t\t\t\t\t\t\t\tvalueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,\n\t\t\t\t\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\t\t\t\t\tparameter.Name,\n\t\t\t\t\t\t\t\t\tSymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (value.Type is null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar isCompatible = ConversionChecker.IsConvertible(compilation, value.Type, parameter.Type, xunitContext, value.Kind == TypedConstantKind.Primitive ? value.Value : null);\n\t\t\t\t\t\tif (!isCompatible && paramsElementType is not null)\n\t\t\t\t\t\t\tisCompatible = ConversionChecker.IsConvertible(compilation, value.Type, paramsElementType, xunitContext, value.Kind == TypedConstantKind.Primitive ? value.Value : null);\n\n\t\t\t\t\t\tif (!isCompatible)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\t\t\tbuilder[Constants.Properties.ParameterIndex] = paramIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\t\t\tbuilder[Constants.Properties.ParameterName] = parameter.Name;\n\n\t\t\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\t\t\tDescriptors.X1010_InlineDataMustMatchTheoryParameters_IncompatibleValueType,\n\t\t\t\t\t\t\t\t\tvalueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,\n\t\t\t\t\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\t\t\t\t\tparameter.Name,\n\t\t\t\t\t\t\t\t\tSymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!parameter.IsParams)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Stop moving paramIdx forward if the argument is a parameter array, regardless of xunit's support for it\n\t\t\t\t\t\tparamIdx++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (; valueIdx < values.Length; valueIdx++)\n\t\t\t\t{\n\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\tbuilder[Constants.Properties.ParameterIndex] = valueIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\tbuilder[Constants.Properties.ParameterSpecialType] = values[valueIdx].Type?.SpecialType.ToString() ?? string.Empty;\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1011_InlineDataMustMatchTheoryParameters_ExtraValue,\n\t\t\t\t\t\t\tvalueIdx < dataParameterExpressions.Count ? dataParameterExpressions[valueIdx].GetLocation() : null,\n\t\t\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\t\t\tvalues[valueIdx].ToCSharpString()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SymbolKind.Method);\n\t}\n\n\tstatic bool RequiresMatchingValue(\n\t\tIParameterSymbol parameter,\n\t\tbool supportsParamsArray,\n\t\tbool supportsDefaultValue,\n\t\tINamedTypeSymbol? optionalAttribute) =>\n\t\t\t!(parameter.HasExplicitDefaultValue && supportsDefaultValue)\n\t\t\t&& !(parameter.IsParams && supportsParamsArray)\n\t\t\t&& !parameter.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, optionalAttribute));\n\n\tstatic IList<ExpressionSyntax>? GetParameterExpressionsFromArrayArgument(AttributeSyntax attribute)\n\t{\n\t\tif (attribute.ArgumentList?.Arguments.Count != 1)\n\t\t\treturn null;\n\n\t\tvar argumentExpression = attribute.ArgumentList.Arguments.Single().Expression;\n\n\t\tvar initializer = argumentExpression.Kind() switch\n\t\t{\n\t\t\tSyntaxKind.ArrayCreationExpression => ((ArrayCreationExpressionSyntax)argumentExpression).Initializer,\n\t\t\tSyntaxKind.ImplicitArrayCreationExpression => ((ImplicitArrayCreationExpressionSyntax)argumentExpression).Initializer,\n\t\t\t_ => null,\n\t\t};\n\n\t\tif (initializer is null)\n\t\t\treturn null;\n\n\t\treturn [.. initializer.Expressions];\n\t}\n\n\tpublic enum ParameterArrayStyleType\n\t{\n\t\t/// <summary>\n\t\t/// E.g. InlineData(1, 2, 3)\n\t\t/// </summary>\n\t\tParams,\n\n\t\t/// <summary>\n\t\t/// E.g. InlineData(data: new object[] { 1, 2, 3 }) or InlineData(new object[] { 1, 2, 3 })\n\t\t/// </summary>\n\t\tInitializer,\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/InlineDataShouldBeUniqueWithinTheory.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class InlineDataShouldBeUniqueWithinTheory : XunitDiagnosticAnalyzer\n{\n\tpublic InlineDataShouldBeUniqueWithinTheory() :\n\t\tbase(Descriptors.X1025_InlineDataShouldBeUniqueWithinTheory)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context => AnalyzeMethod(context, xunitContext), SymbolKind.Method);\n\t}\n\n\tstatic void AnalyzeMethod(\n\t\tSymbolAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tif (xunitContext.Core.TheoryAttributeType is null)\n\t\t\treturn;\n\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\treturn;\n\n\t\tvar methodAllAttributes = method.GetAttributes();\n\t\tif (!methodAllAttributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\treturn;\n\n\t\tvar objectArrayType = TypeSymbolFactory.ObjectArray(context.Compilation);\n\n\t\tvar wellFormedInlineDataAttributes =\n\t\t\tmethodAllAttributes\n\t\t\t\t.Where(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, xunitContext.Core.InlineDataAttributeType) && HasAttributeDeclarationNoCompilationErrors(a, objectArrayType));\n\n\t\tAnalyzeInlineDataAttributesWithinTheory(context, wellFormedInlineDataAttributes);\n\t}\n\n\tstatic void AnalyzeInlineDataAttributesWithinTheory(\n\t\tSymbolAnalysisContext context,\n\t\tIEnumerable<AttributeData> inlineDataAttributes)\n\t{\n\t\tif (context.Symbol is not IMethodSymbol attributeRelatedMethod)\n\t\t\treturn;\n\n\t\tvar uniqueAttributes = new HashSet<AttributeData>(new InlineDataUniquenessComparer(attributeRelatedMethod));\n\n\t\tforeach (var currentInlineData in inlineDataAttributes)\n\t\t{\n\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n#pragma warning disable CA1868 // This is not a strict guard, since we're reporting errors\n\n\t\t\tif (uniqueAttributes.Contains(currentInlineData))\n\t\t\t\tReportDuplicate(context, currentInlineData);\n\t\t\telse\n\t\t\t\tuniqueAttributes.Add(currentInlineData);\n\n#pragma warning restore CA1868\n\t\t}\n\t}\n\n\tstatic AttributeSyntax? GetAttributeSyntax(\n\t\tSymbolAnalysisContext context,\n\t\tAttributeData attribute) =>\n\t\t\tattribute.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken) as AttributeSyntax;\n\n\tstatic void ReportDuplicate(\n\t\tSymbolAnalysisContext context,\n\t\tAttributeData duplicateAttribute)\n\t{\n\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\treturn;\n\n\t\tvar attributeSyntax = GetAttributeSyntax(context, duplicateAttribute);\n\t\tif (attributeSyntax == null)\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X1025_InlineDataShouldBeUniqueWithinTheory,\n\t\t\t\tattributeSyntax.GetLocation(),\n\t\t\t\tmethod.Name,\n\t\t\t\tmethod.ContainingType.Name\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic bool HasAttributeDeclarationNoCompilationErrors(\n\t\tAttributeData attribute,\n\t\tIArrayTypeSymbol objectArrayType) =>\n\t\t\tattribute.ConstructorArguments.Length == 1 &&\n\t\t\tSymbolEqualityComparer.Default.Equals(objectArrayType, attribute.ConstructorArguments.FirstOrDefault().Type);\n\n\tsealed class InlineDataUniquenessComparer(IMethodSymbol attributeRelatedMethod) :\n\t\tIEqualityComparer<AttributeData>\n\t{\n\t\treadonly ImmutableArray<IParameterSymbol> methodParametersWithExplicitDefaults =\n\t\t\tattributeRelatedMethod\n\t\t\t\t.Parameters\n\t\t\t\t.Where(p => p.HasExplicitDefaultValue)\n\t\t\t\t.ToImmutableArray();\n\n\t\tpublic bool Equals(\n\t\t\tAttributeData? x,\n\t\t\tAttributeData? y)\n\t\t{\n\t\t\tif (x is null || y is null)\n\t\t\t\treturn x is null && y is null;\n\n\t\t\tvar xArguments = GetEffectiveTestArguments(x);\n\t\t\tvar yArguments = GetEffectiveTestArguments(y);\n\n\t\t\tvar areBothNullEntirely =\n\t\t\t\tIsSingleNullByInlineDataOrByDefaultParamValue(xArguments)\n\t\t\t\t&& IsSingleNullByInlineDataOrByDefaultParamValue(yArguments);\n\n\t\t\treturn areBothNullEntirely || AreArgumentsEqual(xArguments, yArguments);\n\t\t}\n\n\t\t// Since arguments can be object[] at any level we need to compare 2 sequences of trees for equality.\n\t\t// The algorithm traverses each tree in a sequence and compares with the corresponding tree in the other sequence.\n\t\t// Any difference at any stage results in inequality proved and <c>false</c> returned.\n\t\tstatic bool AreArgumentsEqual(\n\t\t\tImmutableArray<object> xArguments,\n\t\t\tImmutableArray<object> yArguments)\n\t\t{\n\t\t\tif (xArguments.Length != yArguments.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (var i = 0; i < xArguments.Length; i++)\n\t\t\t{\n\t\t\t\tvar x = xArguments[i];\n\t\t\t\tvar y = yArguments[i];\n\n\t\t\t\tswitch (x)\n\t\t\t\t{\n\t\t\t\t\tcase TypedConstant xArgPrimitive when xArgPrimitive.Kind != TypedConstantKind.Array:\n\t\t\t\t\t\tswitch (y)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase TypedConstant yArgPrimitive when yArgPrimitive.Kind != TypedConstantKind.Array:\n\t\t\t\t\t\t\t\tif (!xArgPrimitive.Equals(yArgPrimitive))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase IParameterSymbol yMethodParamDefault:\n\t\t\t\t\t\t\t\tif (!object.Equals(xArgPrimitive.Value, yMethodParamDefault.ExplicitDefaultValue))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IParameterSymbol xMethodParamDefault:\n\t\t\t\t\t\tswitch (y)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase TypedConstant yArgPrimitive when yArgPrimitive.Kind != TypedConstantKind.Array:\n\t\t\t\t\t\t\t\tif (!object.Equals(xMethodParamDefault.ExplicitDefaultValue, yArgPrimitive.Value))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase IParameterSymbol yMethodParamDefault:\n\t\t\t\t\t\t\t\tif (!object.Equals(xMethodParamDefault.ExplicitDefaultValue, yMethodParamDefault.ExplicitDefaultValue))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase TypedConstant xArgArray when xArgArray.Kind == TypedConstantKind.Array && !xArgArray.IsNull:\n\t\t\t\t\t\tswitch (y)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase TypedConstant yArgArray when yArgArray.Kind == TypedConstantKind.Array && !yArgArray.IsNull:\n\t\t\t\t\t\t\t\tif (!AreArgumentsEqual(xArgArray.Values.Cast<object>().ToImmutableArray(), yArgArray.Values.Cast<object>().ToImmutableArray()))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// A special search for a degenerated case of either:\n\t\t// 1. InlineData(null) or\n\t\t// 2. InlineData() and a single param method with default returning null.\n\t\tstatic bool IsSingleNullByInlineDataOrByDefaultParamValue(ImmutableArray<object> args)\n\t\t{\n\t\t\tif (args.Length != 1)\n\t\t\t\treturn false;\n\n\t\t\treturn args[0] switch\n\t\t\t{\n\t\t\t\tTypedConstant xSingleNull when xSingleNull.Kind == TypedConstantKind.Array && xSingleNull.IsNull => true,\n\t\t\t\tIParameterSymbol xParamDefaultNull when xParamDefaultNull.ExplicitDefaultValue is null => true,\n\t\t\t\t_ => false,\n\t\t\t};\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Flattens a collection of arguments (ie. new object[] {1, new object[] {2}} becomes a collection of {1, 2}\n\t\t/// and computes accumulative hash code. Exact comparison is carried out in <see cref=\"Equals\"/> impl.\n\t\t/// </summary>\n\t\tpublic int GetHashCode(AttributeData attributeData)\n\t\t{\n\t\t\tvar arguments = GetEffectiveTestArguments(attributeData);\n\t\t\tvar flattened = GetFlattenedArgumentPrimitives(arguments);\n\n\t\t\tvar hash = 17;\n\n\t\t\tforeach (var primitive in flattened)\n\t\t\t\thash = (hash * 31) + (primitive?.GetHashCode() ?? 0);\n\n\t\t\treturn hash;\n\t\t}\n\n\t\tstatic ImmutableArray<object?> GetFlattenedArgumentPrimitives(IEnumerable<object> arguments)\n\t\t{\n\t\t\tvar results = new List<object?>();\n\n\t\t\tforeach (var argument in arguments)\n\t\t\t{\n\t\t\t\tswitch (argument)\n\t\t\t\t{\n\t\t\t\t\tcase TypedConstant argPrimitive when argPrimitive.Kind != TypedConstantKind.Array:\n\t\t\t\t\t\tresults.Add(argPrimitive.Value);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase IParameterSymbol methodParameterWithDefault:\n\t\t\t\t\t\tresults.Add(methodParameterWithDefault.ExplicitDefaultValue);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase TypedConstant argArray when argArray.Kind == TypedConstantKind.Array && !argArray.IsNull:\n\t\t\t\t\t\tresults.AddRange(GetFlattenedArgumentPrimitives(argArray.Values.Cast<object>()));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase TypedConstant nullObjectArray when nullObjectArray.Kind == TypedConstantKind.Array && nullObjectArray.IsNull:\n\t\t\t\t\t\tresults.Add(null);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n#pragma warning disable IDE0305  // Cannot convert this due to Roslyn 3.11\n\t\t\treturn results.ToImmutableArray();\n#pragma warning restore IDE0305\n\t\t}\n\n\t\t// Effective test arguments consist of InlineData argument typed constants concatenated\n\t\t// with default parameters of a test method providing such default parameters are not covered by InlineData arguments.\n\t\tImmutableArray<object> GetEffectiveTestArguments(AttributeData attributeData)\n\t\t{\n\t\t\tvar inlineDataObjectArrayArgument = attributeData.ConstructorArguments.Single();\n\n\t\t\t// special case InlineData(null): the compiler will treat the whole data array as being initialized to null\n\t\t\tvar inlineDataArguments =\n\t\t\t\tinlineDataObjectArrayArgument.IsNull\n#pragma warning disable IDE0303  // Cannot convert this due to Roslyn 3.11\n\t\t\t\t\t? ImmutableArray.Create(inlineDataObjectArrayArgument)\n#pragma warning restore IDE0303\n\t\t\t\t\t: inlineDataObjectArrayArgument.Values;\n\n\t\t\tvar methodDefaultValuesNonCoveredByInlineData =\n\t\t\t\tmethodParametersWithExplicitDefaults\n\t\t\t\t\t.Where(p => p.Ordinal >= inlineDataArguments.Length);\n\n\t\t\tvar allMethodArguments =\n\t\t\t\tinlineDataArguments\n\t\t\t\t\t.Cast<object>()\n\t\t\t\t\t.Concat(methodDefaultValuesNonCoveredByInlineData);\n\n\t\t\treturn allMethodArguments.ToImmutableArray();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/LocalFunctionsCannotBeTestFunctions.cs",
    "content": "using System.Collections.Generic;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class LocalFunctionsCannotBeTestFunctions : XunitDiagnosticAnalyzer\n{\n\tpublic LocalFunctionsCannotBeTestFunctions() :\n\t\tbase(Descriptors.X1029_LocalFunctionsCannotBeTestFunctions)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (context.Node is not LocalFunctionStatementSyntax syntax)\n\t\t\t\treturn;\n\n\t\t\tvar attributeBaseTypes = new List<INamedTypeSymbol>();\n\n\t\t\tif (xunitContext.Core.FactAttributeType is not null)\n\t\t\t\tattributeBaseTypes.Add(xunitContext.Core.FactAttributeType);\n\t\t\tif (xunitContext.Core.DataAttributeType is not null)\n\t\t\t\tattributeBaseTypes.Add(xunitContext.Core.DataAttributeType);\n\n\t\t\tif (attributeBaseTypes.Count == 0)\n\t\t\t\treturn;\n\n\t\t\tforeach (var attributeList in syntax.AttributeLists)\n\t\t\t\tforeach (var attribute in attributeList.Attributes)\n\t\t\t\t{\n\t\t\t\t\tvar symbol = context.SemanticModel.GetSymbolInfo(attribute).Symbol;\n\t\t\t\t\tif (symbol is null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar attributeType = symbol.ContainingType;\n\t\t\t\t\tif (attributeType is null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tforeach (var attributeBaseType in attributeBaseTypes)\n\t\t\t\t\t\tif (attributeBaseType.IsAssignableFrom(attributeType))\n\t\t\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\t\t\tDescriptors.X1029_LocalFunctionsCannotBeTestFunctions,\n\t\t\t\t\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\t\t\t\t\t$\"[{attribute.GetText()}]\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t}, SyntaxKind.LocalFunctionStatement);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/MemberDataShouldReferenceValidMember.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class MemberDataShouldReferenceValidMember : XunitDiagnosticAnalyzer\n{\n\tpublic MemberDataShouldReferenceValidMember() :\n\t\tbase(\n\t\t\tDescriptors.X1014_MemberDataShouldUseNameOfOperator,\n\t\t\tDescriptors.X1015_MemberDataMustReferenceExistingMember,\n\t\t\tDescriptors.X1016_MemberDataMustReferencePublicMember,\n\t\t\tDescriptors.X1017_MemberDataMustReferenceStaticMember,\n\t\t\tDescriptors.X1018_MemberDataMustReferenceValidMemberKind,\n\t\t\tDescriptors.X1019_MemberDataMustReferenceMemberOfValidType,\n\t\t\tDescriptors.X1020_MemberDataPropertyMustHaveGetter,\n\t\t\tDescriptors.X1021_MemberDataNonMethodShouldNotHaveParameters,\n\t\t\tDescriptors.X1034_MemberDataArgumentsMustMatchMethodParameters_NullShouldNotBeUsedForIncompatibleParameter,\n\t\t\tDescriptors.X1035_MemberDataArgumentsMustMatchMethodParameters_IncompatibleValueType,\n\t\t\tDescriptors.X1036_MemberDataArgumentsMustMatchMethodParameters_ExtraValue,\n\t\t\tDescriptors.X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters,\n\t\t\tDescriptors.X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters,\n\t\t\tDescriptors.X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes,\n\t\t\tDescriptors.X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability,\n\t\t\tDescriptors.X1042_MemberDataTheoryDataIsRecommendedForStronglyTypedAnalysis,\n\t\t\tDescriptors.X1053_MemberDataMemberMustBeStaticallyWrittenTo\n\t\t)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.MemberDataAttributeType is null)\n\t\t\treturn;\n\n\t\tvar compilation = context.Compilation;\n\t\tvar theoryDataTypes = TypeSymbolFactory.TheoryData_ByGenericArgumentCount(compilation);\n\t\tvar theoryDataRowTypes = TypeSymbolFactory.TheoryDataRow_ByGenericArgumentCount_V3(compilation);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (context.Node is not MethodDeclarationSyntax testMethod)\n\t\t\t\treturn;\n\n\t\t\tvar attributeLists = testMethod.AttributeLists;\n\n\t\t\tforeach (var attributeSyntax in attributeLists.WhereNotNull().SelectMany(attList => attList.Attributes))\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\t// Only work against MemberDataAttribute\n\t\t\t\tvar semanticModel = context.SemanticModel;\n\t\t\t\tif (!SymbolEqualityComparer.Default.Equals(semanticModel.GetTypeInfo(attributeSyntax, context.CancellationToken).Type, xunitContext.Core.MemberDataAttributeType))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Need the name of the member to do anything\n\t\t\t\tif (attributeSyntax.ArgumentList is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar memberNameArgument = attributeSyntax.ArgumentList.Arguments.FirstOrDefault();\n\t\t\t\tif (memberNameArgument is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar constantValue = semanticModel.GetConstantValue(memberNameArgument.Expression, context.CancellationToken);\n\t\t\t\tif (constantValue.Value is not string memberName)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Figure out which parameters are named property arguments\n\t\t\t\tvar propertyAttributeParameters =\n\t\t\t\t\tattributeSyntax\n\t\t\t\t\t\t.ArgumentList\n\t\t\t\t\t\t.Arguments\n\t\t\t\t\t\t.Count(a => !string.IsNullOrEmpty(a.NameEquals?.Name.Identifier.ValueText));\n\n\t\t\t\t// Everything else will be potential arguments (for the method-based MemberData)\n\t\t\t\tvar paramsCount = attributeSyntax.ArgumentList.Arguments.Count - 1 - propertyAttributeParameters;\n\n\t\t\t\t// Determine what type and member name the MemberData targets\n\t\t\t\tvar (testClassTypeSymbol, declaredMemberTypeSymbol) = GetClassTypesForAttribute(attributeSyntax.ArgumentList, semanticModel, context.CancellationToken);\n\t\t\t\tif (declaredMemberTypeSymbol is null || testClassTypeSymbol is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Ensure we're pointing to something that exists\n\t\t\t\tvar memberSymbol = FindMemberSymbol(memberName, declaredMemberTypeSymbol, paramsCount);\n\t\t\t\tif (memberSymbol is null)\n\t\t\t\t{\n\t\t\t\t\tReportMissingMember(context, attributeSyntax, memberName, declaredMemberTypeSymbol);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ensure we pointing to a field, method, or property\n\t\t\t\tvar memberReturnType = memberSymbol switch\n\t\t\t\t{\n\t\t\t\t\tIFieldSymbol field => field.Type,\n\t\t\t\t\tIMethodSymbol method => method.ReturnType,\n\t\t\t\t\tIPropertySymbol prop => prop.Type,\n\t\t\t\t\t_ => null,\n\t\t\t\t};\n\t\t\t\tif (memberReturnType is null)\n\t\t\t\t{\n\t\t\t\t\tReportIncorrectMemberType(context, attributeSyntax);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Make sure they use nameof() instead of a string constant for the member name\n\t\t\t\tif (compilation is CSharpCompilation cSharpCompilation &&\n\t\t\t\t\t\tcSharpCompilation.LanguageVersion >= LanguageVersion.CSharp6 &&\n\t\t\t\t\t\tmemberNameArgument.Expression.IsKind(SyntaxKind.StringLiteralExpression))\n\t\t\t\t\tReportUseNameof(context, memberNameArgument, memberName, testClassTypeSymbol, memberSymbol);\n\n\t\t\t\t// Every error we report will include at least these two properties\n\t\t\t\tvar memberProperties = new Dictionary<string, string?>\n\t\t\t\t{\n\t\t\t\t\t{ Constants.AttributeProperties.DeclaringType, declaredMemberTypeSymbol.ToDisplayString() },\n\t\t\t\t\t{ Constants.AttributeProperties.MemberName, memberName }\n\t\t\t\t}.ToImmutableDictionary();\n\n\t\t\t\t// Make sure the member is public\n\t\t\t\tif (memberSymbol.DeclaredAccessibility != Accessibility.Public)\n\t\t\t\t\tReportNonPublicAccessibility(context, attributeSyntax, memberProperties);\n\n\t\t\t\t// Make sure the member is static\n\t\t\t\tif (!memberSymbol.IsStatic)\n\t\t\t\t\tReportNonStatic(context, attributeSyntax, memberProperties);\n\n\t\t\t\tif (!IsInitialized(memberSymbol, context))\n\t\t\t\t\tReportMemberMustBeWrittenTo(context, memberSymbol);\n\n\t\t\t\t// Unwrap Task or ValueTask, but only for v3\n\t\t\t\tif (xunitContext.HasV3References &&\n\t\t\t\t\tmemberReturnType is INamedTypeSymbol namedMemberReturnType &&\n\t\t\t\t\tnamedMemberReturnType.IsGenericType)\n\t\t\t\t{\n\t\t\t\t\tvar taskTypes = new[] {\n\t\t\t\t\t\tTypeSymbolFactory.TaskOfT(compilation)?.ConstructUnboundGenericType(),\n\t\t\t\t\t\tTypeSymbolFactory.ValueTaskOfT(compilation)?.ConstructUnboundGenericType(),\n\t\t\t\t\t}.WhereNotNull().ToArray();\n\n\t\t\t\t\tvar unboundGeneric = namedMemberReturnType.ConstructUnboundGenericType();\n\n\t\t\t\t\tif (taskTypes.Any(taskType => SymbolEqualityComparer.Default.Equals(unboundGeneric, taskType)))\n\t\t\t\t\t\tmemberReturnType = namedMemberReturnType.TypeArguments[0];\n\t\t\t\t}\n\n\t\t\t\t// Make sure the member returns a compatible type\n\t\t\t\tvar iEnumerableOfTheoryDataRowType = TypeSymbolFactory.IEnumerableOfITheoryDataRow(compilation);\n\t\t\t\tvar iAsyncEnumerableOfTheoryDataRowType = TypeSymbolFactory.IAsyncEnumerableOfITheoryDataRow(compilation);\n\t\t\t\tvar iEnumerableOfTupleType = TypeSymbolFactory.IEnumerableOfTuple(compilation);\n\t\t\t\tvar iAsyncEnumerableOfTupleType = TypeSymbolFactory.IAsyncEnumerableOfTuple(compilation);\n\t\t\t\tvar IsValidMemberReturnType =\n\t\t\t\t\tVerifyDataSourceReturnType(context, compilation, xunitContext, memberReturnType, memberProperties, attributeSyntax, iEnumerableOfTheoryDataRowType, iAsyncEnumerableOfTheoryDataRowType, iEnumerableOfTupleType, iAsyncEnumerableOfTupleType);\n\n\t\t\t\t// Make sure public properties have a public getter\n\t\t\t\tif (memberSymbol.Kind == SymbolKind.Property && memberSymbol.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\t\tif (memberSymbol is IPropertySymbol propertySymbol)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar getMethod = propertySymbol.GetMethod;\n\t\t\t\t\t\tif (getMethod is null || getMethod.DeclaredAccessibility != Accessibility.Public)\n\t\t\t\t\t\t\tReportNonPublicPropertyGetter(context, attributeSyntax);\n\t\t\t\t\t}\n\n\t\t\t\t// If the member returns TheoryData<> or TheoryDataRow<>, ensure that the types are compatible.\n\t\t\t\t// If the member does not return TheoryData<> or TheoryDataRow<>, gently suggest to the user\n\t\t\t\t// to switch for better type safety.\n\t\t\t\tif (IsTheoryDataType(memberReturnType, theoryDataTypes, out var theoryReturnType))\n\t\t\t\t\tVerifyGenericArgumentTypes(semanticModel, context, testMethod, theoryDataTypes[0], theoryReturnType, memberName, declaredMemberTypeSymbol, attributeSyntax);\n\t\t\t\telse if (IsGenericTheoryDataRowType(memberReturnType, iEnumerableOfTheoryDataRowType, iAsyncEnumerableOfTheoryDataRowType, theoryDataRowTypes, out var theoryDataReturnType))\n\t\t\t\t\tVerifyGenericArgumentTypes(semanticModel, context, testMethod, theoryDataRowTypes[0], theoryDataReturnType, memberName, declaredMemberTypeSymbol, attributeSyntax);\n\t\t\t\telse if (IsValidMemberReturnType)\n\t\t\t\t\tReportMemberReturnsTypeUnsafeValue(context, attributeSyntax, xunitContext.HasV3References ? \"TheoryData<> or IEnumerable<TheoryDataRow<>>\" : \"TheoryData<>\");\n\n\t\t\t\t// Get the arguments that are to be passed to the method\n\t\t\t\tvar extraArguments = attributeSyntax.ArgumentList.Arguments.Skip(1).TakeWhile(a => a.NameEquals is null).ToList();\n\n\t\t\t\tif (memberSymbol.Kind == SymbolKind.Method)\n\t\t\t\t\tVerifyDataMethodParameterUsage(semanticModel, context, compilation, xunitContext, memberSymbol, memberName, extraArguments);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Make sure we only have arguments for method-based member data\n\t\t\t\t\tif (extraArguments.Count != 0)\n\t\t\t\t\t\tReportIllegalNonMethodArguments(context, attributeSyntax, extraArguments);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SyntaxKind.MethodDeclaration);\n\t}\n\n\tstatic bool IsInitialized(\n\t\tISymbol memberSymbol,\n\t\tSyntaxNodeAnalysisContext context)\n\t{\n\t\tif (!memberSymbol.IsStatic || memberSymbol is IMethodSymbol)\n\t\t\t// assume initialized, if nonstatic or method to avoid spurious results\n\t\t\treturn true;\n\n\t\tif (memberSymbol.DeclaringSyntaxReferences.IsEmpty)\n\t\t\treturn true;\n\n\t\tvar semantics = context.SemanticModel;\n\t\tvar declarationReference = memberSymbol.DeclaringSyntaxReferences.First();\n\t\tvar declarationSyntax = declarationReference.GetSyntax();\n\t\tif (declarationSyntax is PropertyDeclarationSyntax prop\n\t\t\t&& (prop.Initializer != null\n\t\t\t\t|| prop.AccessorList?.Accessors.FirstOrDefault(decl => decl.Kind() == SyntaxKind.GetAccessorDeclaration)?.Body != null\n\t\t\t\t|| prop.ExpressionBody != null))\n\t\t\treturn true;\n\n\t\tif (declarationSyntax is VariableDeclaratorSyntax field && field.Initializer != null)\n\t\t\treturn true;\n\n\t\tvar declarationContainer = declarationSyntax.FirstAncestorOrSelf<TypeDeclarationSyntax>()!;\n\t\tvar staticConstructors =\n\t\t\tdeclarationContainer\n\t\t\t\t.DescendantNodes()\n\t\t\t\t.OfType<ConstructorDeclarationSyntax>()\n\t\t\t\t.Where(ctor => ctor.Modifiers.Any(SyntaxKind.StaticKeyword));\n\n\t\tforeach (var ctor in staticConstructors)\n\t\t{\n\t\t\t// Look for direct assignments to the member\n\t\t\tvar assignments =\n\t\t\t\tctor\n\t\t\t\t\t.DescendantNodes(descendIntoChildren: _ => true, descendIntoTrivia: false)\n\t\t\t\t\t.OfType<AssignmentExpressionSyntax>()\n\t\t\t\t\t.Where(assignment =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar assignedSymbol = semantics.GetSymbolInfo(assignment.Left).Symbol;\n\t\t\t\t\t\treturn SymbolEqualityComparer.Default.Equals(assignedSymbol?.OriginalDefinition, memberSymbol);\n\t\t\t\t\t});\n\n\t\t\tif (assignments.Any())\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tstatic ISymbol? FindMemberSymbol(\n\t\tstring memberName,\n\t\tITypeSymbol? type,\n\t\tint paramsCount)\n\t{\n\t\tif (paramsCount > 0 && FindMethodSymbol(memberName, type, paramsCount) is ISymbol methodSymbol)\n\t\t\treturn methodSymbol;\n\n\t\twhile (type is not null)\n\t\t{\n\t\t\tvar memberSymbol = type.GetMembers(memberName).FirstOrDefault();\n\t\t\tif (memberSymbol is not null)\n\t\t\t\treturn memberSymbol;\n\n\t\t\ttype = type.BaseType;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static ISymbol? FindMethodSymbol(\n\t\tstring memberName,\n\t\tITypeSymbol? type,\n\t\tint paramsCount)\n\t{\n\t\tGuard.ArgumentNotNull(memberName);\n\n\t\twhile (type is not null)\n\t\t{\n\t\t\tvar methodSymbol =\n\t\t\t\ttype\n\t\t\t\t\t.GetMembers(memberName)\n\t\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t\t.FirstOrDefault(x => x.Parameters.Length == paramsCount);\n\n\t\t\tif (methodSymbol is not null)\n\t\t\t\treturn methodSymbol;\n\n\t\t\ttype = type.BaseType;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic ITypeSymbol? FindTypeArgumentFromIEnumerable(\n\t\tITypeSymbol? start,\n\t\tCompilation compilation)\n\t{\n\t\tif (start is not INamedTypeSymbol namedStart)\n\t\t\treturn null;\n\n\t\tvar iEnumerableOfT = TypeSymbolFactory.IEnumerableOfT(compilation);\n\t\tif (iEnumerableOfT is null)\n\t\t\treturn null;\n\n\t\tvar current = namedStart;\n\t\twhile (current != null)\n\t\t{\n\t\t\t// If this class implements IEnumerable<T>, return T type argument\n\t\t\tforeach (var iface in current.AllInterfaces)\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(iface.OriginalDefinition, iEnumerableOfT))\n\t\t\t\t\treturn iface.TypeArguments.FirstOrDefault();\n\n\t\t\t// Navigate to its Base types to investigate if they implement IEnumerable,\n\t\t\t// attempt to resolve the base type from the source syntax (handles `: ValidExamples`).\n\t\t\tvar declaredBase = ResolveDeclaredBaseTypeFromSyntax(current, compilation) as INamedTypeSymbol;\n\n\t\t\t// Prefer declaredBase when available; otherwise fall back to the BaseType symbol.\n\t\t\tvar next = declaredBase ?? current.BaseType;\n\n\t\t\t// Stop if we reached object\n\t\t\tif (next?.SpecialType == SpecialType.System_Object)\n\t\t\t\tbreak;\n\n\t\t\tcurrent = next;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static (INamedTypeSymbol? TestClass, ITypeSymbol? MemberClass) GetClassTypesForAttribute(\n\t\tAttributeArgumentListSyntax attributeList,\n\t\tSemanticModel semanticModel,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(attributeList);\n\t\tGuard.ArgumentNotNull(semanticModel);\n\n\t\tvar memberTypeArgument = attributeList.Arguments.FirstOrDefault(a => a.NameEquals?.Name.Identifier.ValueText == Constants.AttributeProperties.MemberType);\n\t\tvar memberTypeSymbol = default(ITypeSymbol);\n\t\tif (memberTypeArgument?.Expression is TypeOfExpressionSyntax typeofExpression)\n\t\t{\n\t\t\tvar typeSyntax = typeofExpression.Type;\n\t\t\tmemberTypeSymbol = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type;\n\t\t}\n\n\t\tvar classSyntax = attributeList.FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classSyntax is null)\n\t\t\treturn (null, null);\n\n\t\tvar testClassTypeSymbol = semanticModel.GetDeclaredSymbol(classSyntax, cancellationToken);\n\t\treturn (testClassTypeSymbol, memberTypeSymbol ?? testClassTypeSymbol);\n\t}\n\n\tstatic IList<ExpressionSyntax>? GetParameterExpressionsFromArrayArgument(\n\t\tList<AttributeArgumentSyntax> arguments, SemanticModel semanticModel)\n\t{\n\t\tif (arguments.Count > 1)\n\t\t\treturn [.. arguments.Select(a => a.Expression)];\n\t\tif (arguments.Count != 1)\n\t\t\treturn null;\n\n\t\tvar argumentExpression = arguments.Single().Expression;\n\n\t\tvar kind = argumentExpression.Kind();\n\t\tvar initializer = kind switch\n\t\t{\n\t\t\tSyntaxKind.ArrayCreationExpression => ((ArrayCreationExpressionSyntax)argumentExpression).Initializer,\n\t\t\tSyntaxKind.ImplicitArrayCreationExpression => ((ImplicitArrayCreationExpressionSyntax)argumentExpression).Initializer,\n\t\t\t_ => null,\n\t\t};\n\n\t\tif (initializer is null)\n\t\t\treturn [argumentExpression];\n\n\t\t// In the special case where the argument is an object[], treat like params\n\t\tvar type = semanticModel.GetTypeInfo(argumentExpression).Type;\n\t\tif (type is IArrayTypeSymbol arrayType && arrayType.ElementType.SpecialType == SpecialType.System_Object)\n\t\t\treturn [.. initializer.Expressions];\n\n\t\treturn [argumentExpression];\n\t}\n\n\tstatic bool IsGenericTheoryDataRowType(\n\t\tITypeSymbol? memberReturnType,\n\t\tINamedTypeSymbol? iEnumerableOfTheoryDataRowType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfTheoryDataRowType,\n\t\tDictionary<int, INamedTypeSymbol> theoryDataRowTypes,\n\t\t[NotNullWhen(true)] out INamedTypeSymbol? theoryReturnType)\n\t{\n\t\ttheoryReturnType = default;\n\n\t\tif (iEnumerableOfTheoryDataRowType is null)\n\t\t\treturn false;\n\t\tvar rowType = memberReturnType.UnwrapEnumerable(iEnumerableOfTheoryDataRowType.OriginalDefinition);\n\t\tif (rowType is null && iAsyncEnumerableOfTheoryDataRowType is not null)\n\t\t\trowType = memberReturnType.UnwrapEnumerable(iAsyncEnumerableOfTheoryDataRowType.OriginalDefinition);\n\t\tif (rowType is null)\n\t\t\treturn false;\n\n\t\tvar working = rowType as INamedTypeSymbol;\n\t\tfor (; working is not null; working = working.BaseType)\n\t\t{\n\t\t\tvar returnTypeArguments = working.TypeArguments;\n\t\t\tif (returnTypeArguments.Length != 0\n\t\t\t\t&& theoryDataRowTypes.TryGetValue(returnTypeArguments.Length, out var theoryDataType)\n\t\t\t\t&& SymbolEqualityComparer.Default.Equals(theoryDataType, working.OriginalDefinition))\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (working is null)\n\t\t\treturn false;\n\n\t\ttheoryReturnType = working;\n\t\treturn true;\n\t}\n\n\tstatic bool IsTheoryDataType(\n\t\tITypeSymbol? memberReturnType,\n\t\tDictionary<int, INamedTypeSymbol> theoryDataTypes,\n\t\t[NotNullWhen(true)] out INamedTypeSymbol? theoryReturnType)\n\t{\n\t\ttheoryReturnType = default;\n\t\tif (memberReturnType is not INamedTypeSymbol namedReturnType)\n\t\t\treturn false;\n\n\t\tvar working = namedReturnType;\n\t\twhile (working is not null)\n\t\t{\n\t\t\tvar returnTypeArguments = working.TypeArguments;\n\t\t\tif (theoryDataTypes.TryGetValue(returnTypeArguments.Length, out var theoryDataType)\n\t\t\t\t&& SymbolEqualityComparer.Default.Equals(theoryDataType, working.OriginalDefinition))\n\t\t\t\tbreak;\n\t\t\tworking = working.BaseType;\n\t\t}\n\n\t\tif (working is null)\n\t\t\treturn false;\n\n\t\ttheoryReturnType = working;\n\t\treturn true;\n\t}\n\n\tstatic bool ShouldSuppressX1015BecauseAllDerivedConcreteTypesHaveMember(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tITypeSymbol declaredMemberTypeSymbol,\n\t\tstring memberName)\n\t{\n\t\tif (declaredMemberTypeSymbol is not INamedTypeSymbol baseType)\n\t\t\treturn false;\n\n\t\t// Only consider the special-case from the issue:\n\t\t// - the declared type is an abstract class\n\t\tif (baseType.TypeKind != TypeKind.Class || !baseType.IsAbstract)\n\t\t\treturn false;\n\n\t\tvar compilation = context.SemanticModel.Compilation;\n\n\t\tstatic IEnumerable<INamedTypeSymbol> GetAllTypesFromNamespace(INamespaceSymbol @namespace)\n\t\t{\n\t\t\tforeach (var member in @namespace.GetMembers())\n\t\t\t\tif (member is INamespaceSymbol childNs)\n\t\t\t\t\tforeach (var t in GetAllTypesFromNamespace(childNs))\n\t\t\t\t\t\tyield return t;\n\t\t\t\telse if (member is INamedTypeSymbol namedType)\n\t\t\t\t\tforeach (var t in GetAllTypesFromType(namedType))\n\t\t\t\t\t\tyield return t;\n\t\t}\n\n\t\tstatic IEnumerable<INamedTypeSymbol> GetAllTypesFromType(INamedTypeSymbol type)\n\t\t{\n\t\t\tyield return type;\n\n\t\t\tforeach (var nested in type.GetTypeMembers())\n\t\t\t\tforeach (var t in GetAllTypesFromType(nested))\n\t\t\t\t\tyield return t;\n\t\t}\n\n\t\tstatic bool IsDerivedFrom(INamedTypeSymbol type, INamedTypeSymbol baseType)\n\t\t{\n\t\t\tfor (var current = type.BaseType; current is not null; current = current.BaseType)\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(current, baseType))\n\t\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tvar derivedConcreteTypes =\n\t\t\tGetAllTypesFromNamespace(compilation.Assembly.GlobalNamespace)\n\t\t\t\t.Where(t => t.TypeKind == TypeKind.Class && !t.IsAbstract && IsDerivedFrom(t, baseType))\n\t\t\t\t.ToList();\n\n\t\t// If we can't find any derived concrete types in this compilation,\n\t\t// we can't prove it's safe - do not suppress.\n\t\tif (derivedConcreteTypes.Count == 0)\n\t\t\treturn false;\n\n\t\t// Suppress only if ALL derived concrete types contain the member.\n\t\tforeach (var derived in derivedConcreteTypes)\n\t\t\tif (derived.GetMembers(memberName).Length == 0)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}\n\n\tstatic void ReportIllegalNonMethodArguments(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tList<AttributeArgumentSyntax> extraArguments)\n\t{\n\t\tvar span = TextSpan.FromBounds(extraArguments.First().Span.Start, extraArguments.Last().Span.End);\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X1021_MemberDataNonMethodShouldNotHaveParameters,\n\t\t\t\tLocation.Create(attribute.SyntaxTree, span)\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic void ReportIncorrectMemberType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1018_MemberDataMustReferenceValidMemberKind,\n\t\t\t\t\tattribute.GetLocation()\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportIncorrectReturnType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tINamedTypeSymbol iEnumerableOfObjectArrayType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfObjectArrayType,\n\t\tINamedTypeSymbol? iEnumerableOfTheoryDataRowType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfTheoryDataRowType,\n\t\tINamedTypeSymbol? iEnumerableOfTupleType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfTupleType,\n\t\tAttributeSyntax attribute,\n\t\tImmutableDictionary<string, string?> memberProperties,\n\t\tITypeSymbol memberType)\n\t{\n\t\tvar validSymbols = \"'\" + SymbolDisplay.ToDisplayString(iEnumerableOfObjectArrayType) + \"'\";\n\n\t\t// Only want the extra types when we know ITheoryDataRow is valid\n\t\tif (iAsyncEnumerableOfObjectArrayType is not null &&\n\t\t\t\tiEnumerableOfTheoryDataRowType is not null &&\n\t\t\t\tiAsyncEnumerableOfTheoryDataRowType is not null &&\n\t\t\t\tiEnumerableOfTupleType is not null &&\n\t\t\t\tiAsyncEnumerableOfTupleType is not null)\n#pragma warning disable RS1035  // The suggested fix is not available in this context\n\t\t\tvalidSymbols += string.Format(\n\t\t\t\tCultureInfo.CurrentCulture,\n\t\t\t\t\", '{0}', '{1}', '{2}', '{3}', or '{4}'\",\n\t\t\t\tSymbolDisplay.ToDisplayString(iAsyncEnumerableOfObjectArrayType),\n\t\t\t\tSymbolDisplay.ToDisplayString(iEnumerableOfTheoryDataRowType),\n\t\t\t\tSymbolDisplay.ToDisplayString(iAsyncEnumerableOfTheoryDataRowType),\n\t\t\t\tSymbolDisplay.ToDisplayString(iEnumerableOfTupleType),\n\t\t\t\tSymbolDisplay.ToDisplayString(iAsyncEnumerableOfTupleType)\n\t\t\t);\n#pragma warning restore RS1035\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X1019_MemberDataMustReferenceMemberOfValidType,\n\t\t\t\tattribute.GetLocation(),\n\t\t\t\tmemberProperties,\n\t\t\t\tvalidSymbols,\n\t\t\t\tSymbolDisplay.ToDisplayString(memberType)\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic void ReportMemberMethodParametersDoNotMatchArgumentTypes(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tExpressionSyntax syntax,\n\t\tIParameterSymbol parameter,\n\t\tITypeSymbol? paramsElementType,\n\t\tImmutableDictionary<string, string?>.Builder builder) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1035_MemberDataArgumentsMustMatchMethodParameters_IncompatibleValueType,\n\t\t\t\t\tsyntax.GetLocation(),\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tparameter.Name,\n\t\t\t\t\tSymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMethodParameterNullability(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tExpressionSyntax syntax,\n\t\tIParameterSymbol parameter,\n\t\tITypeSymbol? paramsElementType,\n\t\tImmutableDictionary<string, string?>.Builder builder) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1034_MemberDataArgumentsMustMatchMethodParameters_NullShouldNotBeUsedForIncompatibleParameter,\n\t\t\t\t\tsyntax.GetLocation(),\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tparameter.Name,\n\t\t\t\t\tSymbolDisplay.ToDisplayString(paramsElementType ?? parameter.Type)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMethodTheoryDataExtraTypeArguments(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tLocation location,\n\t\tImmutableDictionary<string, string?>.Builder builder,\n\t\tINamedTypeSymbol theoryDataType) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters,\n\t\t\t\t\tlocation,\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataType)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMethodTheoryDataIncompatibleType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tLocation location,\n\t\tITypeSymbol theoryDataTypeParameter,\n\t\tINamedTypeSymbol memberType,\n\t\tstring memberName,\n\t\tIParameterSymbol parameter) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes,\n\t\t\t\t\tlocation,\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataTypeParameter),\n\t\t\t\t\tmemberType.Name + \".\" + memberName,\n\t\t\t\t\tparameter.Name\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMethodTheoryDataNullability(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tLocation location,\n\t\tITypeSymbol theoryDataTypeParameter,\n\t\tINamedTypeSymbol memberType,\n\t\tstring memberName,\n\t\tIParameterSymbol parameter) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability,\n\t\t\t\t\tlocation,\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataTypeParameter),\n\t\t\t\t\tmemberType.Name + \".\" + memberName,\n\t\t\t\t\tparameter.Name\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMethodTheoryDataTooFewTypeArguments(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tLocation location,\n\t\tImmutableDictionary<string, string?>.Builder builder,\n\t\tINamedTypeSymbol theoryDataType) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters,\n\t\t\t\t\tlocation,\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(theoryDataType)\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberMustBeWrittenTo(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tISymbol memberSymbol) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1053_MemberDataMemberMustBeStaticallyWrittenTo,\n\t\t\t\t\tmemberSymbol.Locations.First(),\n\t\t\t\t\tmemberSymbol.Name\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMissingMember(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tstring memberName,\n\t\tITypeSymbol declaredMemberTypeSymbol)\n\t{\n\t\t// Special case: abstract base class references MemberData member that exists only on derived types.\n\t\t// If ALL derived concrete types in this compilation contain the member, don't warn.\n\t\tif (ShouldSuppressX1015BecauseAllDerivedConcreteTypesHaveMember(context, declaredMemberTypeSymbol, memberName))\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X1015_MemberDataMustReferenceExistingMember,\n\t\t\t\tattribute.GetLocation(),\n\t\t\t\tmemberName,\n\t\t\t\tSymbolDisplay.ToDisplayString(declaredMemberTypeSymbol)\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic void ReportNonPublicAccessibility(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tImmutableDictionary<string, string?> memberProperties) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1016_MemberDataMustReferencePublicMember,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tmemberProperties\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportNonPublicPropertyGetter(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1020_MemberDataPropertyMustHaveGetter,\n\t\t\t\t\tattribute.GetLocation()\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportMemberReturnsTypeUnsafeValue(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tstring suggestedAlternative) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1042_MemberDataTheoryDataIsRecommendedForStronglyTypedAnalysis,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tsuggestedAlternative\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportNonStatic(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeSyntax attribute,\n\t\tImmutableDictionary<string, string?> memberProperties) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1017_MemberDataMustReferenceStaticMember,\n\t\t\t\t\tattribute.GetLocation(),\n\t\t\t\t\tmemberProperties\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportTooManyArgumentsProvided(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tExpressionSyntax syntax,\n\t\tobject? value,\n\t\tImmutableDictionary<string, string?>.Builder builder) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1036_MemberDataArgumentsMustMatchMethodParameters_ExtraValue,\n\t\t\t\t\tsyntax.GetLocation(),\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tvalue?.ToString() ?? \"null\"\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportUseNameof(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tAttributeArgumentSyntax memberNameArgument,\n\t\tstring memberName,\n\t\tINamedTypeSymbol testClassTypeSymbol,\n\t\tISymbol memberSymbol)\n\t{\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tif (!SymbolEqualityComparer.Default.Equals(memberSymbol.ContainingType, testClassTypeSymbol))\n\t\t\tbuilder.Add(\"DeclaringType\", memberSymbol.ContainingType.ToDisplayString());\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X1014_MemberDataShouldUseNameOfOperator,\n\t\t\t\tmemberNameArgument.Expression.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tmemberName,\n\t\t\t\tmemberSymbol.ContainingType.ToDisplayString()\n\t\t\t)\n\t\t);\n\t}\n\n\t/// <summary>\n\t/// Resolve declared base type and find the first base class that implements IEnumerable\n\t/// (e.g. \"ValidExample\" from \"class SubtypeValidExample : ValidExample {}\")\n\t/// </summary>\n\tstatic ITypeSymbol? ResolveDeclaredBaseTypeFromSyntax(\n\t\tITypeSymbol type,\n\t\tCompilation compilation)\n\t{\n\t\tif (type is null)\n\t\t\treturn null;\n\n\t\t// Look through source declarations for an explicit base type in the syntax.\n\t\tforeach (var declaringReference in type.DeclaringSyntaxReferences)\n\t\t{\n\t\t\tvar syntax = declaringReference.GetSyntax();\n\t\t\tif (syntax is ClassDeclarationSyntax cls && cls.BaseList is not null && cls.BaseList.Types.Count > 0)\n\t\t\t{\n\t\t\t\tvar baseTypeSyntax = cls.BaseList.Types.First().Type;\n\t\t\t\tvar baseTypeName = baseTypeSyntax.ToString(); // may be qualified\n\n\t\t\t\t// Try direct metadata lookup first (works for namespace-qualified names)\n\t\t\t\tvar byMetadata = compilation.GetTypeByMetadataName(baseTypeName);\n\t\t\t\tif (byMetadata is not null)\n\t\t\t\t\treturn byMetadata;\n\n\t\t\t\t// Fallback: search symbols by the simple name and try to match fully-qualified textual form.\n\t\t\t\tvar simpleName = baseTypeName.Split('.').Last();\n\t\t\t\tvar candidates =\n\t\t\t\t\tcompilation\n\t\t\t\t\t\t.GetSymbolsWithName(n => n == simpleName, SymbolFilter.Type)\n\t\t\t\t\t\t.OfType<INamedTypeSymbol>()\n\t\t\t\t\t\t.ToList();\n\n\t\t\t\t// Prefer exact textual match of declared name (handles namespace-qualified baseTypeSyntax)\n\t\t\t\tvar exact = candidates.FirstOrDefault(c => string.Equals(c.ToDisplayString(), baseTypeName, StringComparison.Ordinal));\n\t\t\t\tif (exact is not null)\n\t\t\t\t\treturn exact;\n\n\t\t\t\t// Otherwise return the first candidate in the current compilation with the simple name\n\t\t\t\treturn candidates.FirstOrDefault();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic void VerifyDataMethodParameterUsage(\n\t\tSemanticModel semanticModel,\n\t\tSyntaxNodeAnalysisContext context,\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext,\n\t\tISymbol memberSymbol,\n\t\tstring memberName,\n\t\tList<AttributeArgumentSyntax> extraArguments)\n\t{\n\t\tvar argumentSyntaxList = GetParameterExpressionsFromArrayArgument(extraArguments, semanticModel);\n\t\tif (argumentSyntaxList is null)\n\t\t\treturn;\n\n\t\tvar dataMethodSymbol = (IMethodSymbol)memberSymbol;\n\t\tvar dataMethodParameterSymbols = dataMethodSymbol.Parameters;\n\n\t\tint valueIdx = 0, paramIdx = 0;\n\t\tfor (; valueIdx < argumentSyntaxList.Count && paramIdx < dataMethodParameterSymbols.Length; valueIdx++)\n\t\t{\n\t\t\tvar parameter = dataMethodParameterSymbols[paramIdx];\n\t\t\tvar value = semanticModel.GetConstantValue(argumentSyntaxList[valueIdx], context.CancellationToken);\n\n\t\t\t// If the parameter type is object, everything is compatible, though we still need to check for nullability\n\t\t\tif (SymbolEqualityComparer.Default.Equals(parameter.Type, compilation.ObjectType)\n\t\t\t\t&& (!value.HasValue || parameter.Type.NullableAnnotation != NullableAnnotation.NotAnnotated))\n\t\t\t{\n\t\t\t\tparamIdx++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If this is a params array (and we're using a version of xUnit.net that supports params arrays),\n\t\t\t// get the element type so we can compare it appropriately.\n\t\t\tvar paramsElementType =\n\t\t\t\txunitContext.Core.TheorySupportsParameterArrays && parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayParam\n\t\t\t\t\t? arrayParam.ElementType\n\t\t\t\t\t: null;\n\n\t\t\t// For params array of object, just consume everything that's left\n\t\t\tif (paramsElementType is not null\n\t\t\t\t&& SymbolEqualityComparer.Default.Equals(paramsElementType, compilation.ObjectType)\n\t\t\t\t&& paramsElementType.NullableAnnotation != NullableAnnotation.NotAnnotated)\n\t\t\t{\n\t\t\t\tvalueIdx = extraArguments.Count;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (value.HasValue && value.Value is null)\n\t\t\t{\n\t\t\t\tvar isValueTypeParam =\n\t\t\t\t\tparamsElementType is not null\n\t\t\t\t\t\t? paramsElementType.IsValueType && paramsElementType.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T\n\t\t\t\t\t\t: parameter.Type.IsValueType && parameter.Type.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T;\n\n\t\t\t\tvar isNonNullableReferenceTypeParam =\n\t\t\t\t\tparamsElementType is not null\n\t\t\t\t\t\t? paramsElementType.IsReferenceType && paramsElementType.NullableAnnotation == NullableAnnotation.NotAnnotated\n\t\t\t\t\t\t: parameter.Type.IsReferenceType && parameter.Type.NullableAnnotation == NullableAnnotation.NotAnnotated;\n\n\t\t\t\tif (isValueTypeParam || isNonNullableReferenceTypeParam)\n\t\t\t\t{\n\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\tbuilder[Constants.Properties.ParameterIndex] = paramIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\tbuilder[Constants.Properties.ParameterName] = parameter.Name;\n\t\t\t\t\tbuilder[Constants.Properties.MemberName] = memberName;\n\n\t\t\t\t\tReportMemberMethodParameterNullability(context, argumentSyntaxList[valueIdx], parameter, paramsElementType, builder);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar valueType = semanticModel.GetTypeInfo(argumentSyntaxList[valueIdx], context.CancellationToken).Type;\n\t\t\t\tif (valueType is null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar isCompatible = ConversionChecker.IsConvertible(compilation, valueType, parameter.Type, xunitContext);\n\t\t\t\tif (!isCompatible && paramsElementType is not null)\n\t\t\t\t\tisCompatible = ConversionChecker.IsConvertible(compilation, valueType, paramsElementType, xunitContext);\n\n\t\t\t\tif (!isCompatible)\n\t\t\t\t{\n\t\t\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\tbuilder[Constants.Properties.ParameterIndex] = paramIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\tbuilder[Constants.Properties.ParameterName] = parameter.Name;\n\t\t\t\t\tbuilder[Constants.Properties.MemberName] = memberName;\n\n\t\t\t\t\tReportMemberMethodParametersDoNotMatchArgumentTypes(context, argumentSyntaxList[valueIdx], parameter, paramsElementType, builder);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!parameter.IsParams)\n\t\t\t{\n\t\t\t\t// Stop moving paramIdx forward if the argument is a parameter array, regardless of xunit's support for it\n\t\t\t\tparamIdx++;\n\t\t\t}\n\t\t}\n\n\t\tfor (; valueIdx < argumentSyntaxList.Count; valueIdx++)\n\t\t{\n\t\t\tvar value = semanticModel.GetConstantValue(argumentSyntaxList[valueIdx], context.CancellationToken);\n\t\t\tvar valueTypeName = value.Value?.GetType().FullName;\n\t\t\tvar valueType = compilation.GetTypeByMetadataName(valueTypeName ?? \"System.Object\");\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\n\t\t\tbuilder[Constants.Properties.ParameterIndex] = valueIdx.ToString(CultureInfo.InvariantCulture);\n\t\t\tbuilder[Constants.Properties.ParameterSpecialType] = valueType?.SpecialType.ToString() ?? string.Empty;\n\t\t\tbuilder[Constants.Properties.MemberName] = memberName;\n\n\t\t\tReportTooManyArgumentsProvided(context, argumentSyntaxList[valueIdx], value.Value, builder);\n\t\t}\n\t}\n\n\tstatic bool VerifyDataSourceReturnType(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext,\n\t\tITypeSymbol memberType,\n\t\tImmutableDictionary<string, string?> memberProperties,\n\t\tAttributeSyntax attributeSyntax,\n\t\tINamedTypeSymbol? iEnumerableOfTheoryDataRowType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfTheoryDataRowType,\n\t\tINamedTypeSymbol? iEnumerableOfTupleType,\n\t\tINamedTypeSymbol? iAsyncEnumerableOfTupleType)\n\t{\n\t\tvar v3 = xunitContext.HasV3References;\n\t\tvar iEnumerableOfObjectArrayType = TypeSymbolFactory.IEnumerableOfObjectArray(compilation);\n\t\tvar iAsyncEnumerableOfObjectArrayType = TypeSymbolFactory.IAsyncEnumerableOfObjectArray(compilation);\n\n\t\tvar valid = iEnumerableOfObjectArrayType.IsAssignableFrom(memberType);\n\n\t\t// Special-case handling for IEnumerable<T> where T is not object[]. If T is any array type, it is assignable to object[] and therefore valid.\n\t\tvar memberEnumerableType = memberType.GetEnumerableType();\n\t\tif (!valid && memberEnumerableType is not null)\n\t\t\tvalid = memberEnumerableType.TypeKind == TypeKind.Array;\n\n\t\tif (!valid && v3 && iAsyncEnumerableOfObjectArrayType is not null)\n\t\t\tvalid = iAsyncEnumerableOfObjectArrayType.IsAssignableFrom(memberType);\n\n\t\tif (!valid && v3 && iEnumerableOfTheoryDataRowType is not null)\n\t\t\tvalid = iEnumerableOfTheoryDataRowType.IsAssignableFrom(memberType);\n\n\t\tif (!valid && v3 && iAsyncEnumerableOfTheoryDataRowType is not null)\n\t\t\tvalid = iAsyncEnumerableOfTheoryDataRowType.IsAssignableFrom(memberType);\n\n\t\tif (!valid && v3 && iEnumerableOfTupleType is not null)\n\t\t\tvalid = iEnumerableOfTupleType.IsAssignableFrom(memberType);\n\n\t\tif (!valid && v3 && iAsyncEnumerableOfTupleType is not null)\n\t\t\tvalid = iAsyncEnumerableOfTupleType.IsAssignableFrom(memberType);\n\n\t\t// If still invalid and the member is a class, check whether it implements IEnumerable<T> and verify that T is an array type.\n\t\t// This ensures the data can be safely converted to IEnumerable<object[]>.\n\t\tif (!valid && memberType.TypeKind == TypeKind.Class)\n\t\t{\n\t\t\tvar resolvedIEnumerableTypeArgument = FindTypeArgumentFromIEnumerable(memberType, compilation);\n\t\t\tif (resolvedIEnumerableTypeArgument is not null)\n\t\t\t\tvalid = (resolvedIEnumerableTypeArgument.TypeKind == TypeKind.Array);\n\t\t}\n\n\t\tif (!valid)\n\t\t\tReportIncorrectReturnType(\n\t\t\t\tcontext,\n\t\t\t\tiEnumerableOfObjectArrayType,\n\t\t\t\tiAsyncEnumerableOfObjectArrayType,\n\t\t\t\tiEnumerableOfTheoryDataRowType,\n\t\t\t\tiAsyncEnumerableOfTheoryDataRowType,\n\t\t\t\tiEnumerableOfTupleType,\n\t\t\t\tiAsyncEnumerableOfTupleType,\n\t\t\t\tattributeSyntax,\n\t\t\t\tmemberProperties,\n\t\t\t\tmemberType\n\t\t\t);\n\n\t\treturn valid;\n\t}\n\n\tstatic void VerifyGenericArgumentTypes(\n\t\tSemanticModel semanticModel,\n\t\tSyntaxNodeAnalysisContext context,\n\t\tMethodDeclarationSyntax testMethod,\n\t\tINamedTypeSymbol theoryDataType,\n\t\tINamedTypeSymbol theoryReturnType,\n\t\tstring memberName,\n\t\tITypeSymbol memberType,\n\t\tAttributeSyntax attributeSyntax)\n\t{\n\t\tif (memberType is not INamedTypeSymbol namedMemberType)\n\t\t\treturn;\n\n\t\tvar returnTypeArguments = theoryReturnType.TypeArguments;\n\t\tvar testMethodSymbol = semanticModel.GetDeclaredSymbol(testMethod, context.CancellationToken);\n\t\tif (testMethodSymbol is null)\n\t\t\treturn;\n\n\t\tvar testMethodParameterSymbols = testMethodSymbol.Parameters;\n\t\tvar testMethodParameterSyntaxes = testMethod.ParameterList.Parameters;\n\n\t\tif (testMethodParameterSymbols.Length > returnTypeArguments.Length\n\t\t\t&& testMethodParameterSymbols.Skip(returnTypeArguments.Length).Any(p => !p.IsOptional && !p.IsParams))\n\t\t{\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.MemberName] = memberName;\n\n\t\t\tReportMemberMethodTheoryDataTooFewTypeArguments(context, attributeSyntax.GetLocation(), builder, theoryDataType);\n\t\t\treturn;\n\t\t}\n\n\t\tint typeArgumentIdx = 0, parameterTypeIdx = 0;\n\t\tfor (; typeArgumentIdx < returnTypeArguments.Length && parameterTypeIdx < testMethodParameterSymbols.Length; typeArgumentIdx++)\n\t\t{\n\t\t\tvar parameterSyntax = testMethodParameterSyntaxes[parameterTypeIdx];\n\t\t\tif (parameterSyntax.Type is null)\n\t\t\t\tcontinue;\n\n\t\t\tvar parameter = testMethodParameterSymbols[parameterTypeIdx];\n\t\t\tif (parameter.Type is null)\n\t\t\t\tcontinue;\n\n\t\t\tvar parameterType =\n\t\t\t\tparameter.IsParams && parameter.Type is IArrayTypeSymbol paramsArraySymbol\n\t\t\t\t\t? paramsArraySymbol.ElementType\n\t\t\t\t\t: parameter.Type;\n\n\t\t\tvar typeArgument = returnTypeArguments[typeArgumentIdx];\n\t\t\tif (typeArgument is null)\n\t\t\t\tcontinue;\n\n\t\t\t// We want to map T[] and IEnumerable<T> in generic methods so long as the parameter type is itself an array.\n\t\t\t// This is a simplistic view, since at runtime multiple things competing for the same T may end up being\n\t\t\t// incompatible, but we'll leave that as an edge case that can be found at runtime, so we're not forced\n\t\t\t// to run the whole \"generic resolver\" in the context of an analyzer.\n\t\t\tvar enumerable = parameterType.UnwrapEnumerable(semanticModel.Compilation, unwrapArray: true);\n\t\t\tif (enumerable is not null && enumerable.Kind == SymbolKind.TypeParameter && typeArgument is IArrayTypeSymbol)\n\t\t\t\tcontinue;\n\n\t\t\tif (parameterType.Kind != SymbolKind.TypeParameter && !parameterType.IsAssignableFrom(typeArgument))\n\t\t\t{\n\t\t\t\tvar report = true;\n\n\t\t\t\t// The user might be providing the full array for 'params'; if they do, we need to move\n\t\t\t\t// the parameter type index forward because it's been consumed by the array\n\t\t\t\tif (parameter.IsParams && parameter.Type.IsAssignableFrom(typeArgument))\n\t\t\t\t{\n\t\t\t\t\treport = false;\n\t\t\t\t\tparameterTypeIdx++;\n\t\t\t\t}\n\n\t\t\t\tif (report)\n\t\t\t\t\tReportMemberMethodTheoryDataIncompatibleType(context, parameterSyntax.Type.GetLocation(), typeArgument, namedMemberType, memberName, parameter);\n\t\t\t}\n\n\t\t\t// Nullability of value types is handled by the type compatibility test,\n\t\t\t// but nullability of reference types isn't\n\t\t\tif (parameterType.IsReferenceType\n\t\t\t\t\t&& typeArgument.IsReferenceType\n\t\t\t\t\t&& parameterType.NullableAnnotation == NullableAnnotation.NotAnnotated\n\t\t\t\t\t&& typeArgument.NullableAnnotation == NullableAnnotation.Annotated)\n\t\t\t\tReportMemberMethodTheoryDataNullability(context, parameterSyntax.Type.GetLocation(), typeArgument, namedMemberType, memberName, parameter);\n\n\t\t\t// Only move the parameter type index forward when the current parameter is not a 'params'\n\t\t\tif (!parameter.IsParams)\n\t\t\t\tparameterTypeIdx++;\n\t\t}\n\n\t\tif (typeArgumentIdx < returnTypeArguments.Length)\n\t\t{\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.MemberName] = memberName;\n\n\t\t\tReportMemberMethodTheoryDataExtraTypeArguments(context, attributeSyntax.GetLocation(), builder, theoryDataType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/PublicMethodShouldBeMarkedAsTest.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class PublicMethodShouldBeMarkedAsTest : XunitDiagnosticAnalyzer\n{\n\tpublic PublicMethodShouldBeMarkedAsTest() :\n\t\tbase(Descriptors.X1013_PublicMethodShouldBeMarkedAsTest)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar taskType = TypeSymbolFactory.Task(context.Compilation);\n\t\tvar configuredTaskAwaitableType = TypeSymbolFactory.ConfiguredTaskAwaitable(context.Compilation);\n\t\tvar interfacesToIgnore = new List<INamedTypeSymbol?>\n\t\t{\n\t\t\tTypeSymbolFactory.IDisposable(context.Compilation),\n\t\t\tTypeSymbolFactory.IAsyncLifetime(context.Compilation),\n\t\t};\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol type)\n\t\t\t\treturn;\n\n\t\t\tvar attributeUsageType = TypeSymbolFactory.AttributeUsageAttribute(context.Compilation);\n\n\t\t\tif (type.TypeKind != TypeKind.Class ||\n\t\t\t\t\ttype.DeclaredAccessibility != Accessibility.Public ||\n\t\t\t\t\ttype.IsAbstract)\n\t\t\t\treturn;\n\n\t\t\tvar methodsToIgnore =\n\t\t\t\tinterfacesToIgnore\n\t\t\t\t\t.WhereNotNull()\n\t\t\t\t\t.Where(i => type.AllInterfaces.Contains(i))\n\t\t\t\t\t.SelectMany(i => i.GetMembers())\n\t\t\t\t\t.Select(m => type.FindImplementationForInterfaceMember(m))\n\t\t\t\t\t.Where(s => s is not null)\n\t\t\t\t\t.ToList();\n\n\t\t\tvar hasTestMethods = false;\n\t\t\tvar violations = new List<IMethodSymbol>();\n\t\t\tforeach (var member in type.GetMembers().Where(m => m.Kind == SymbolKind.Method))\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\t// Check for method.IsAbstract and earlier for type.IsAbstract is done\n\t\t\t\t// twice to enable better diagnostics during code editing. It is useful with\n\t\t\t\t// incomplete code for abstract types - missing abstract keyword on type\n\t\t\t\t// or on abstract method\n\t\t\t\tif (member is not IMethodSymbol method)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (method.MethodKind != MethodKind.Ordinary || method.IsAbstract)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar attributes = method.GetAttributesWithInheritance(attributeUsageType);\n\t\t\t\tvar isTestMethod = attributes.ContainsAttributeType(xunitContext.Core.FactAttributeType);\n\t\t\t\thasTestMethods = hasTestMethods || isTestMethod;\n\n\t\t\t\tif (isTestMethod ||\n\t\t\t\t\tattributes.Any(attribute => attribute.AttributeClass is not null && attribute.AttributeClass.GetAttributes().Any(att => att.AttributeClass?.Name.EndsWith(\"IgnoreXunitAnalyzersRule1013Attribute\", StringComparison.InvariantCulture) == true)))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (method.DeclaredAccessibility == Accessibility.Public &&\n\t\t\t\t\t(method.ReturnsVoid ||\n\t\t\t\t\t\t(taskType is not null && SymbolEqualityComparer.Default.Equals(method.ReturnType, taskType)) ||\n\t\t\t\t\t\t(configuredTaskAwaitableType is not null && SymbolEqualityComparer.Default.Equals(method.ReturnType, configuredTaskAwaitableType))))\n\t\t\t\t{\n\t\t\t\t\tvar shouldIgnore = false;\n\t\t\t\t\twhile (!shouldIgnore || method.IsOverride)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (methodsToIgnore.Any(m => SymbolEqualityComparer.Default.Equals(method, m)) || !method.ReceiverType.IsTestClass(xunitContext, strict: true))\n\t\t\t\t\t\t\tshouldIgnore = true;\n\n\t\t\t\t\t\tif (!method.IsOverride)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tif (method.OverriddenMethod is null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tshouldIgnore = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmethod = method.OverriddenMethod;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (method is not null && !shouldIgnore)\n\t\t\t\t\t\tviolations.Add(method);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasTestMethods)\n\t\t\t\tforeach (var method in violations)\n\t\t\t\t{\n\t\t\t\t\tvar testType = method.Parameters.Any() ? Constants.Attributes.Theory : Constants.Attributes.Fact;\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1013_PublicMethodShouldBeMarkedAsTest,\n\t\t\t\t\t\t\tmethod.Locations.First(),\n\t\t\t\t\t\t\tmethod.Name,\n\t\t\t\t\t\t\tmethod.ContainingType.Name,\n\t\t\t\t\t\t\ttestType\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestClassCannotBeNestedInGenericClass.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestClassCannotBeNestedInGenericClass : XunitDiagnosticAnalyzer\n{\n\tpublic TestClassCannotBeNestedInGenericClass() :\n\t\tbase(Descriptors.X1032_TestClassCannotBeNestedInGenericClass)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol classSymbol)\n\t\t\t\treturn;\n\t\t\tif (classSymbol.ContainingType is null)\n\t\t\t\treturn;\n\t\t\tif (!classSymbol.ContainingType.IsGenericType)\n\t\t\t\treturn;\n\n\t\t\tvar doesClassContainTests = DoesInheritenceTreeContainTests(classSymbol, xunitContext, depth: 3);\n\n\t\t\tif (!doesClassContainTests)\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1032_TestClassCannotBeNestedInGenericClass,\n\t\t\t\t\tclassSymbol.Locations.First()\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n\n\tstatic bool DoesInheritenceTreeContainTests(\n\t\tINamedTypeSymbol classSymbol,\n\t\tXunitContext xunitContext,\n\t\tint depth)\n\t{\n\t\tvar doesClassContainTests =\n\t\t\tclassSymbol\n\t\t\t\t.GetMembers()\n\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t.Any(m => m.GetAttributes().Any(a => xunitContext.Core.FactAttributeType.IsAssignableFrom(a.AttributeClass)));\n\n\t\tif (!doesClassContainTests && classSymbol.BaseType is not null && depth > 0)\n\t\t\treturn DoesInheritenceTreeContainTests(classSymbol.BaseType, xunitContext, depth - 1);\n\n\t\treturn doesClassContainTests;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestClassMustBePublic.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestClassMustBePublic : XunitDiagnosticAnalyzer\n{\n\tpublic TestClassMustBePublic() :\n\t\tbase(Descriptors.X1000_TestClassMustBePublic)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol classSymbol)\n\t\t\t\treturn;\n\n\t\t\tvar doesClassContainTests =\n\t\t\t\tclassSymbol\n\t\t\t\t\t.GetMembers()\n\t\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t\t.Any(m => m.GetAttributes().Any(a => xunitContext.Core.FactAttributeType.IsAssignableFrom(a.AttributeClass)));\n\n\t\t\tif (!doesClassContainTests)\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1000_TestClassMustBePublic,\n\t\t\t\t\tclassSymbol.Locations.First(),\n\t\t\t\t\tclassSymbol.Locations.Skip(1),\n\t\t\t\t\tclassSymbol.Name\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestClassShouldHaveTFixtureArgument.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestClassShouldHaveTFixtureArgument : XunitDiagnosticAnalyzer\n{\n\tpublic TestClassShouldHaveTFixtureArgument() :\n\t\tbase(Descriptors.X1033_TestClassShouldHaveTFixtureArgument)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.IClassFixtureType is null || xunitContext.Core.ICollectionFixtureType is null)\n\t\t\t\treturn;\n\n\t\t\tif (context.Symbol.DeclaredAccessibility != Accessibility.Public)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol classSymbol)\n\t\t\t\treturn;\n\n\t\t\tvar doesClassContainTests =\n\t\t\t\tclassSymbol\n\t\t\t\t\t.GetMembers()\n\t\t\t\t\t.OfType<IMethodSymbol>()\n\t\t\t\t\t.Any(m => m.GetAttributes().Any(a => xunitContext.Core.FactAttributeType.IsAssignableFrom(a.AttributeClass)));\n\n\t\t\tif (!doesClassContainTests)\n\t\t\t\treturn;\n\n\t\t\tforeach (var interfaceOnTestClass in classSymbol.AllInterfaces)\n\t\t\t{\n\t\t\t\tvar isFixtureInterface =\n\t\t\t\t\tinterfaceOnTestClass.OriginalDefinition.IsAssignableFrom(xunitContext.Core.IClassFixtureType)\n\t\t\t\t\t|| interfaceOnTestClass.OriginalDefinition.IsAssignableFrom(xunitContext.Core.ICollectionFixtureType);\n\n\t\t\t\tif (isFixtureInterface && interfaceOnTestClass.TypeArguments[0] is INamedTypeSymbol tFixtureDataType)\n\t\t\t\t{\n\t\t\t\t\tvar hasConstructorWithTFixtureArg = classSymbol\n\t\t\t\t\t\t.Constructors\n\t\t\t\t\t\t.Any(x => x.Parameters.Length > 0 && x.Parameters.Any(p => SymbolEqualityComparer.Default.Equals(p.Type, tFixtureDataType)));\n\n\t\t\t\t\tif (hasConstructorWithTFixtureArg)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar propertiesBuilder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\t\t\tpropertiesBuilder.Add(Constants.Properties.TFixtureDisplayName, tFixtureDataType.ToDisplayString());\n\t\t\t\t\tpropertiesBuilder.Add(Constants.Properties.TFixtureName, tFixtureDataType.Name);\n\t\t\t\t\tpropertiesBuilder.Add(Constants.Properties.TestClassName, classSymbol.Name);\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1033_TestClassShouldHaveTFixtureArgument,\n\t\t\t\t\t\t\tlocation: classSymbol.Locations.First(),\n\t\t\t\t\t\t\tproperties: propertiesBuilder.ToImmutable(),\n\t\t\t\t\t\t\tclassSymbol.ToDisplayString(),\n\t\t\t\t\t\t\ttFixtureDataType.ToDisplayString()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestMethodCannotHaveOverloads.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestMethodCannotHaveOverloads : XunitDiagnosticAnalyzer\n{\n\tpublic TestMethodCannotHaveOverloads() :\n\t\tbase(Descriptors.X1024_TestMethodCannotHaveOverloads)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not INamedTypeSymbol typeSymbol)\n\t\t\t\treturn;\n\t\t\tif (typeSymbol.TypeKind != TypeKind.Class)\n\t\t\t\treturn;\n\n\t\t\tvar methodsByName =\n\t\t\t\ttypeSymbol\n\t\t\t\t\t.GetInheritedAndOwnMembers()\n\t\t\t\t\t.Where(s => s.Kind == SymbolKind.Method)\n\t\t\t\t\t.Cast<IMethodSymbol>()\n\t\t\t\t\t.Where(m => m.MethodKind == MethodKind.Ordinary)\n\t\t\t\t\t.GroupBy(m => m.Name);\n\n\t\t\tforeach (var grouping in methodsByName)\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tvar methods = grouping.ToList();\n\t\t\t\tvar methodName = grouping.Key;\n\t\t\t\tif (methods.Count == 1 || !methods.Any(m => m.GetAttributes().ContainsAttributeType(xunitContext.Core.FactAttributeType)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar methodsWithoutOverloads = new List<IMethodSymbol>(methods.Count);\n\t\t\t\tforeach (var method in methods)\n\t\t\t\t\tif (!methods.Any(m => m.IsOverride && SymbolEqualityComparer.Default.Equals(m.OverriddenMethod, method)))\n\t\t\t\t\t\tmethodsWithoutOverloads.Add(method);\n\n\t\t\t\tif (methodsWithoutOverloads.Count == 1)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tforeach (var method in methodsWithoutOverloads.Where(m => SymbolEqualityComparer.Default.Equals(m.ContainingType, typeSymbol)))\n\t\t\t\t{\n\t\t\t\t\tvar otherType =\n\t\t\t\t\t\tmethodsWithoutOverloads\n\t\t\t\t\t\t\t.Where(m => !SymbolEqualityComparer.Default.Equals(m, method))\n\t\t\t\t\t\t\t.OrderBy(m => m.ContainingType, TypeHierarchyComparer.Instance)\n\t\t\t\t\t\t\t.First()\n\t\t\t\t\t\t\t.ContainingType;\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1024_TestMethodCannotHaveOverloads,\n\t\t\t\t\t\t\tmethod.Locations.First(),\n\t\t\t\t\t\t\tmethodName,\n\t\t\t\t\t\t\tmethod.ContainingType.ToDisplayString(),\n\t\t\t\t\t\t\totherType.ToDisplayString()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SymbolKind.NamedType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestMethodMustNotHaveMultipleFactAttributes.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestMethodMustNotHaveMultipleFactAttributes : XunitDiagnosticAnalyzer\n{\n\tpublic TestMethodMustNotHaveMultipleFactAttributes() :\n\t\tbase(Descriptors.X1002_TestMethodMustNotHaveMultipleFactAttributes)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not IMethodSymbol symbol)\n\t\t\t\treturn;\n\n\t\t\tvar attributeTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);\n\n\t\t\tvar count = 0;\n\n\t\t\tforeach (var attribute in symbol.GetAttributes())\n\t\t\t{\n\t\t\t\tvar attributeType = attribute.AttributeClass;\n\t\t\t\tif (attributeType is not null && xunitContext.Core.FactAttributeType.IsAssignableFrom(attributeType))\n\t\t\t\t{\n\t\t\t\t\tattributeTypes.Add(attributeType);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count > 1)\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1002_TestMethodMustNotHaveMultipleFactAttributes,\n\t\t\t\t\t\tsymbol.Locations.First(),\n\t\t\t\t\t\tproperties: attributeTypes.ToImmutableDictionary(t => t.ToDisplayString(), t => (string?)string.Empty)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestMethodShouldNotBeSkipped.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestMethodShouldNotBeSkipped : XunitDiagnosticAnalyzer\n{\n\tpublic TestMethodShouldNotBeSkipped() :\n\t\tbase(Descriptors.X1004_TestMethodShouldNotBeSkipped)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.FactAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Node is not AttributeSyntax attribute)\n\t\t\t\treturn;\n\t\t\tif (attribute.ArgumentList is null)\n\t\t\t\treturn;\n\n\t\t\tvar skipArgument = default(AttributeArgumentSyntax);\n\t\t\tforeach (var argument in attribute.ArgumentList.Arguments)\n\t\t\t{\n\t\t\t\tvar valueText = argument.NameEquals?.Name?.Identifier.ValueText;\n\n\t\t\t\tif (valueText == \"SkipWhen\" || valueText == \"SkipUnless\")\n\t\t\t\t\treturn;\n\n\t\t\t\tif (valueText == \"Skip\")\n\t\t\t\t\tskipArgument = argument;\n\t\t\t}\n\n\t\t\tif (skipArgument is null)\n\t\t\t\treturn;\n\n\t\t\tvar attributeType = context.SemanticModel.GetTypeInfo(attribute).Type;\n\t\t\tif (!xunitContext.Core.FactAttributeType.IsAssignableFrom(attributeType))\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1004_TestMethodShouldNotBeSkipped,\n\t\t\t\t\tskipArgument.GetLocation()\n\t\t\t\t)\n\t\t\t);\n\t\t}, SyntaxKind.Attribute);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TestMethodSupportedReturnType.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TestMethodSupportedReturnType : XunitDiagnosticAnalyzer\n{\n\tpublic TestMethodSupportedReturnType() :\n\t\tbase(Descriptors.X1028_TestMethodHasInvalidReturnType)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (xunitContext.Core.FactAttributeType is null || xunitContext.Core.TheoryAttributeType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\t\t\tif (!method.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(xunitContext.Core.FactAttributeType, a.AttributeClass) || SymbolEqualityComparer.Default.Equals(xunitContext.Core.TheoryAttributeType, a.AttributeClass)))\n\t\t\t\treturn;\n\n\t\t\tvar validReturnTypes = GetValidReturnTypes(context.Compilation, xunitContext);\n\t\t\tif (validReturnTypes.Any(t => SymbolEqualityComparer.Default.Equals(method.ReturnType, t)))\n\t\t\t\treturn;\n\n\t\t\tvar validReturnTypeDisplayNames =\n\t\t\t\tvalidReturnTypes.Select(\n\t\t\t\t\tt => SymbolDisplay.ToDisplayString(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t\t)\n\t\t\t\t).ToArray();\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X1028_TestMethodHasInvalidReturnType,\n\t\t\t\t\tmethod.Locations.FirstOrDefault(),\n\t\t\t\t\t[string.Join(\", \", validReturnTypeDisplayNames)]\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n\n\tpublic static List<INamedTypeSymbol> GetValidReturnTypes(\n\t\tCompilation compilation,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(compilation);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar result = new List<INamedTypeSymbol>();\n\n\t\tvoid Add(INamedTypeSymbol? symbol)\n\t\t{\n\t\t\tif (symbol is not null)\n\t\t\t\tresult!.Add(symbol);\n\t\t}\n\n\t\tAdd(TypeSymbolFactory.Void(compilation));\n\t\tAdd(TypeSymbolFactory.Task(compilation));\n\n\t\tif (xunitContext.HasV3References)\n\t\t\tAdd(TypeSymbolFactory.ValueTask(compilation));\n\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryDataRowArgumentsShouldBeSerializable.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryDataRowArgumentsShouldBeSerializable : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryDataRowArgumentsShouldBeSerializable() :\n\t\tbase(\n\t\t\tDescriptors.X1046_AvoidUsingTheoryDataRowArgumentsThatAreNotSerializable,\n\t\t\tDescriptors.X1047_AvoidUsingTheoryDataRowArgumentsThatMightNotBeSerializable\n\t\t)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar theoryDataRowTypes = TypeSymbolFactory.TheoryDataRow_ByGenericArgumentCount_V3(context.Compilation);\n\t\tif (theoryDataRowTypes.Count == 0)\n\t\t\treturn;\n\n\t\tif (SerializableTypeSymbols.Create(context.Compilation, xunitContext) is not SerializableTypeSymbols typeSymbols)\n\t\t\treturn;\n\n\t\tvar analyzer = new SerializabilityAnalyzer(typeSymbols);\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IObjectCreationOperation objectCreation)\n\t\t\t\treturn;\n\n\t\t\tvar creationType = objectCreation.Type as INamedTypeSymbol;\n\t\t\tif (creationType is not null && creationType.IsGenericType)\n\t\t\t\tcreationType = creationType.OriginalDefinition;\n\n\t\t\tif (!theoryDataRowTypes.Values.Contains(creationType, SymbolEqualityComparer.Default))\n\t\t\t\treturn;\n\n\t\t\tvar argumentOperations = GetConstructorArguments(objectCreation);\n\t\t\tif (argumentOperations is null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var argumentOperation in argumentOperations)\n\t\t\t{\n\t\t\t\tif (analyzer.TypeShouldBeIgnored(argumentOperation.Type))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar serializability = analyzer.AnalayzeSerializability(argumentOperation.Type, xunitContext);\n\n\t\t\t\tif (serializability != Serializability.AlwaysSerializable)\n\t\t\t\t{\n\t\t\t\t\tvar typeDisplayName =\n\t\t\t\t\t\targumentOperation.SemanticModel is null\n\t\t\t\t\t\t\t? argumentOperation.Type.Name\n\t\t\t\t\t\t\t: argumentOperation.Type.ToMinimalDisplayString(argumentOperation.SemanticModel, argumentOperation.Syntax.SpanStart);\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tserializability == Serializability.NeverSerializable\n\t\t\t\t\t\t\t\t? Descriptors.X1046_AvoidUsingTheoryDataRowArgumentsThatAreNotSerializable\n\t\t\t\t\t\t\t\t: Descriptors.X1047_AvoidUsingTheoryDataRowArgumentsThatMightNotBeSerializable,\n\t\t\t\t\t\t\targumentOperation.Syntax.GetLocation(),\n\t\t\t\t\t\t\targumentOperation.Syntax.ToFullString(),\n\t\t\t\t\t\t\ttypeDisplayName\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}, OperationKind.ObjectCreation);\n\t}\n\n\tstatic IReadOnlyList<IOperation>? GetConstructorArguments(IObjectCreationOperation objectCreation)\n\t{\n\t\t// If this is the generic TheoryDataRow, then just return the arguments as-is\n\t\tif (objectCreation.Type is INamedTypeSymbol creationType && creationType.IsGenericType)\n\t\t{\n\t\t\tvar result = new List<IOperation>();\n\n\t\t\tfor (var idx = 0; idx < objectCreation.Arguments.Length; ++idx)\n\t\t\t{\n#if ROSLYN_LATEST\n\t\t\t\tvar elementValue = objectCreation.Arguments[idx].ChildOperations.FirstOrDefault();\n#else\n\t\t\t\tvar elementValue = objectCreation.Arguments[idx].Children.FirstOrDefault();\n#endif\n\t\t\t\twhile (elementValue is IConversionOperation conversion)\n\t\t\t\t\telementValue = conversion.Operand;\n\n\t\t\t\tif (elementValue is not null)\n\t\t\t\t\tresult.Add(elementValue);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t// Non-generic TheoryDataRow, which means we should have a single argument\n\t\t// which is the params array of values, which we need to unpack.\n\t\tif (objectCreation.Arguments.FirstOrDefault() is not IArgumentOperation argumentOperation)\n\t\t\treturn null;\n\n#if ROSLYN_LATEST\n\t\tvar firstArgument = argumentOperation.ChildOperations.FirstOrDefault();\n#else\n\t\tvar firstArgument = argumentOperation.Children.FirstOrDefault();\n#endif\n\t\tif (firstArgument is null)\n\t\t\treturn null;\n\n\t\t// Common pattern: implicit array creation for the params array\n\t\tif (firstArgument is IArrayCreationOperation arrayCreation &&\n#if ROSLYN_LATEST\n\t\t\tarrayCreation.ChildOperations.Skip(1).FirstOrDefault() is IArrayInitializerOperation arrayInitializer)\n#else\n\t\t\tarrayCreation.Children.Skip(1).FirstOrDefault() is IArrayInitializerOperation arrayInitializer)\n#endif\n\t\t{\n\t\t\tvar result = new List<IOperation>();\n\n\t\t\tfor (var idx = 0; idx < arrayInitializer.ElementValues.Length; ++idx)\n\t\t\t{\n\t\t\t\tvar elementValue = arrayInitializer.ElementValues[idx];\n\t\t\t\twhile (elementValue is IConversionOperation conversion)\n\t\t\t\t\telementValue = conversion.Operand;\n\n\t\t\t\tresult.Add(elementValue);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t// TODO: Less common pattern: user created the array ahead of time, which shows up as ILocalReferenceOperation\n\n\t\treturn null;\n\t}\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV3References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryDataShouldNotUseTheoryDataRow.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryDataShouldNotUseTheoryDataRow() :\n\tXunitV3DiagnosticAnalyzer(Descriptors.X1052_TheoryDataShouldNotUseITheoryDataRow)\n{\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar iTheoryDataRowSymbol = TypeSymbolFactory.ITheoryDataRow_V3(context.Compilation);\n\t\tif (iTheoryDataRowSymbol is null)\n\t\t\treturn;\n\n\t\tvar theoryDataTypes = TypeSymbolFactory.TheoryData_ByGenericArgumentCount(context.Compilation);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tvar genericName = (GenericNameSyntax)context.Node;\n\n\t\t\tif (context.SemanticModel.GetSymbolInfo(genericName).Symbol is not INamedTypeSymbol typeSymbol)\n\t\t\t\treturn;\n\n\t\t\tif (!theoryDataTypes.TryGetValue(typeSymbol.TypeArguments.Length, out var expectedSymbol))\n\t\t\t\treturn;\n\n\t\t\tif (!SymbolEqualityComparer.Default.Equals(expectedSymbol, typeSymbol.OriginalDefinition))\n\t\t\t\treturn;\n\n\t\t\tforeach (var typeArg in typeSymbol.TypeArguments)\n\t\t\t\tif (IsOrImplementsITheoryDataRow(typeArg, iTheoryDataRowSymbol))\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1052_TheoryDataShouldNotUseITheoryDataRow,\n\t\t\t\t\t\t\tgenericName.GetLocation()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t}, SyntaxKind.GenericName);\n\t}\n\n\tstatic bool IsOrImplementsITheoryDataRow(\n\t\tITypeSymbol typeArg,\n\t\tINamedTypeSymbol iTheoryDataSymbol)\n\t{\n\t\tif (SymbolEqualityComparer.Default.Equals(typeArg, iTheoryDataSymbol) ||\n\t\t\t\ttypeArg.AllInterfaces.Any(i => SymbolEqualityComparer.Default.Equals(i, iTheoryDataSymbol)))\n\t\t\treturn true;\n\n\t\tif (typeArg is ITypeParameterSymbol typeParameter)\n\t\t\tforeach (var constraint in typeParameter.ConstraintTypes)\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(constraint, iTheoryDataSymbol) ||\n\t\t\t\t\t\tconstraint.AllInterfaces.Any(i => SymbolEqualityComparer.Default.Equals(i, iTheoryDataSymbol)))\n\t\t\t\t\treturn true;\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryDataTypeArgumentsShouldBeSerializable.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryDataTypeArgumentsShouldBeSerializable : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryDataTypeArgumentsShouldBeSerializable() :\n\t\tbase(\n\t\t\tDescriptors.X1044_AvoidUsingTheoryDataTypeArgumentsThatAreNotSerializable,\n\t\t\tDescriptors.X1045_AvoidUsingTheoryDataTypeArgumentsThatMightNotBeSerializable\n\t\t)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tif (SerializableTypeSymbols.Create(context.Compilation, xunitContext) is not SerializableTypeSymbols typeSymbols)\n\t\t\treturn;\n\n\t\tvar finder = new TheoryDataTypeArgumentFinder(typeSymbols);\n\t\tvar analyzer = new SerializabilityAnalyzer(typeSymbols);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tvar semanticModel = context.SemanticModel;\n\t\t\tvar cancellationToken = context.CancellationToken;\n\n\t\t\tif (context.Node is not MethodDeclarationSyntax methodSyntax)\n\t\t\t\treturn;\n\t\t\tif (semanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol method)\n\t\t\t\treturn;\n\t\t\tif (method.ContainingType is not INamedTypeSymbol testClass)\n\t\t\t\treturn;\n\t\t\tif (!method.GetAttributes().ContainsAttributeType(typeSymbols.TheoryAttribute))\n\t\t\t\treturn;\n\t\t\tif (DiscoveryEnumerationIsDisabled(method, typeSymbols))\n\t\t\t\treturn;\n\n\t\t\tvar dataAttributes =\n\t\t\t\tmethodSyntax\n\t\t\t\t\t.AttributeLists\n\t\t\t\t\t.SelectMany(list => list.Attributes)\n\t\t\t\t\t.Zip(method.GetAttributes(), (attributeSyntax, attribute) => (attributeSyntax, attribute))\n\t\t\t\t\t.Where((tuple) => tuple.attribute.IsInstanceOf(typeSymbols.DataAttribute));\n\n\t\t\tforeach ((var dataAttributeSyntax, var dataAttribute) in dataAttributes)\n\t\t\t{\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tvar types = finder.FindTypeArguments(dataAttribute, testClass);\n\n\t\t\t\tforeach (var type in types)\n\t\t\t\t{\n\t\t\t\t\tif (analyzer.TypeShouldBeIgnored(type))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar serializability = analyzer.AnalayzeSerializability(type, xunitContext);\n\n\t\t\t\t\tif (serializability != Serializability.AlwaysSerializable)\n\t\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\t\tserializability == Serializability.NeverSerializable\n\t\t\t\t\t\t\t\t\t? Descriptors.X1044_AvoidUsingTheoryDataTypeArgumentsThatAreNotSerializable\n\t\t\t\t\t\t\t\t\t: Descriptors.X1045_AvoidUsingTheoryDataTypeArgumentsThatMightNotBeSerializable,\n\t\t\t\t\t\t\t\tdataAttributeSyntax.GetLocation(),\n\t\t\t\t\t\t\t\ttype.ToMinimalDisplayString(semanticModel, dataAttributeSyntax.SpanStart)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SyntaxKind.MethodDeclaration);\n\t}\n\n\tstatic bool AttributeIsTheoryOrDataAttribute(AttributeData attribute, SerializableTypeSymbols typeSymbols) =>\n\t\tattribute.IsInstanceOf(typeSymbols.TheoryAttribute, exactMatch: true) || attribute.IsInstanceOf(typeSymbols.DataAttribute);\n\n\tstatic bool DiscoveryEnumerationIsDisabled(IMethodSymbol method, SerializableTypeSymbols typeSymbols) =>\n\t\tmethod\n\t\t\t.GetAttributes()\n\t\t\t.Where(attribute => AttributeIsTheoryOrDataAttribute(attribute, typeSymbols))\n\t\t\t.SelectMany(attribute => attribute.NamedArguments)\n\t\t\t.Any(argument => argument.Key == \"DisableDiscoveryEnumeration\" && argument.Value.Value is true);\n\n\tsealed class TheoryDataTypeArgumentFinder(SerializableTypeSymbols typeSymbols)\n\t{\n\t\tconst string MemberType = nameof(MemberType);\n\n\t\t/// <summary>\n\t\t/// Find all TheoryData type arguments for a data source referenced by the given data attribute\n\t\t/// in the given test class, if applicable. If the data source's type is not compatible with\n\t\t/// a generic TheoryData class, such as if it is a member with the type <see cref=\"IEnumerable{T}\"/>\n\t\t/// of <see cref=\"object\"/>[], then no type arguments will be found.\n\t\t/// </summary>\n\t\tpublic IEnumerable<ITypeSymbol> FindTypeArguments(\n\t\t\tAttributeData dataAttribute,\n\t\t\tINamedTypeSymbol testClass) =>\n\t\t\t\tGetDataSourceType(dataAttribute, testClass) is INamedTypeSymbol type\n\t\t\t\t\t? GetTheoryDataTypeArguments(type)\n\t\t\t\t\t: [];\n\n\t\tstatic IMethodSymbol? GetCompatibleMethod(\n\t\t\tITypeSymbol type,\n\t\t\tstring name,\n\t\t\tImmutableArray<TypedConstant> arguments)\n\t\t{\n\t\t\tforeach (var currentType in GetTypesForMemberResolution(type, includeInterfaces: true))\n\t\t\t{\n\t\t\t\tvar methods =\n\t\t\t\t\tcurrentType\n\t\t\t\t\t\t.GetMembers(name)\n\t\t\t\t\t\t.Where(member => member.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\t\t\t.Select(member => member as IMethodSymbol)\n\t\t\t\t\t\t.WhereNotNull()\n\t\t\t\t\t\t.Where(method => ParameterTypesAreCompatible(method.Parameters, arguments))\n\t\t\t\t\t\t.ToArray();\n\n\t\t\t\tif (methods.Length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (methods.Length == 1)\n\t\t\t\t\treturn methods[0];\n\n\t\t\t\treturn methods.Where(method => method.Parameters.Length == arguments.Length).FirstOrDefault();\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tINamedTypeSymbol? GetDataSourceType(\n\t\t\tAttributeData dataAttribute,\n\t\t\tINamedTypeSymbol testClass)\n\t\t{\n\t\t\tif (dataAttribute.IsInstanceOf(typeSymbols.ClassDataAttribute, exactMatch: true))\n\t\t\t\treturn dataAttribute.ConstructorArguments.FirstOrDefault().Value as INamedTypeSymbol;\n\n\t\t\tif (dataAttribute.IsInstanceOf(typeSymbols.MemberDataAttribute, exactMatch: true))\n\t\t\t\treturn GetMemberType(dataAttribute, testClass) as INamedTypeSymbol;\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.GetFieldAccessor.\n\t\t/// </remarks>\n\t\tstatic IFieldSymbol? GetField(\n\t\t\tITypeSymbol type,\n\t\t\tstring name)\n\t\t{\n\t\t\tvar field = GetPublicMember<IFieldSymbol>(type, name, includeInterfaces: false);\n\n\t\t\tif (field is not null && field.IsStatic)\n\t\t\t\treturn field;\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic ITypeSymbol? GetMemberContainingType(AttributeData memberDataAttribute) =>\n\t\t\tmemberDataAttribute\n\t\t\t\t.NamedArguments\n\t\t\t\t.Where(namedArgument => namedArgument.Key == MemberType)\n\t\t\t\t.Select(namedArgument => namedArgument.Value.Type)\n\t\t\t\t.WhereNotNull()\n\t\t\t\t.FirstOrDefault();\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.GetData.\n\t\t/// </remarks>\n\t\tstatic ITypeSymbol? GetMemberType(\n\t\t\tAttributeData memberDataAttribute,\n\t\t\tINamedTypeSymbol testClass)\n\t\t{\n\t\t\tvar name = memberDataAttribute.ConstructorArguments.FirstOrDefault();\n\n\t\t\tif (name.Value is string memberName)\n\t\t\t{\n\t\t\t\tvar containingType = GetMemberContainingType(memberDataAttribute) ?? testClass;\n\n\t\t\t\tvar member =\n\t\t\t\t\tGetProperty(containingType, memberName)\n\t\t\t\t\t\t?? GetField(containingType, memberName)\n\t\t\t\t\t\t?? GetMethod(containingType, memberName, memberDataAttribute) as ISymbol;\n\n\t\t\t\treturn GetMemberType(member);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic ITypeSymbol? GetMemberType(ISymbol? member) =>\n\t\t\tmember switch\n\t\t\t{\n\t\t\t\tIPropertySymbol property => property.Type,\n\t\t\t\tIFieldSymbol field => field.Type,\n\t\t\t\tIMethodSymbol method when !method.ReturnsVoid => method.ReturnType,\n\t\t\t\t_ => null,\n\t\t\t};\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.GetMethodAccessor.\n\t\t/// </remarks>\n\t\tstatic IMethodSymbol? GetMethod(\n\t\t\tITypeSymbol type,\n\t\t\tstring name,\n\t\t\tAttributeData memberDataAttribute)\n\t\t{\n\t\t\tvar arguments =\n\t\t\t\tmemberDataAttribute.ConstructorArguments.Length > 1\n\t\t\t\t\t? memberDataAttribute.ConstructorArguments[1].Values\n\t\t\t\t\t: ImmutableArray<TypedConstant>.Empty;\n\t\t\tvar method = GetCompatibleMethod(type, name, arguments);\n\n\t\t\tif (method is not null && method.IsStatic)\n\t\t\t\treturn method;\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.GetPropertyAccessor.\n\t\t/// </remarks>\n\t\tstatic IPropertySymbol? GetProperty(\n\t\t\tITypeSymbol type,\n\t\t\tstring name)\n\t\t{\n\t\t\tvar property = GetPublicMember<IPropertySymbol>(type, name, includeInterfaces: true);\n\n\t\t\tif (property is not null && property.GetMethod is not null && property.GetMethod.IsStatic)\n\t\t\t\treturn property;\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic TSymbol? GetPublicMember<TSymbol>(\n\t\t\tITypeSymbol type,\n\t\t\tstring name,\n\t\t\tbool includeInterfaces)\n\t\t\twhere TSymbol : class, ISymbol\n\t\t{\n\t\t\tforeach (var currentType in GetTypesForMemberResolution(type, includeInterfaces))\n\t\t\t{\n\t\t\t\tvar member =\n\t\t\t\t\tcurrentType\n\t\t\t\t\t\t.GetMembers(name)\n\t\t\t\t\t\t.Where(member => member.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\t\t\t.Select(member => member as TSymbol)\n\t\t\t\t\t\t.WhereNotNull()\n\t\t\t\t\t\t.FirstOrDefault();\n\n\t\t\t\tif (member is not null)\n\t\t\t\t\treturn member;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<ITypeSymbol> GetTheoryDataTypeArguments(INamedTypeSymbol type)\n\t\t{\n\t\t\tif (type.TypeKind != TypeKind.Class || type.SpecialType != SpecialType.None)\n\t\t\t\treturn [];\n\n\t\t\tif (typeSymbols.TheoryDataBaseType is not INamedTypeSymbol theoryDataBaseType)\n\t\t\t\treturn [];\n\n\t\t\t// For v2 and early versions of v3, the base type is \"TheoryData\" (non-generic).\n\t\t\t// For later versions of v3, it's \"TheoryDataBase<TTheoryDataRow, TRawDataRow>\".\n\t\t\t// We need to compare unbound to unbound when the type is generic.\n\t\t\tif (theoryDataBaseType.IsGenericType)\n\t\t\t\ttheoryDataBaseType = theoryDataBaseType.ConstructUnboundGenericType();\n\n\t\t\tfor (var currentType = type; currentType is not null; currentType = currentType.BaseType)\n\t\t\t{\n\t\t\t\tvar baseType = currentType.BaseType;\n\t\t\t\tif (baseType?.IsGenericType == true)\n\t\t\t\t\tbaseType = baseType.ConstructUnboundGenericType();\n\n\t\t\t\tif (theoryDataBaseType.Equals(baseType, SymbolEqualityComparer.Default))\n\t\t\t\t{\n\t\t\t\t\tvar theoryDataType = typeSymbols.TheoryData(currentType.Arity);\n\t\t\t\t\tif (currentType.ConstructedFrom.Equals(theoryDataType, SymbolEqualityComparer.Default))\n\t\t\t\t\t\treturn currentType.TypeArguments;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn [];\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.GetTypesForMemberResolution.\n\t\t/// </remarks>\n\t\tstatic IEnumerable<ITypeSymbol> GetTypesForMemberResolution(\n\t\t\tITypeSymbol type,\n\t\t\tbool includeInterfaces)\n\t\t{\n\t\t\tfor (var currentType = type; currentType is not null; currentType = currentType.BaseType)\n\t\t\t\tyield return currentType;\n\n\t\t\tif (includeInterfaces)\n\t\t\t\tforeach (var @interface in type.AllInterfaces)\n\t\t\t\t\tyield return @interface;\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// The logic in this method corresponds to the logic in MemberDataAttributeBase.ParameterTypesCompatible.\n\t\t/// </remarks>\n\t\tstatic bool ParameterTypesAreCompatible(\n\t\t\tImmutableArray<IParameterSymbol> parameters,\n\t\t\tImmutableArray<TypedConstant> arguments)\n\t\t{\n\t\t\tif (parameters.Length < arguments.Length)\n\t\t\t\treturn false;\n\n\t\t\tvar i = 0;\n\t\t\tfor (; i < arguments.Length; i++)\n\t\t\t\tif (arguments[i].Type is ITypeSymbol argumentType && !parameters[i].Type.IsAssignableFrom(argumentType))\n\t\t\t\t\treturn false;\n\n\t\t\tfor (; i < parameters.Length; i++)\n\t\t\t\tif (!parameters[i].IsOptional)\n\t\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryMethodCannotHaveDefaultParameter.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryMethodCannotHaveDefaultParameter : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryMethodCannotHaveDefaultParameter() :\n\t\tbase(Descriptors.X1023_TheoryMethodCannotHaveDefaultParameter)\n\t{ }\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\treturn base.ShouldAnalyze(xunitContext) && !xunitContext.Core.TheorySupportsDefaultParameterValues;\n\t}\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.TheoryAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = method.GetAttributes();\n\t\t\tif (!attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\treturn;\n\n\t\t\tforeach (var parameter in method.Parameters)\n\t\t\t{\n\t\t\t\tcontext.CancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tif (parameter.HasExplicitDefaultValue)\n\t\t\t\t{\n\t\t\t\t\tvar syntaxNode =\n\t\t\t\t\t\tparameter\n\t\t\t\t\t\t\t.DeclaringSyntaxReferences\n\t\t\t\t\t\t\t.First()\n\t\t\t\t\t\t\t.GetSyntax(context.CancellationToken)\n\t\t\t\t\t\t\t.FirstAncestorOrSelf<ParameterSyntax>();\n\n\t\t\t\t\tif (syntaxNode is null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X1023_TheoryMethodCannotHaveDefaultParameter,\n\t\t\t\t\t\t\tsyntaxNode.Default?.GetLocation(),\n\t\t\t\t\t\t\tmethod.Name,\n\t\t\t\t\t\t\tmethod.ContainingType.ToDisplayString(),\n\t\t\t\t\t\t\tparameter.Name\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryMethodCannotHaveParamsArray.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryMethodCannotHaveParamsArray : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryMethodCannotHaveParamsArray() :\n\t\tbase(Descriptors.X1022_TheoryMethodCannotHaveParameterArray)\n\t{ }\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\treturn base.ShouldAnalyze(xunitContext) && !xunitContext.Core.TheorySupportsParameterArrays;\n\t}\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.TheoryAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not IMethodSymbol method)\n\t\t\t\treturn;\n\n\t\t\tvar parameter = method.Parameters.LastOrDefault();\n\t\t\tif (!(parameter?.IsParams ?? false))\n\t\t\t\treturn;\n\n\t\t\tvar attributes = method.GetAttributes();\n\t\t\tif (attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1022_TheoryMethodCannotHaveParameterArray,\n\t\t\t\t\t\tparameter.DeclaringSyntaxReferences.First().GetSyntax(context.CancellationToken).GetLocation(),\n\t\t\t\t\t\tmethod.Name,\n\t\t\t\t\t\tmethod.ContainingType.ToDisplayString(),\n\t\t\t\t\t\tparameter.Name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryMethodMustHaveTestData.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryMethodMustHaveTestData : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryMethodMustHaveTestData() :\n\t\tbase(Descriptors.X1003_TheoryMethodMustHaveTestData)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.TheoryAttributeType is null || xunitContext.Core.DataAttributeType is null)\n\t\t\t\treturn;\n\n\t\t\tif (context.Symbol is not IMethodSymbol symbol)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = symbol.GetAttributes();\n\t\t\tif (!attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\treturn;\n\n\t\t\tvar hasData = attributes.ContainsAttributeType(xunitContext.Core.DataAttributeType);\n\t\t\tif (!hasData && xunitContext.V3Core?.IDataAttributeType is not null)\n\t\t\t\thasData = attributes.ContainsAttributeType(xunitContext.V3Core.IDataAttributeType);\n\n\t\t\tif (!hasData)\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1003_TheoryMethodMustHaveTestData,\n\t\t\t\t\t\tsymbol.Locations.First()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryMethodShouldHaveParameters.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryMethodShouldHaveParameters : XunitDiagnosticAnalyzer\n{\n\tpublic TheoryMethodShouldHaveParameters() :\n\t\tbase(Descriptors.X1006_TheoryMethodShouldHaveParameters)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.TheoryAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Symbol is not IMethodSymbol symbol)\n\t\t\t\treturn;\n\t\t\tif (symbol.Parameters.Length > 0)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = symbol.GetAttributes();\n\t\t\tif (attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1006_TheoryMethodShouldHaveParameters,\n\t\t\t\t\t\tsymbol.Locations.First()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}, SymbolKind.Method);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/TheoryMethodShouldUseAllParameters.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class TheoryMethodShouldUseAllParameters : XunitDiagnosticAnalyzer\n{\n\tstatic readonly Regex discardRegex = new(@\"^_\\d*$\");\n\n\tpublic TheoryMethodShouldUseAllParameters() :\n\t\tbase(Descriptors.X1026_TheoryMethodShouldUseAllParameters)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (xunitContext.Core.TheoryAttributeType is null)\n\t\t\t\treturn;\n\t\t\tif (context.Node is not MethodDeclarationSyntax methodSyntax)\n\t\t\t\treturn;\n\t\t\tif (methodSyntax.ParameterList.Parameters.Count == 0)\n\t\t\t\treturn;\n\n\t\t\tvar methodSymbol = context.SemanticModel.GetDeclaredSymbol(methodSyntax);\n\t\t\tif (methodSymbol is null)\n\t\t\t\treturn;\n\n\t\t\tvar attributes = methodSymbol.GetAttributes();\n\t\t\tif (!attributes.ContainsAttributeType(xunitContext.Core.TheoryAttributeType))\n\t\t\t\treturn;\n\n\t\t\tAnalyzeTheoryParameters(context, methodSyntax, methodSymbol);\n\t\t}, SyntaxKind.MethodDeclaration);\n\t}\n\n\tstatic void AnalyzeTheoryParameters(\n\t\tSyntaxNodeAnalysisContext context,\n\t\tMethodDeclarationSyntax methodSyntax,\n\t\tIMethodSymbol methodSymbol)\n\t{\n\t\tvar methodBody = methodSyntax.Body as SyntaxNode ?? methodSyntax.ExpressionBody?.Expression;\n\t\tif (methodBody is null)\n\t\t\treturn;\n\n\t\tvar flowAnalysis = context.SemanticModel.AnalyzeDataFlow(methodBody);\n\t\tif (!flowAnalysis.Succeeded)\n\t\t\treturn;\n\n\t\tvar usedParameters = new HashSet<ISymbol>(flowAnalysis.ReadInside.Concat(flowAnalysis.Captured).Distinct(SymbolEqualityComparer.Default), SymbolEqualityComparer.Default);\n\n\t\tfor (var i = 0; i < methodSymbol.Parameters.Length; i++)\n\t\t{\n\t\t\tvar parameterSymbol = methodSymbol.Parameters[i];\n\n\t\t\tif (!usedParameters.Contains(parameterSymbol) && !discardRegex.IsMatch(parameterSymbol.Name))\n\t\t\t{\n\t\t\t\tvar parameterSyntax = methodSyntax.ParameterList.Parameters[i];\n\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1026_TheoryMethodShouldUseAllParameters,\n\t\t\t\t\t\tparameterSyntax.Identifier.GetLocation(),\n\t\t\t\t\t\tmethodSymbol.Name,\n\t\t\t\t\t\tmethodSymbol.ContainingType.Name,\n\t\t\t\t\t\tparameterSymbol.Name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X1000/UseCancellationToken.cs",
    "content": "using System.Collections.Immutable;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseCancellationToken : XunitDiagnosticAnalyzer\n{\n\tpublic UseCancellationToken() :\n\t\tbase(Descriptors.X1051_UseCancellationToken)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar cancellationTokenType = TypeSymbolFactory.CancellationToken(context.Compilation);\n\t\tif (cancellationTokenType is null)\n\t\t\treturn;\n\n\t\tvar xunitContainerTypes = new[]\n\t\t{\n\t\t\tTypeSymbolFactory.Assert(context.Compilation),\n\t\t\tTypeSymbolFactory.Record(context.Compilation),\n\t\t}.WhereNotNull().ToImmutableHashSet(SymbolEqualityComparer.Default);\n\n\t\tvar attributeUsageAttribute = TypeSymbolFactory.AttributeUsageAttribute(context.Compilation);\n\t\tvar obsoleteAttribute = TypeSymbolFactory.ObsoleteAttribute(context.Compilation);\n\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IInvocationOperation invocationOperation)\n\t\t\t\treturn;\n\n\t\t\tvar (foundSymbol, lambdaOwner) = invocationOperation.IsInTestMethod(xunitContext);\n\t\t\tif (!foundSymbol || lambdaOwner is ILocalFunctionOperation or IAnonymousFunctionOperation)\n\t\t\t\treturn;\n\n\t\t\t// We want to try to catch anything that's a lambda from Assert or Record, but\n\t\t\t// ignore all other lambdas, because we don't want to catch false positives from\n\t\t\t// things like mocking libraries.\n\t\t\tif (lambdaOwner is IInvocationOperation lambdaOwnerInvocation)\n\t\t\t\tif (!xunitContainerTypes.Contains(lambdaOwnerInvocation.TargetMethod.ContainingType))\n\t\t\t\t\treturn;\n\n\t\t\tvar invokedMethod = invocationOperation.TargetMethod;\n\t\t\tvar parameters = invokedMethod.Parameters;\n\n\t\t\tIArgumentOperation? argument = null;\n\t\t\tforeach (var parameter in parameters)\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(parameter.Type, cancellationTokenType))\n\t\t\t\t{\n\t\t\t\t\targument = invocationOperation.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, parameter));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t// The invoked method has the parameter we're looking for\n\t\t\tif (argument is not null)\n\t\t\t{\n\t\t\t\t// Default parameter value\n\t\t\t\tif (argument.ArgumentKind == ArgumentKind.DefaultValue)\n\t\t\t\t\tReport(context, invocationOperation.Syntax.GetLocation(), argument.Parameter!);\n\n\t\t\t\t// Explicit parameter value\n\t\t\t\telse if (argument.Syntax is ArgumentSyntax argumentSyntax)\n\t\t\t\t{\n\t\t\t\t\tvar kind = argumentSyntax.Expression.Kind();\n\t\t\t\t\tif (kind is SyntaxKind.DefaultExpression or SyntaxKind.DefaultLiteralExpression)\n\t\t\t\t\t\tReport(context, invocationOperation.Syntax.GetLocation(), argument.Parameter!);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Look for an overload with the exact same parameter types + a CancellationToken\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar targetParameterTypes = parameters.Select(p => p.Type).Concat([cancellationTokenType]).ToArray();\n\t\t\t\tforeach (var member in invokedMethod.ContainingType.GetMembers(invokedMethod.Name))\n\t\t\t\t\tif (member is IMethodSymbol method)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (attributeUsageAttribute is not null && obsoleteAttribute is not null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar attributes = method.GetAttributesWithInheritance(attributeUsageAttribute);\n\t\t\t\t\t\t\tif (attributes.Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, obsoleteAttribute)))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar methodParameterTypes = method.Parameters.Select(p => p.Type).ToArray();\n\t\t\t\t\t\tif (methodParameterTypes.Length != targetParameterTypes.Length)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar match = true;\n\t\t\t\t\t\tfor (var idx = 0; idx < targetParameterTypes.Length; ++idx)\n\t\t\t\t\t\t\tif (!SymbolEqualityComparer.Default.Equals(targetParameterTypes[idx], methodParameterTypes[idx]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmatch = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (match)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tReport(context, invocationOperation.Syntax.GetLocation(), method.Parameters.Last());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}, OperationKind.Invocation);\n\n\t\tstatic void Report(\n\t\t\tOperationAnalysisContext context,\n\t\t\tLocation location,\n\t\t\tIParameterSymbol parameter)\n\t\t{\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.ParameterName] = parameter.Name;\n\t\t\tbuilder[Constants.Properties.ParameterIndex] = parameter.Ordinal.ToString(CultureInfo.InvariantCulture);\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X1051_UseCancellationToken,\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t\tbuilder.ToImmutable()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\t}\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).HasV3References;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertCollectionContainsShouldNotUseBoolCheck.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertCollectionContainsShouldNotUseBoolCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> linqContainsMethods =\n\t[\n\t\t// Signatures without nullable variants\n\t\t\"System.Linq.Enumerable.Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource)\",\n\t\t// Non-nullable signatures\n\t\t\"System.Linq.Enumerable.Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource, System.Collections.Generic.IEqualityComparer<TSource>)\",\n\t\t// Nullable signatures\n\t\t\"System.Linq.Enumerable.Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource, System.Collections.Generic.IEqualityComparer<TSource>?)\",\n\t];\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\n\tpublic AssertCollectionContainsShouldNotUseBoolCheck()\n\t\t: base(Descriptors.X2017_AssertCollectionContainsShouldNotUseBoolCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length is < 1 or > 2)\n\t\t\treturn;\n\n\t\tif (method.Parameters.Length > 1 && method.Parameters[1].Type.SpecialType == SpecialType.System_String)\n\t\t\treturn;\n\n\t\tif (arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, method.Parameters[0]))?.Value is not IInvocationOperation invocationExpression)\n\t\t\treturn;\n\n\t\tvar methodSymbol = invocationExpression.TargetMethod;\n\t\tif (!IsLinqContainsMethod(methodSymbol) && !IsICollectionContainsMethod(context, methodSymbol))\n\t\t\treturn;\n\n\t\tvar replacement =\n\t\t\tmethod.Name == Constants.Asserts.True\n\t\t\t\t? Constants.Asserts.Contains\n\t\t\t\t: Constants.Asserts.DoesNotContain;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2017_AssertCollectionContainsShouldNotUseBoolCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic bool IsLinqContainsMethod(IMethodSymbol methodSymbol) =>\n\t\tmethodSymbol.OriginalDefinition is not null && linqContainsMethods.Contains(SymbolDisplay.ToDisplayString(methodSymbol.OriginalDefinition));\n\n\tstatic bool IsICollectionContainsMethod(\n\t\tOperationAnalysisContext context,\n\t\tIMethodSymbol methodSymbol)\n\t{\n\t\tvar containingType = methodSymbol.ContainingType;\n\t\tvar genericCollectionType = containingType.GetGenericInterfaceImplementation(TypeSymbolFactory.ICollectionOfT(context.Compilation));\n\n\t\tif (genericCollectionType is null)\n\t\t\treturn false;\n\n\t\tvar genericCollectionContainsSymbol =\n\t\t\tgenericCollectionType\n\t\t\t\t.GetMembers(nameof(ICollection<int>.Contains))\n\t\t\t\t.FirstOrDefault();\n\n\t\tif (genericCollectionContainsSymbol is null)\n\t\t\treturn false;\n\n\t\tvar genericCollectionSymbolImplementation = containingType.FindImplementationForInterfaceMember(genericCollectionContainsSymbol);\n\t\treturn SymbolEqualityComparer.Default.Equals(genericCollectionSymbolImplementation, methodSymbol);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEmptyCollectionCheckShouldNotBeUsed.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEmptyCollectionCheckShouldNotBeUsed : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Collection,\n\t\tConstants.Asserts.CollectionAsync,\n\t];\n\n\tpublic AssertEmptyCollectionCheckShouldNotBeUsed()\n\t\t: base(Descriptors.X2011_AssertEmptyCollectionCheckShouldNotBeUsed, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Syntax is not InvocationExpressionSyntax invocation)\n\t\t\treturn;\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\t\tif (arguments.Count != 1)\n\t\t\treturn;\n\n\t\tvar matchedType = false;\n\t\tvar asyncEnumerable = TypeSymbolFactory.IAsyncEnumerableOfT(context.Compilation);\n\t\tif (asyncEnumerable != null)\n\t\t\tmatchedType = SymbolEqualityComparer.Default.Equals(method.Parameters[0].Type.OriginalDefinition, asyncEnumerable);\n\n\t\tmatchedType = matchedType || method.Parameters[0].Type.OriginalDefinition.SpecialType.Equals(SpecialType.System_Collections_Generic_IEnumerable_T);\n\n\t\tif (!matchedType)\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2011_AssertEmptyCollectionCheckShouldNotBeUsed,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecks.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecks : AssertUsageAnalyzerBase\n{\n\tconst string linqWhereMethod = \"System.Linq.Enumerable.Where<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)\";\n\n\tstatic readonly DiagnosticDescriptor[] targetDescriptors =\n\t[\n\t\tDescriptors.X2029_AssertEmptyShouldNotBeUsedForCollectionDoesNotContainCheck,\n\t\tDescriptors.X2030_AssertNotEmptyShouldNotBeUsedForCollectionContainsCheck,\n\t];\n\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Empty,\n\t\tConstants.Asserts.NotEmpty,\n\t];\n\n\tpublic AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecks() :\n\t\tbase(targetDescriptors, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tvar argument = arguments[0];\n\t\tvar value = argument.Value;\n\t\tif (value is IConversionOperation conversion)\n\t\t\tvalue = conversion.Operand;\n\n\t\tif (value is not IInvocationOperation innerInvocation)\n\t\t\treturn;\n\n\t\tvar originalMethod = SymbolDisplay.ToDisplayString(innerInvocation.TargetMethod.OriginalDefinition);\n\t\tif (originalMethod != linqWhereMethod)\n\t\t\treturn;\n\n\t\tvar descriptor = method.Name == Constants.Asserts.Empty\n\t\t\t? targetDescriptors[0]\n\t\t\t: targetDescriptors[1];\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tdescriptor,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck : AssertUsageAnalyzerBase\n{\n\t// Signature without nullable variant\n\tconst string enumerableAnyExtensionMethod = \"System.Linq.Enumerable.Any<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)\";\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\n\tpublic AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck()\n\t\t: base(Descriptors.X2012_AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\t\tif (arguments[0].Value is not IInvocationOperation invocationExpression)\n\t\t\treturn;\n\n\t\tvar methodSymbol = invocationExpression.TargetMethod;\n\t\tif (SymbolDisplay.ToDisplayString(methodSymbol.OriginalDefinition) != enumerableAnyExtensionMethod)\n\t\t\treturn;\n\n\t\tvar replacement =\n\t\t\tmethod.Name == Constants.Asserts.True\n\t\t\t\t? Constants.Asserts.Contains\n\t\t\t\t: Constants.Asserts.DoesNotContain;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.AssertMethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2012_AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualGenericShouldNotBeUsedForStringValue.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualGenericShouldNotBeUsedForStringValue : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.StrictEqual,\n\t];\n\n\tpublic AssertEqualGenericShouldNotBeUsedForStringValue()\n\t\t: base(Descriptors.X2006_AssertEqualGenericShouldNotBeUsedForStringValue, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length != 2)\n\t\t\treturn;\n\n\t\tif (!method.IsGenericMethod && method.Name == Constants.Asserts.Equal)\n\t\t\treturn;\n\n\t\tif (method.IsGenericMethod &&\n\t\t   (!method.TypeArguments[0].SpecialType.Equals(SpecialType.System_String) ||\n\t\t\t!method.Parameters[0].Type.SpecialType.Equals(SpecialType.System_String) ||\n\t\t\t!method.Parameters[1].Type.SpecialType.Equals(SpecialType.System_String)))\n\t\t\treturn;\n\n\t\tvar invalidUsageDescription =\n\t\t\tmethod.Name == Constants.Asserts.Equal\n\t\t\t\t? \"Assert.Equal<string>\"\n\t\t\t\t: \"Assert.StrictEqual\";\n\t\tvar replacement =\n\t\t\tmethod.Name == Constants.Asserts.Equal\n\t\t\t\t? \"non-generic Assert.Equal\"\n\t\t\t\t: \"Assert.Equal\";\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2006_AssertEqualGenericShouldNotBeUsedForStringValue,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tinvalidUsageDescription,\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualLiteralValueShouldBeFirst.cs",
    "content": "using System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualLiteralValueShouldBeFirst : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t\tConstants.Asserts.NotStrictEqual,\n\t\tConstants.Asserts.StrictEqual,\n\t];\n\n\tpublic AssertEqualLiteralValueShouldBeFirst()\n\t\t: base(Descriptors.X2000_AssertEqualLiteralValueShouldBeFirst, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length < 2)\n\t\t\treturn;\n\n\t\tvar expectedArg = arguments.FirstOrDefault(arg => arg.Parameter?.Name == Constants.AssertArguments.Expected);\n\t\tvar actualArg = arguments.FirstOrDefault(arg => arg.Parameter?.Name == Constants.AssertArguments.Actual);\n\t\tif (expectedArg is null || actualArg is null)\n\t\t\treturn;\n\n\t\tif (IsLiteralOrConstant(actualArg.Value) && !IsLiteralOrConstant(expectedArg.Value))\n\t\t{\n\t\t\tvar parentMethod = context.ContainingSymbol;\n\t\t\tvar parentType = parentMethod.ContainingType;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2000_AssertEqualLiteralValueShouldBeFirst,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tactualArg.Value.Syntax.ToString(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.IncludeName)\n\t\t\t\t\t),\n\t\t\t\t\tparentMethod.Name,\n\t\t\t\t\tparentType?.Name ?? \"<unknown>\"\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic bool IsLiteralOrConstant(IOperation operation)\n\t{\n\t\tif (operation.Kind == OperationKind.ObjectCreation && operation.Type?.SpecialType == SpecialType.System_String)\n\t\t\treturn ((IObjectCreationOperation)operation).Arguments.All(arg => arg.Value.ConstantValue.HasValue);\n\n\t\treturn operation.ConstantValue.HasValue || operation.Kind == OperationKind.TypeOf;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualPrecisionShoulBeInRange.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualPrecisionShouldBeInRange : AssertUsageAnalyzerBase\n{\n\tstatic readonly Dictionary<SpecialType, int> precisionMaxLimits = new()\n\t{\n\t\t{ SpecialType.System_Double, 15 },\n\t\t{ SpecialType.System_Decimal, 28 },\n\t};\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t];\n\tstatic readonly Dictionary<SpecialType, string> typeNames = new()\n\t{\n\t\t{ SpecialType.System_Double, \"double\" },\n\t\t{ SpecialType.System_Decimal, \"decimal\" },\n\t};\n\n\tpublic AssertEqualPrecisionShouldBeInRange()\n\t\t: base(Descriptors.X2016_AssertEqualPrecisionShouldBeInRange, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar numericType = GetMethodNumericType(method);\n\t\tif (numericType is null)\n\t\t\treturn;\n\n\t\tvar precision = GetNumericLiteralValue(invocationOperation);\n\t\tif (precision is null)\n\t\t\treturn;\n\n\t\tEnsurePrecisionInRange(context, precision.Value.precisionArgument.Value.Syntax.GetLocation(), numericType.Value, precision.Value.value);\n\t}\n\n\t// Gets double or decimal SpecialType if it is method's first argument type, null otherwise.\n\t// This has the semantic of: 1. Ensure the analysis applies, 2. Get data for further analysis.\n\tstatic SpecialType? GetMethodNumericType(IMethodSymbol method)\n\t{\n\t\tif (method.Parameters.Length != 3)\n\t\t\treturn null;\n\n\t\tvar type = method.Parameters[0].Type.SpecialType;\n\n\t\tif (type is not SpecialType.System_Double and not SpecialType.System_Decimal)\n\t\t\treturn null;\n\n\t\treturn type;\n\t}\n\n\t// Gets the value of precision used in Equal/NotEqual invocation or null if cannot be obtained.\n\t// This has the semantic of: 1. Ensure the analysis applies, 2. Get data for further analysis.\n\tstatic (IArgumentOperation precisionArgument, int value)? GetNumericLiteralValue(IInvocationOperation invocation)\n\t{\n\t\tif (invocation.Arguments.Length != 3)\n\t\t\treturn null;\n\n\t\tvar precisionParameter = invocation.TargetMethod.Parameters[2];\n\t\tvar precisionArgument = invocation.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, precisionParameter));\n\t\tif (precisionArgument is null)\n\t\t\treturn null;\n\n\t\tvar constantValue = precisionArgument.Value.ConstantValue;\n\t\tif (!constantValue.HasValue || constantValue.Value is not int value)\n\t\t\treturn null;\n\n\t\treturn (precisionArgument, value);\n\t}\n\n\tstatic void EnsurePrecisionInRange(\n\t\tOperationAnalysisContext context,\n\t\tLocation location,\n\t\tSpecialType numericType,\n\t\tint numericValue)\n\t{\n\t\tvar precisionMax = precisionMaxLimits[numericType];\n\n\t\tif (numericValue < 0 || numericValue > precisionMax)\n\t\t{\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.Replacement] = numericValue < 0 ? \"0\" : precisionMax.ToString(CultureInfo.InvariantCulture);\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2016_AssertEqualPrecisionShouldBeInRange,\n\t\t\t\t\tlocation,\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\t$\"[0..{precisionMax}]\",\n\t\t\t\t\ttypeNames[numericType]\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualShouldNotBeUsedForBoolLiteralCheck.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualShouldNotBeUsedForBoolLiteralCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> equalMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.StrictEqual,\n\t];\n\tstatic readonly HashSet<string> notEqualMethods =\n\t[\n\t\tConstants.Asserts.NotEqual,\n\t\tConstants.Asserts.NotStrictEqual,\n\t];\n\tstatic readonly string[] targetMethods = equalMethods.Union(notEqualMethods).ToArray();\n\n\tpublic AssertEqualShouldNotBeUsedForBoolLiteralCheck()\n\t\t: base(Descriptors.X2004_AssertEqualShouldNotUsedForBoolLiteralCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length is not 2 and not 3)\n\t\t\treturn;\n\n\t\t// Match Assert.Equal<bool>(true, expression) but not e.g. Assert.Equal<object>(true, expression).\n\t\tif (!method.IsGenericMethod ||\n\t\t\t!method.TypeArguments[0].SpecialType.Equals(SpecialType.System_Boolean))\n\t\t\treturn;\n\n\t\tif (arguments.FirstOrDefault(arg => arg.Parameter?.Ordinal == 0)?.Value is not ILiteralOperation literalFirstArgument)\n\t\t\treturn;\n\n\t\tvar isTrue = literalFirstArgument.ConstantValue.HasValue && Equals(literalFirstArgument.ConstantValue.Value, true);\n\t\tvar isFalse = literalFirstArgument.ConstantValue.HasValue && Equals(literalFirstArgument.ConstantValue.Value, false);\n\n\t\tif (!(isTrue ^ isFalse))\n\t\t\treturn;\n\n\t\tvar replacement = GetReplacementMethodName(method.Name, isTrue);\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.LiteralValue] = isTrue ? bool.TrueString : bool.FalseString;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2004_AssertEqualShouldNotUsedForBoolLiteralCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic string? GetReplacementMethodName(\n\t\tstring methodName,\n\t\tbool isTrue)\n\t{\n\t\tif (equalMethods.Contains(methodName))\n\t\t\treturn isTrue ? Constants.Asserts.True : Constants.Asserts.False;\n\t\tif (notEqualMethods.Contains(methodName))\n\t\t\treturn isTrue ? Constants.Asserts.False : Constants.Asserts.True;\n\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualShouldNotBeUsedForCollectionSizeCheck.cs",
    "content": "using System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualShouldNotBeUsedForCollectionSizeCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> allowedCollections =\n\t[\n\t\t// ArraySegment<T>.GetEnumerator() can throw\n\t\t\"System.ArraySegment<T>\",\n\t\t// StringValues has an implicit string conversion that's preferred by the compiler, https://github.com/xunit/xunit/issues/2859\n\t\t\"Microsoft.Extensions.Primitives.StringValues\",\n\t];\n\tstatic readonly HashSet<string> sizeMethods =\n\t[\n\t\t// Signatures without nullable variants\n\t\t\"System.Array.Length\",\n\t\t\"System.Linq.Enumerable.Count<TSource>(System.Collections.Generic.IEnumerable<TSource>)\",\n\t\t\"System.Collections.Immutable.ImmutableArray<T>.Length\",\n\t];\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t];\n\n\tpublic AssertEqualShouldNotBeUsedForCollectionSizeCheck()\n\t\t: base(Descriptors.X2013_AssertEqualShouldNotBeUsedForCollectionSizeCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (method.Parameters.Length != 2 ||\n\t\t\t!method.Parameters[0].Type.SpecialType.Equals(SpecialType.System_Int32) ||\n\t\t\t!method.Parameters[1].Type.SpecialType.Equals(SpecialType.System_Int32))\n\t\t\treturn;\n\n\t\tvar sizeOperation = invocationOperation.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, method.Parameters[0]))?.Value;\n\t\tvar sizeValue = sizeOperation?.ConstantValue ?? default;\n\t\tif (!sizeValue.HasValue)\n\t\t\treturn;\n\n\t\t// Make sure the first parameter really is an int before checking its value. Could for example be a char.\n\t\tif (sizeValue.Value is not int size)\n\t\t\treturn;\n\n\t\tif (size < 0 || size > 1 || (size == 1 && method.Name != Constants.Asserts.Equal))\n\t\t\treturn;\n\n\t\tvar otherArgument = invocationOperation.Arguments.FirstOrDefault(arg => !SymbolEqualityComparer.Default.Equals(arg.Parameter, method.Parameters[0]));\n\n\t\tvar symbol = otherArgument?.Value switch\n\t\t{\n\t\t\tIInvocationOperation o => o.TargetMethod,\n\t\t\tIPropertyReferenceOperation p => p.Property,\n\t\t\t_ => default(ISymbol),\n\t\t};\n\n\t\tif (symbol is null)\n\t\t\treturn;\n\n\t\tif (IsAllowedCollection(symbol) ||\n\t\t\t\t(!IsWellKnownSizeMethod(symbol) &&\n\t\t\t\t !IsICollectionCountProperty(context, symbol) &&\n\t\t\t\t !IsICollectionOfTCountProperty(context, symbol) &&\n\t\t\t\t !IsIReadOnlyCollectionOfTCountProperty(context, symbol)))\n\t\t\treturn;\n\n\t\tvar replacement = GetReplacementMethodName(method.Name, size);\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.SizeValue] = size.ToString(CultureInfo.InvariantCulture);\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2013_AssertEqualShouldNotBeUsedForCollectionSizeCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic string GetReplacementMethodName(\n\t\tstring methodName,\n\t\tint size)\n\t{\n\t\tif (size == 1)\n\t\t\treturn Constants.Asserts.Single;\n\n\t\treturn methodName == Constants.Asserts.Equal ? Constants.Asserts.Empty : Constants.Asserts.NotEmpty;\n\t}\n\n\tstatic bool IsAllowedCollection(ISymbol symbol) =>\n\t\tallowedCollections.Contains(symbol.ContainingType.ConstructedFrom.ToDisplayString());\n\n\tstatic bool IsWellKnownSizeMethod(ISymbol symbol) =>\n\t\tsizeMethods.Contains(symbol.OriginalDefinition.ToDisplayString());\n\n\tstatic bool IsICollectionCountProperty(\n\t\tOperationAnalysisContext context,\n\t\tISymbol symbol) =>\n\t\t\tIsCountPropertyOf(TypeSymbolFactory.ICollection(context.Compilation), symbol);\n\n\tstatic bool IsICollectionOfTCountProperty(\n\t\tOperationAnalysisContext context,\n\t\tISymbol symbol) =>\n\t\t\tIsCountPropertyOfGenericType(TypeSymbolFactory.ICollectionOfT(context.Compilation), symbol);\n\n\tstatic bool IsIReadOnlyCollectionOfTCountProperty(\n\t\tOperationAnalysisContext context,\n\t\tISymbol symbol) =>\n\t\t\tIsCountPropertyOfGenericType(TypeSymbolFactory.IReadOnlyCollectionOfT(context.Compilation), symbol);\n\n\tstatic bool IsCountPropertyOf(\n\t\tINamedTypeSymbol? collectionType,\n\t\tISymbol symbol)\n\t{\n\t\tif (collectionType is null)\n\t\t\treturn false;\n\n\t\tvar memberSymbol = symbol;\n\t\tvar containingType = memberSymbol.ContainingType;\n\t\tvar countSymbol = collectionType.GetMember(nameof(ICollection.Count));\n\t\tif (countSymbol is null)\n\t\t\treturn false;\n\n\t\tif (SymbolEqualityComparer.Default.Equals(countSymbol, symbol))\n\t\t\treturn true;\n\n\t\tvar countSymbolImplementation = containingType.FindImplementationForInterfaceMember(countSymbol);\n\n\t\treturn SymbolEqualityComparer.Default.Equals(countSymbolImplementation, memberSymbol);\n\t}\n\n\tstatic bool IsCountPropertyOfGenericType(\n\t\tINamedTypeSymbol openCollectionType,\n\t\tISymbol symbol)\n\t{\n\t\tvar containingType = symbol.ContainingType;\n\t\tvar concreteCollectionType = containingType.GetGenericInterfaceImplementation(openCollectionType);\n\n\t\treturn concreteCollectionType is not null && IsCountPropertyOf(concreteCollectionType, symbol);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualShouldNotBeUsedForNullCheck.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualShouldNotBeUsedForNullCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> equalMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.Same,\n\t\tConstants.Asserts.StrictEqual,\n\t];\n\tstatic readonly HashSet<string> notEqualMethods =\n\t[\n\t\tConstants.Asserts.NotEqual,\n\t\tConstants.Asserts.NotSame,\n\t\tConstants.Asserts.NotStrictEqual,\n\t];\n\tstatic readonly string[] targetMethods = equalMethods.Union(notEqualMethods).ToArray();\n\n\tpublic AssertEqualShouldNotBeUsedForNullCheck()\n\t\t: base(Descriptors.X2003_AssertEqualShouldNotUsedForNullCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Syntax is not InvocationExpressionSyntax invocation)\n\t\t\treturn;\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\t\tvar literalFirstArgument = arguments.FirstOrDefault()?.Expression as LiteralExpressionSyntax;\n\t\tif (!literalFirstArgument?.IsKind(SyntaxKind.NullLiteralExpression) ?? true)\n\t\t\treturn;\n\n\t\tvar replacement = GetReplacementMethod(method.Name);\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2003_AssertEqualShouldNotUsedForNullCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic string? GetReplacementMethod(string methodName)\n\t{\n\t\tif (equalMethods.Contains(methodName))\n\t\t\treturn Constants.Asserts.Null;\n\t\tif (notEqualMethods.Contains(methodName))\n\t\t\treturn Constants.Asserts.NotNull;\n\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertEqualsShouldNotBeUsed.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertEqualsShouldNotBeUsed : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tnameof(Equals),\n\t\tnameof(ReferenceEquals),\n\t];\n\n\tpublic AssertEqualsShouldNotBeUsed()\n\t\t: base(Descriptors.X2001_AssertEqualsShouldNotBeUsed, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar replacement = method.Name switch\n\t\t{\n\t\t\tnameof(Equals) => Constants.Asserts.Equal,\n\t\t\tnameof(ReferenceEquals) => Constants.Asserts.Same,\n\t\t\t_ => null\n\t\t};\n\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2001_AssertEqualsShouldNotBeUsed,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertIsTypeShouldNotBeUsedForAbstractType.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertIsTypeShouldNotBeUsedForAbstractType : AssertUsageAnalyzerBase\n{\n\tpublic static readonly Dictionary<string, string> ReplacementMethods = new()\n\t{\n\t\t{ Constants.Asserts.IsType, Constants.Asserts.IsAssignableFrom },\n\t\t{ Constants.Asserts.IsNotType, Constants.Asserts.IsNotAssignableFrom },\n\t};\n\n\tconst string abstractClass = \"abstract class\";\n\tconst string @interface = \"interface\";\n\n\tpublic AssertIsTypeShouldNotBeUsedForAbstractType()\n\t\t: base(Descriptors.X2018_AssertIsTypeShouldNotBeUsedForAbstractType, ReplacementMethods.Keys)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar type = invocationOperation.TargetMethod.TypeArguments.FirstOrDefault();\n\t\tif (type is null)\n\t\t\treturn;\n\n\t\tvar typeKind = type.TypeKind switch\n\t\t{\n\t\t\tTypeKind.Class => type.IsAbstract ? abstractClass : null,\n\t\t\tTypeKind.Interface => @interface,\n\t\t\t_ => null,\n\t\t};\n\n\t\tif (typeKind is null)\n\t\t\treturn;\n\n\t\tif (invocationOperation.Arguments.Length > 1)\n\t\t{\n\t\t\tif (invocationOperation.Arguments[1].Value is not ILiteralOperation operation)\n\t\t\t\treturn;\n\t\t\tif (operation.ConstantValue.Value is not bool value)\n\t\t\t\treturn;\n\t\t\tif (!value)\n\t\t\t\treturn;\n\t\t}\n\n\t\tvar typeName = SymbolDisplay.ToDisplayString(type);\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tstring? replacement;\n\n\t\tif (xunitContext.Assert.SupportsInexactTypeAssertions)\n\t\t{\n\t\t\treplacement = \"exactMatch: false\";\n\t\t\tbuilder[Constants.Properties.UseExactMatch] = bool.TrueString;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!ReplacementMethods.TryGetValue(invocationOperation.TargetMethod.Name, out replacement))\n\t\t\t\treturn;\n\n\t\t\tbuilder[Constants.Properties.UseExactMatch] = bool.FalseString;\n\t\t\treplacement = \"Assert.\" + replacement;\n\t\t}\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2018_AssertIsTypeShouldNotBeUsedForAbstractType,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\ttypeKind,\n\t\t\t\ttypeName,\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertIsTypeShouldUseGenericOverloadType.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertIsTypeShouldUseGenericOverloadType : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.IsAssignableFrom,\n\t\tConstants.Asserts.IsNotType,\n\t\tConstants.Asserts.IsType,\n\t];\n\n\tpublic AssertIsTypeShouldUseGenericOverloadType()\n\t\t: base(Descriptors.X2007_AssertIsTypeShouldUseGenericOverload, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (method.IsGenericMethod)\n\t\t\treturn;\n\n\t\tvar parameters = invocationOperation.TargetMethod.Parameters;\n\t\tif (parameters.Length < 2)\n\t\t\treturn;\n\n\t\tvar typeArgument = invocationOperation.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, parameters[0]));\n\t\tif (typeArgument?.Value is not ITypeOfOperation typeOfOperation)\n\t\t\treturn;\n\n\t\tvar type = typeOfOperation.TypeOperand;\n\t\tvar typeName = SymbolDisplay.ToDisplayString(type);\n\n\t\t// Static abstract interface members can't be used as types in generics\n\t\tif (type.TypeKind == TypeKind.Interface)\n\t\t{\n\t\t\tvar allInterfaces = (type as INamedTypeSymbol)?.AllInterfaces;\n\t\t\tif (allInterfaces is not null)\n\t\t\t{\n\t\t\t\tvar allMembers =\n\t\t\t\t\tallInterfaces\n\t\t\t\t\t\t.Value\n\t\t\t\t\t\t.SelectMany(i => i.GetMembers())\n\t\t\t\t\t\t.Concat(type.GetMembers());\n\n\t\t\t\tif (allMembers.Any(m => m is { IsAbstract: true, IsStatic: true }))\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.TypeName] = typeName;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2007_AssertIsTypeShouldUseGenericOverload,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\ttypeName\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertNullShouldNotBeCalledOnValueTypes.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertNullShouldNotBeCalledOnValueTypes : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.NotNull,\n\t\tConstants.Asserts.Null,\n\t];\n\n\tpublic AssertNullShouldNotBeCalledOnValueTypes()\n\t\t: base(Descriptors.X2002_AssertNullShouldNotBeCalledOnValueTypes, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length != 1)\n\t\t\treturn;\n\n\t\tvar argumentValue = invocationOperation.Arguments[0].Value.WalkDownImplicitConversions();\n\t\tvar argumentType = argumentValue.Type;\n\t\tif (argumentType is null || IsArgumentTypeRecognizedAsReferenceType(argumentType))\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2002_AssertNullShouldNotBeCalledOnValueTypes,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tGetDisplayString(method),\n\t\t\t\tGetDisplayString(argumentType)\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic bool IsArgumentTypeRecognizedAsReferenceType(ITypeSymbol argumentType)\n\t{\n\t\tvar isNullableOfT = argumentType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;\n\t\tvar isUnconstrainedGenericType = !argumentType.IsReferenceType && !argumentType.IsValueType;\n\n\t\treturn argumentType.IsReferenceType || argumentType.TypeKind == TypeKind.Pointer || isNullableOfT || isUnconstrainedGenericType;\n\t}\n\n\tstatic string GetDisplayString(ISymbol method)\n\t{\n\t\tvar displayFormat = SymbolDisplayFormat.CSharpShortErrorMessageFormat.WithParameterOptions(SymbolDisplayParameterOptions.None);\n\n\t\treturn SymbolDisplay.ToDisplayString(method, displayFormat);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertRegexMatchShouldNotUseBoolLiteralCheck.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertRegexMatchShouldNotUseBoolLiteralCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> regexIsMatchSymbols =\n\t[\n\t\t// Signatures without nullable variants\n\t\t\"System.Text.RegularExpressions.Regex.IsMatch(string)\",\n\t\t\"System.Text.RegularExpressions.Regex.IsMatch(string, string)\",\n\t];\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.True,\n\t\tConstants.Asserts.False\n\t];\n\n\tpublic AssertRegexMatchShouldNotUseBoolLiteralCheck()\n\t\t: base(Descriptors.X2008_AssertRegexMatchShouldNotUseBoolLiteralCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tif (arguments[0].Value is not IInvocationOperation invocationExpression)\n\t\t\treturn;\n\n\t\tvar methodSymbol = invocationExpression.TargetMethod;\n\t\tif (!regexIsMatchSymbols.Contains(SymbolDisplay.ToDisplayString(methodSymbol)))\n\t\t\treturn;\n\n\t\tvar replacement =\n\t\t\tmethod.Name == Constants.Asserts.True\n\t\t\t\t? Constants.Asserts.Matches\n\t\t\t\t: Constants.Asserts.DoesNotMatch;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.IsStatic] = methodSymbol.IsStatic ? bool.TrueString : bool.FalseString;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2008_AssertRegexMatchShouldNotUseBoolLiteralCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertSameShouldNotBeCalledOnValueTypes.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertSameShouldNotBeCalledOnValueTypes : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Same,\n\t\tConstants.Asserts.NotSame\n\t];\n\n\tpublic AssertSameShouldNotBeCalledOnValueTypes()\n\t\t: base(Descriptors.X2005_AssertSameShouldNotBeCalledOnValueTypes, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length != 2)\n\t\t\treturn;\n\n\t\tvar firstArgumentType = invocationOperation.Arguments[0].Value.WalkDownImplicitConversions()?.Type;\n\t\tvar secondArgumentType = invocationOperation.Arguments[1].Value.WalkDownImplicitConversions()?.Type;\n\n\t\tif (firstArgumentType is null && secondArgumentType is null)\n\t\t\treturn;\n\n\t\tif (firstArgumentType?.IsReferenceType == true && secondArgumentType?.IsReferenceType == true)\n\t\t\treturn;\n\n\t\tvar typeToDisplay = firstArgumentType is null || firstArgumentType.IsReferenceType\n\t\t\t? secondArgumentType\n\t\t\t: firstArgumentType;\n\n\t\tif (typeToDisplay is null)\n\t\t\treturn;\n\n\t\tvar replacement = method.Name switch\n\t\t{\n\t\t\tConstants.Asserts.Same => Constants.Asserts.Equal,\n\t\t\tConstants.Asserts.NotSame => Constants.Asserts.NotEqual,\n\t\t\t_ => null,\n\t\t};\n\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2005_AssertSameShouldNotBeCalledOnValueTypes,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\ttypeToDisplay,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertSingleShouldBeUsedForSingleParameter.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertSingleShouldBeUsedForSingleParameter : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Collection,\n\t\tConstants.Asserts.CollectionAsync,\n\t];\n\n\tpublic AssertSingleShouldBeUsedForSingleParameter() :\n\t\tbase(Descriptors.X2023_AssertSingleShouldBeUsedForSingleParameter, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length != 2)\n\t\t\treturn;\n\n\t\tvar secondParameter = invocationOperation.Arguments[1];\n\t\tif (secondParameter.ArgumentKind != ArgumentKind.ParamArray)\n\t\t\treturn;\n\n\t\tif (secondParameter.Value is not IArrayCreationOperation operation)\n\t\t\treturn;\n\n\t\tif (operation.DimensionSizes.Length != 1 || (int)(operation.DimensionSizes[0].ConstantValue.Value ?? 0) != 1)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.AssertMethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = Constants.Asserts.Single;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2023_AssertSingleShouldBeUsedForSingleParameter,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tmethod.Name\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertSingleShouldUseTwoArgumentCall.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertSingleShouldUseTwoArgumentCall : AssertUsageAnalyzerBase\n{\n\tconst string linqWhereMethod = \"System.Linq.Enumerable.Where<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, bool>)\";\n\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Single,\n\t];\n\n\tpublic AssertSingleShouldUseTwoArgumentCall() :\n\t\tbase(Descriptors.X2031_AssertSingleShouldUseTwoArgumentCall, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tvar argument = arguments[0];\n\t\tvar value = argument.Value;\n\t\tif (value is IConversionOperation conversion)\n\t\t\tvalue = conversion.Operand;\n\n\t\tif (value is not IInvocationOperation innerInvocation)\n\t\t\treturn;\n\n\t\tvar originalMethod = SymbolDisplay.ToDisplayString(innerInvocation.TargetMethod.OriginalDefinition);\n\t\tif (originalMethod != linqWhereMethod)\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2031_AssertSingleShouldUseTwoArgumentCall,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertStringEqualityCheckShouldNotUseBoolCheck.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertStringEqualityCheckShouldNotUseBoolCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly HashSet<string> stringEqualsMethods =\n\t[\n\t\t// Non-nullable signatures\n\t\t\"string.Equals(string)\",\n\t\t\"string.Equals(string, string)\",\n\t\t\"string.Equals(string, System.StringComparison)\",\n\t\t\"string.Equals(string, string, System.StringComparison)\",\n\t\t// Nullable signatures\n\t\t\"string.Equals(string?)\",\n\t\t\"string.Equals(string?, string?)\",\n\t\t\"string.Equals(string?, System.StringComparison)\",\n\t\t\"string.Equals(string?, string?, System.StringComparison)\",\n\t];\n\tstatic readonly HashSet<StringComparison> supportedStringComparisons =\n\t[\n\t\tStringComparison.Ordinal,\n\t\tStringComparison.OrdinalIgnoreCase,\n\t];\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\n\tpublic AssertStringEqualityCheckShouldNotUseBoolCheck()\n\t\t: base(Descriptors.X2010_AssertStringEqualityCheckShouldNotUseBoolCheckFixer, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tif (arguments[0].Value is not IInvocationOperation invocationExpression)\n\t\t\treturn;\n\n\t\tvar methodSymbol = invocationExpression.TargetMethod;\n\t\tif (!stringEqualsMethods.Contains(SymbolDisplay.ToDisplayString(methodSymbol)))\n\t\t\treturn;\n\n\t\tvar ignoreCase = string.Empty;\n\n\t\tif (methodSymbol.Parameters.Last().Type.TypeKind == TypeKind.Enum)\n\t\t{\n\t\t\tif (method.Name == Constants.Asserts.False)\n\t\t\t\treturn;\n\n\t\t\tvar stringComparisonExpression = invocationExpression.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, methodSymbol.Parameters.Last()))?.Value;\n\t\t\tvar stringComparison = (StringComparison?)(stringComparisonExpression?.ConstantValue.Value as int?);\n\t\t\tif (!stringComparison.HasValue || !supportedStringComparisons.Contains(stringComparison.Value))\n\t\t\t\treturn;\n\n\t\t\tignoreCase = stringComparison == StringComparison.OrdinalIgnoreCase ? bool.TrueString : bool.FalseString;\n\t\t}\n\n\t\tvar replacement =\n\t\t\tmethod.Name == Constants.Asserts.True\n\t\t\t\t? Constants.Asserts.Equal\n\t\t\t\t: Constants.Asserts.NotEqual;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.AssertMethodName] = method.Name;\n\t\tbuilder[Constants.Properties.IsStaticMethodCall] = methodSymbol.IsStatic ? bool.TrueString : bool.FalseString;\n\t\tbuilder[Constants.Properties.IgnoreCase] = ignoreCase;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2010_AssertStringEqualityCheckShouldNotUseBoolCheckFixer,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertSubstringCheckShouldNotUseBoolCheck.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertSubstringCheckShouldNotUseBoolCheck : AssertUsageAnalyzerBase\n{\n\tprivate static readonly HashSet<string> substringMethods =\n\t[\n\t\t// Signatures without nullable variants\n\t\t\"string.Contains(string)\",\n\t\t\"string.StartsWith(string)\",\n\t\t\"string.StartsWith(string, System.StringComparison)\",\n\t\t\"string.EndsWith(string)\",\n\t\t\"string.EndsWith(string, System.StringComparison)\",\n\t];\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\n\tpublic AssertSubstringCheckShouldNotUseBoolCheck()\n\t\t: base(Descriptors.X2009_AssertSubstringCheckShouldNotUseBoolCheck, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tif (arguments[0].Value is not IInvocationOperation invocationExpression)\n\t\t\treturn;\n\n\t\tvar methodSymbol = invocationExpression.TargetMethod;\n\t\tif (!substringMethods.Contains(SymbolDisplay.ToDisplayString(methodSymbol)))\n\t\t\treturn;\n\n\t\tif (methodSymbol.Name != Constants.Asserts.Contains && method.Name == Constants.Asserts.False)\n\t\t\treturn;\n\n\t\tvar replacement = GetReplacementMethodName(method.Name, methodSymbol.Name);\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.AssertMethodName] = method.Name;\n\t\tbuilder[Constants.Properties.SubstringMethodName] = methodSymbol.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2009_AssertSubstringCheckShouldNotUseBoolCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\tstatic string GetReplacementMethodName(\n\t\tstring assertMethodName,\n\t\tstring substringMethodName)\n\t{\n\t\tif (substringMethodName == nameof(string.Contains))\n\t\t\treturn assertMethodName == Constants.Asserts.True ? Constants.Asserts.Contains : Constants.Asserts.DoesNotContain;\n\n\t\treturn substringMethodName;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertThrowsShouldNotBeUsedForAsyncThrowsCheck.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertThrowsShouldNotBeUsedForAsyncThrowsCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Throws,\n\t\tConstants.Asserts.ThrowsAny,\n\t];\n\n\tpublic AssertThrowsShouldNotBeUsedForAsyncThrowsCheck()\n\t\t: base([Descriptors.X2014_AssertThrowsShouldNotBeUsedForAsyncThrowsCheck], targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length is < 1 or > 2)\n\t\t\treturn;\n\n\t\tvar throwExpressionSymbol = GetThrowExpressionSymbol(invocationOperation);\n\t\tif (!ThrowExpressionReturnsTask(throwExpressionSymbol, context))\n\t\t\treturn;\n\n\t\tvar replacement = method.Name + \"Async\";\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.Replacement] = replacement;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2014_AssertThrowsShouldNotBeUsedForAsyncThrowsCheck,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tSymbolDisplay.ToDisplayString(\n\t\t\t\t\tmethod,\n\t\t\t\t\tSymbolDisplayFormat\n\t\t\t\t\t\t.CSharpShortErrorMessageFormat\n\t\t\t\t\t\t.WithParameterOptions(SymbolDisplayParameterOptions.None)\n\t\t\t\t\t\t.WithGenericsOptions(SymbolDisplayGenericsOptions.None)\n\t\t\t\t),\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n\n\tstatic ISymbol? GetThrowExpressionSymbol(IInvocationOperation invocationOperation)\n\t{\n\t\tvar argument = invocationOperation.Arguments.LastOrDefault()?.Value;\n\n\t\tif (argument is IDelegateCreationOperation delegateCreation)\n\t\t{\n\t\t\tif (delegateCreation.Target is IAnonymousFunctionOperation anonymousFunction)\n\t\t\t{\n\t\t\t\tIOperation? symbolOperation = null;\n\t\t\t\tif (anonymousFunction.Body.Operations.Length == 2\n\t\t\t\t\t&& anonymousFunction.Body.Operations[0] is IExpressionStatementOperation expressionStatement\n\t\t\t\t\t&& anonymousFunction.Body.Operations[1] is IReturnOperation { ReturnedValue: null })\n\t\t\t\t{\n\t\t\t\t\tsymbolOperation = expressionStatement.Operation;\n\t\t\t\t}\n\t\t\t\telse if (anonymousFunction.Body.Operations.Length == 1\n\t\t\t\t\t&& anonymousFunction.Body.Operations[0] is IReturnOperation { ReturnedValue: { } returnedValue })\n\t\t\t\t{\n\t\t\t\t\tsymbolOperation = returnedValue.WalkDownImplicitConversions();\n\t\t\t\t}\n\n\t\t\t\tif (symbolOperation is IAwaitOperation awaitOperation)\n\t\t\t\t\tsymbolOperation = awaitOperation.Operation.WalkDownImplicitConversions();\n\t\t\t\tif (symbolOperation is IInvocationOperation symbolInvoke)\n\t\t\t\t\treturn symbolInvoke.TargetMethod;\n\t\t\t\telse if (symbolOperation is ILiteralOperation)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse if (delegateCreation.Target is IMethodReferenceOperation methodReference)\n\t\t\t\treturn methodReference.Method;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic bool ThrowExpressionReturnsTask(\n\t\tISymbol? symbol,\n\t\tOperationAnalysisContext context)\n\t{\n\t\tif (symbol?.Kind != SymbolKind.Method)\n\t\t\treturn false;\n\t\tif (symbol is not IMethodSymbol methodSymbol)\n\t\t\treturn false;\n\n\t\tvar returnType = methodSymbol.ReturnType;\n\n\t\tvar taskType = TypeSymbolFactory.Task(context.Compilation);\n\t\tif (taskType.IsAssignableFrom(returnType))\n\t\t\treturn true;\n\n\t\tvar configuredTaskAwaitableType = TypeSymbolFactory.ConfiguredTaskAwaitable(context.Compilation);\n\t\tif (configuredTaskAwaitableType.IsAssignableFrom(returnType))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssertThrowsShouldUseGenericOverloadCheck.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssertThrowsShouldUseGenericOverloadCheck : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Throws,\n\t\tConstants.Asserts.ThrowsAsync,\n\t];\n\n\tpublic AssertThrowsShouldUseGenericOverloadCheck()\n\t\t: base(Descriptors.X2015_AssertThrowsShouldUseGenericOverload, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar parameters = invocationOperation.TargetMethod.Parameters;\n\t\tif (parameters.Length != 2)\n\t\t\treturn;\n\n\t\tvar typeArgument = invocationOperation.Arguments.FirstOrDefault(arg => SymbolEqualityComparer.Default.Equals(arg.Parameter, parameters[0]))?.Value;\n\t\tif (typeArgument is not ITypeOfOperation typeOfOperation)\n\t\t\treturn;\n\n\t\tvar type = typeOfOperation.TypeOperand;\n\t\tvar typeName = SymbolDisplay.ToDisplayString(type);\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.TypeName] = typeName;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2015_AssertThrowsShouldUseGenericOverload,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tmethod.Name,\n\t\t\t\ttypeName\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AssignableFromAssertionIsConfusinglyNamed.cs",
    "content": "using System.Collections.Generic;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AssignableFromAssertionIsConfusinglyNamed : AssertUsageAnalyzerBase\n{\n\tpublic static readonly Dictionary<string, string> ReplacementMethods = new()\n\t{\n\t\t{ Constants.Asserts.IsAssignableFrom, Constants.Asserts.IsType },\n\t\t{ Constants.Asserts.IsNotAssignableFrom, Constants.Asserts.IsNotType },\n\t};\n\n\tpublic AssignableFromAssertionIsConfusinglyNamed() :\n\t\tbase(Descriptors.X2032_AssignableFromAssertionIsConfusinglyNamed, ReplacementMethods.Keys)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (!xunitContext.Assert.SupportsInexactTypeAssertions)\n\t\t\treturn;\n\n\t\tif (!ReplacementMethods.TryGetValue(invocationOperation.TargetMethod.Name, out var replacement))\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2032_AssignableFromAssertionIsConfusinglyNamed,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tinvocationOperation.TargetMethod.Name,\n\t\t\t\treplacement\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/AsyncAssertsShouldBeAwaited.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class AsyncAssertsShouldBeAwaited : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.AllAsync,\n\t\tConstants.Asserts.CollectionAsync,\n\t\tConstants.Asserts.PropertyChangedAsync,\n\t\tConstants.Asserts.RaisesAnyAsync,\n\t\tConstants.Asserts.RaisesAsync,\n\t\tConstants.Asserts.ThrowsAnyAsync,\n\t\tConstants.Asserts.ThrowsAsync,\n\t];\n\n\tpublic AsyncAssertsShouldBeAwaited() :\n\t\tbase(Descriptors.X2021_AsyncAssertionsShouldBeAwaited, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar taskType = TypeSymbolFactory.Task(context.Compilation);\n\t\tvar taskOfTType = TypeSymbolFactory.TaskOfT(context.Compilation)?.ConstructUnboundGenericType();\n\n\t\tfor (IOperation? current = invocationOperation; current is not null; current = current.Parent)\n\t\t{\n\t\t\t// Stop looking when we've hit the enclosing block\n\t\t\tif (current is IBlockOperation)\n\t\t\t\treturn;\n\n\t\t\t// Only interested in something that results in an expression to a named type\n\t\t\tif (current is not IExpressionStatementOperation expression || expression.Operation.Type is not INamedTypeSymbol namedReturnType)\n\t\t\t\tcontinue;\n\n\t\t\tif (namedReturnType.IsGenericType)\n\t\t\t{\n\t\t\t\t// Does it return Task<T>?\n\t\t\t\tif (!SymbolEqualityComparer.Default.Equals(namedReturnType.ConstructUnboundGenericType(), taskOfTType))\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Does it return Task?\n\t\t\t\tif (!SymbolEqualityComparer.Default.Equals(namedReturnType, taskType))\n\t\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2021_AsyncAssertionsShouldBeAwaited,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tmethod.Name\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/BooleanAssertsShouldNotBeNegated.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class BooleanAssertsShouldNotBeNegated : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\n\tpublic BooleanAssertsShouldNotBeNegated() :\n\t\tbase(Descriptors.X2022_BooleanAssertionsShouldNotBeNegated, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Arguments.Length < 1)\n\t\t\treturn;\n\n\t\tif (invocationOperation.Arguments[0].Value is not IUnaryOperation unaryOperation)\n\t\t\treturn;\n\n\t\tif (!unaryOperation.Syntax.IsKind(SyntaxKind.LogicalNotExpression))\n\t\t\treturn;\n\n\t\tvar suggestedAssertion =\n\t\t\tmethod.Name == Constants.Asserts.False\n\t\t\t\t? Constants.Asserts.True\n\t\t\t\t: Constants.Asserts.False;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.Replacement] = suggestedAssertion;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2022_BooleanAssertionsShouldNotBeNegated,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\tmethod.Name,\n\t\t\t\tsuggestedAssertion\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck : AssertUsageAnalyzerBase\n{\n\tpublic BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck() :\n\t\tbase(\n\t\t\t[\n\t\t\t\tDescriptors.X2024_BooleanAssertionsShouldNotBeUsedForSimpleEqualityCheck,\n\t\t\t\tDescriptors.X2025_BooleanAssertionCanBeSimplified\n\t\t\t],\n\t\t\t[\n\t\t\t\tConstants.Asserts.True,\n\t\t\t\tConstants.Asserts.False\n\t\t\t]\n\t\t)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tif (invocationOperation.Syntax is not InvocationExpressionSyntax invocation)\n\t\t\treturn;\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\t\tif (arguments.Count == 0)\n\t\t\treturn;\n\t\tif (arguments[0].Expression is not BinaryExpressionSyntax binaryArgument)\n\t\t\treturn;\n\n\t\tvar semanticModel = context.Operation.SemanticModel;\n\t\tvar trueMethod = method.Name == Constants.Asserts.True;\n\t\tvar leftKind = LiteralReferenceKind(binaryArgument.Left, semanticModel);\n\t\tvar rightKind = LiteralReferenceKind(binaryArgument.Right, semanticModel);\n\t\tvar literalKind = leftKind ?? rightKind;\n\t\tif (literalKind is null)\n\t\t\treturn;\n\n\t\tbool? isEqualsOperator = binaryArgument.Kind() switch\n\t\t{\n\t\t\tSyntaxKind.EqualsExpression => true,\n\t\t\tSyntaxKind.NotEqualsExpression => false,\n\t\t\t_ => null\n\t\t};\n\t\tif (isEqualsOperator is null)\n\t\t\treturn;\n\n\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\tbuilder[Constants.Properties.MethodName] = method.Name;\n\t\tbuilder[Constants.Properties.LiteralValue] = leftKind is not null ? Constants.Asserts.True : Constants.Asserts.False;\n\n\t\tswitch (literalKind)\n\t\t{\n\t\t\tcase SyntaxKind.TrueLiteralExpression:\n\t\t\tcase SyntaxKind.FalseLiteralExpression:\n\t\t\t\tvar booleanReplacement = (trueMethod == isEqualsOperator, literalKind) switch\n\t\t\t\t{\n\t\t\t\t\t(true, SyntaxKind.TrueLiteralExpression) or (false, SyntaxKind.FalseLiteralExpression) => Constants.Asserts.True,\n\t\t\t\t\t(_, _) => Constants.Asserts.False,\n\t\t\t\t};\n\t\t\t\tbuilder[Constants.Properties.Replacement] = booleanReplacement;\n\t\t\t\tReportShouldSimplifyBooleanOperation(context, invocationOperation, builder.ToImmutable(), method.Name);\n\t\t\t\tbreak;\n\n\t\t\tcase SyntaxKind.NullLiteralExpression:\n\t\t\t\t// Can't rewrite exactly if there is a \"message\" (second) argument\n\t\t\t\tif (arguments.Count > 1)\n\t\t\t\t\treturn;\n\t\t\t\t// Can't rewrite if we're using a pointer and don't support pointers in Null assertions\n\t\t\t\tif (!xunitContext.Assert.SupportsAssertNullWithPointers)\n\t\t\t\t\tif (binaryArgument.Left.IsPointer(semanticModel) || binaryArgument.Right.IsPointer(semanticModel))\n\t\t\t\t\t\treturn;\n\t\t\t\tvar nullReplacement = trueMethod == isEqualsOperator ? Constants.Asserts.Null : Constants.Asserts.NotNull;\n\t\t\t\tbuilder[Constants.Properties.Replacement] = nullReplacement;\n\t\t\t\tReportShouldReplaceBooleanOperationWithEquality(context, invocationOperation, builder.ToImmutable(), method.Name, nullReplacement);\n\t\t\t\tbreak;\n\n\t\t\tcase SyntaxKind.CharacterLiteralExpression:\n\t\t\tcase SyntaxKind.StringLiteralExpression:\n\t\t\tcase SyntaxKind.NumericLiteralExpression:\n\t\t\tcase SyntaxKind.SimpleMemberAccessExpression:\n\t\t\t\t// Can't rewrite exactly if there is a \"message\" (second) argument\n\t\t\t\tif (arguments.Count > 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar equalsReplacement = trueMethod == isEqualsOperator ? Constants.Asserts.Equal : Constants.Asserts.NotEqual;\n\t\t\t\tbuilder[Constants.Properties.Replacement] = equalsReplacement;\n\t\t\t\tReportShouldReplaceBooleanOperationWithEquality(context, invocationOperation, builder.ToImmutable(), method.Name, equalsReplacement);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tpublic static SyntaxKind? LiteralReferenceKind(\n\t\tExpressionSyntax expression,\n\t\tSemanticModel? semanticModel)\n\t{\n\t\tGuard.ArgumentNotNull(expression);\n\n\t\tvar kind = expression.Kind();\n\t\tif (expression is LiteralExpressionSyntax)\n\t\t\treturn kind;\n\n\t\tif (expression.Kind() != SyntaxKind.SimpleMemberAccessExpression)\n\t\t\treturn null;\n\n\t\tvar left = ((MemberAccessExpressionSyntax)expression).Expression;\n\t\tif (left.Kind() != SyntaxKind.IdentifierName)\n\t\t\treturn null;\n\n\t\tvar type = semanticModel?.GetTypeInfo(expression).Type;\n\t\tif (type is not INamedTypeSymbol namedType)\n\t\t\treturn null;\n\n\t\treturn namedType.EnumUnderlyingType is not null ? kind : null;\n\t}\n\n\tstatic void ReportShouldReplaceBooleanOperationWithEquality(\n\t\tOperationAnalysisContext context,\n\t\tIInvocationOperation invocationOperation,\n\t\tImmutableDictionary<string, string?> properties,\n\t\tstring currentMethodName,\n\t\tstring replacement) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2024_BooleanAssertionsShouldNotBeUsedForSimpleEqualityCheck,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tproperties,\n\t\t\t\t\tcurrentMethodName,\n\t\t\t\t\treplacement\n\t\t\t\t)\n\t\t\t);\n\n\tstatic void ReportShouldSimplifyBooleanOperation(\n\t\tOperationAnalysisContext context,\n\t\tIInvocationOperation invocationOperation,\n\t\tImmutableDictionary<string, string?> properties,\n\t\tstring currentMethodName) =>\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2025_BooleanAssertionCanBeSimplified,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tproperties,\n\t\t\t\t\tcurrentMethodName\n\t\t\t\t)\n\t\t\t);\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/DoNotUseAssertEmptyWithProblematicTypes.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotUseAssertEmptyWithProblematicTypes : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Empty,\n\t\tConstants.Asserts.NotEmpty,\n\t];\n\n\tpublic DoNotUseAssertEmptyWithProblematicTypes() :\n\t\tbase(Descriptors.X2028_DoNotUseAssertEmptyWithProblematicTypes, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar semanticModel = context.Operation.SemanticModel;\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 1)\n\t\t\treturn;\n\n\t\tif (method.Parameters.Length != 1)\n\t\t\treturn;\n\n\t\tif (semanticModel.GetTypeInfo(arguments[0].Value.Syntax).Type is not INamedTypeSymbol sourceType)\n\t\t\treturn;\n\n\t\tvar stringValuesType = TypeSymbolFactory.StringValues(context.Compilation);\n\t\tif (stringValuesType is not null && SymbolEqualityComparer.Default.Equals(sourceType, stringValuesType))\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2028_DoNotUseAssertEmptyWithProblematicTypes,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tmethod.Name,\n\t\t\t\t\tsourceType.ToMinimalDisplayString(semanticModel, 0),\n\t\t\t\t\t\"it is implicitly cast to a string, not a collection\"\n\t\t\t\t)\n\t\t\t);\n\n\t\tif (sourceType.IsGenericType)\n\t\t{\n\t\t\tvar arraySegmentType = TypeSymbolFactory.ArraySegmentOfT(context.Compilation)?.ConstructUnboundGenericType();\n\t\t\tif (arraySegmentType is not null && SymbolEqualityComparer.Default.Equals(sourceType.ConstructUnboundGenericType(), arraySegmentType))\n\t\t\t\tcontext.ReportDiagnostic(\n\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\tDescriptors.X2028_DoNotUseAssertEmptyWithProblematicTypes,\n\t\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\t\tmethod.Name,\n\t\t\t\t\t\tsourceType.ToMinimalDisplayString(semanticModel, 0),\n\t\t\t\t\t\t\"its implementation of GetEnumerator() can throw\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/SetEqualityAnalyzer.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class SetEqualityAnalyzer : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t];\n\n\tpublic SetEqualityAnalyzer()\n\t\t: base(\n\t\t\t[\n\t\t\t\tDescriptors.X2026_SetsMustBeComparedWithEqualityComparer,\n\t\t\t\tDescriptors.X2027_SetsShouldNotBeComparedToLinearContainers,\n\t\t\t],\n\t\t\ttargetMethods\n\t\t)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar semanticModel = context.Operation.SemanticModel;\n\t\tif (semanticModel == null)\n\t\t\treturn;\n\n\t\tvar setType = TypeSymbolFactory.ISetOfT(context.Compilation)?.ConstructUnboundGenericType();\n\t\tvar readOnlySetType = TypeSymbolFactory.IReadOnlySetOfT(context.Compilation)?.ConstructUnboundGenericType();\n\t\tvar setInterfaces = new HashSet<INamedTypeSymbol>(new[] { setType, readOnlySetType }.WhereNotNull(), SymbolEqualityComparer.Default);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length < 2)\n\t\t\treturn;\n\n\t\tif (semanticModel.GetTypeInfo(arguments[0].Value.Syntax).Type is not INamedTypeSymbol collection0Type)\n\t\t\treturn;\n\t\tvar interface0Type =\n\t\t\tcollection0Type\n\t\t\t\t.AllInterfaces\n\t\t\t\t.Concat([collection0Type])\n\t\t\t\t.Where(i => i.IsGenericType)\n\t\t\t\t.FirstOrDefault(i => setInterfaces.Contains(i.ConstructUnboundGenericType()));\n\n\t\tif (semanticModel.GetTypeInfo(arguments[1].Value.Syntax).Type is not INamedTypeSymbol collection1Type)\n\t\t\treturn;\n\t\tvar interface1Type =\n\t\t\tcollection1Type\n\t\t\t\t.AllInterfaces\n\t\t\t\t.Concat([collection1Type])\n\t\t\t\t.Where(i => i.IsGenericType)\n\t\t\t\t.FirstOrDefault(i => setInterfaces.Contains(i.ConstructUnboundGenericType()));\n\n\t\t// No sets\n\t\tif (interface0Type is null && interface1Type is null)\n\t\t\treturn;\n\n\t\t// Both sets, make sure they don't use the comparer function override\n\t\tif (interface0Type is not null && interface1Type is not null)\n\t\t{\n\t\t\tif (arguments.Length != 3)\n\t\t\t\treturn;\n\n\t\t\tif (arguments[2].Value is not IDelegateCreationOperation and not ILocalReferenceOperation)\n\t\t\t\treturn;\n\n\t\t\tif (arguments[2].Value.Type is not INamedTypeSymbol funcTypeSymbol || funcTypeSymbol.DelegateInvokeMethod == null)\n\t\t\t\treturn;\n\n\t\t\tvar funcDelegate = funcTypeSymbol.DelegateInvokeMethod;\n\t\t\tvar isFuncOverload =\n\t\t\t\tfuncDelegate.ReturnType.SpecialType == SpecialType.System_Boolean &&\n\t\t\t\tfuncDelegate.Parameters.Length == 2 &&\n\t\t\t\tfuncDelegate.Parameters[0].Type.Equals(interface0Type.TypeArguments[0], SymbolEqualityComparer.Default) &&\n\t\t\t\tfuncDelegate.Parameters[1].Type.Equals(interface1Type.TypeArguments[0], SymbolEqualityComparer.Default);\n\n\t\t\t// Wrong method overload\n\t\t\tif (!isFuncOverload)\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2026_SetsMustBeComparedWithEqualityComparer,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tmethod.Name\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t// One set, one linear container\n\t\telse\n\t\t{\n\t\t\t// Make a special allowance for SortedSet<>, since we know it's sorted\n\t\t\tvar sortedSet = TypeSymbolFactory.SortedSetOfT(context.Compilation);\n\t\t\tif (sortedSet is not null)\n\t\t\t{\n\t\t\t\tif (interface0Type is not null && sortedSet.Construct(interface0Type.TypeArguments[0]).IsAssignableFrom(collection0Type))\n\t\t\t\t\treturn;\n\t\t\t\tif (interface1Type is not null && sortedSet.Construct(interface1Type.TypeArguments[0]).IsAssignableFrom(collection1Type))\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X2027_SetsShouldNotBeComparedToLinearContainers,\n\t\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\t\tcollection0Type.ToMinimalDisplayString(semanticModel, 0),\n\t\t\t\t\tcollection1Type.ToMinimalDisplayString(semanticModel, 0)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X2000/UseAssertFailInsteadOfBooleanAssert.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class UseAssertFailInsteadOfBooleanAssert : AssertUsageAnalyzerBase\n{\n\tstatic readonly string[] targetMethods =\n\t[\n\t\tConstants.Asserts.False,\n\t\tConstants.Asserts.True,\n\t];\n\tstatic readonly Dictionary<string, bool> targetValues = new()\n\t{\n\t\t{ Constants.Asserts.False, true },\n\t\t{ Constants.Asserts.True, false },\n\t};\n\n\tpublic UseAssertFailInsteadOfBooleanAssert()\n\t\t: base(Descriptors.X2020_UseAssertFailInsteadOfBooleanAssert, targetMethods)\n\t{ }\n\n\tprotected override void AnalyzeInvocation(\n\t\tOperationAnalysisContext context,\n\t\tXunitContext xunitContext,\n\t\tIInvocationOperation invocationOperation,\n\t\tIMethodSymbol method)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\t\tGuard.ArgumentNotNull(invocationOperation);\n\t\tGuard.ArgumentNotNull(method);\n\n\t\tvar arguments = invocationOperation.Arguments;\n\t\tif (arguments.Length != 2)\n\t\t\treturn;\n\n\t\tif (!targetValues.TryGetValue(method.Name, out var targetValue))\n\t\t\treturn;\n\n\t\tif (arguments.FirstOrDefault(arg => arg.Parameter?.Ordinal == 0)?.Value is not ILiteralOperation literalFirstArgument)\n\t\t\treturn;\n\t\tif (!literalFirstArgument.ConstantValue.HasValue)\n\t\t\treturn;\n\t\tif (!Equals(literalFirstArgument.ConstantValue.Value, targetValue))\n\t\t\treturn;\n\n\t\tcontext.ReportDiagnostic(\n\t\t\tDiagnostic.Create(\n\t\t\t\tDescriptors.X2020_UseAssertFailInsteadOfBooleanAssert,\n\t\t\t\tinvocationOperation.Syntax.GetLocation(),\n\t\t\t\tmethod.Name,\n\t\t\t\ttargetValue ? \"true\" : \"false\"\n\t\t\t)\n\t\t);\n\t}\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\treturn base.ShouldAnalyze(xunitContext) && xunitContext.Assert.SupportsAssertFail;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X3000/CrossAppDomainClassesMustBeLongLivedMarshalByRefObject.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class CrossAppDomainClassesMustBeLongLivedMarshalByRefObject : XunitV2DiagnosticAnalyzer\n{\n\tpublic CrossAppDomainClassesMustBeLongLivedMarshalByRefObject() :\n\t\tbase(Descriptors.X3000_CrossAppDomainClassesMustBeLongLivedMarshalByRefObject)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not INamedTypeSymbol namedType)\n\t\t\t\treturn;\n\t\t\tif (namedType.TypeKind != TypeKind.Class)\n\t\t\t\treturn;\n\t\t\tif (xunitContext.V2Abstractions is null)\n\t\t\t\treturn;\n\n\t\t\tvar mbroInterfaces = new INamedTypeSymbol?[]\n\t\t\t{\n\t\t\t\txunitContext.V2Abstractions.IAssemblyInfoType,\n\t\t\t\txunitContext.V2Abstractions.IAttributeInfoType,\n\t\t\t\txunitContext.V2Abstractions.IMessageSinkMessageType,\n\t\t\t\txunitContext.V2Abstractions.IMessageSinkType,\n\t\t\t\txunitContext.V2Abstractions.IMethodInfoType,\n\t\t\t\txunitContext.V2Abstractions.IParameterInfoType,\n\t\t\t\txunitContext.V2Abstractions.ISourceInformationProviderType,\n\t\t\t\txunitContext.V2Abstractions.ISourceInformationType,\n\t\t\t\txunitContext.V2Abstractions.ITestAssemblyType,\n\t\t\t\txunitContext.V2Abstractions.ITestCaseType,\n\t\t\t\txunitContext.V2Abstractions.ITestClassType,\n\t\t\t\txunitContext.V2Abstractions.ITestCollectionType,\n\t\t\t\txunitContext.V2Abstractions.ITestFrameworkDiscovererType,\n\t\t\t\txunitContext.V2Abstractions.ITestFrameworkExecutorType,\n\t\t\t\txunitContext.V2Abstractions.ITestFrameworkType,\n\t\t\t\txunitContext.V2Abstractions.ITestMethodType,\n\t\t\t\txunitContext.V2Abstractions.ITestType,\n\t\t\t\txunitContext.V2Abstractions.ITypeInfoType,\n\t\t\t};\n\n\t\t\tif (!mbroInterfaces.Any(t => t.IsAssignableFrom(namedType)))\n\t\t\t\treturn;\n\n\t\t\tvar hasMBRO =\n\t\t\t\t(xunitContext.V2Execution?.LongLivedMarshalByRefObjectType?.IsAssignableFrom(namedType) ?? false) ||\n\t\t\t\t(xunitContext.V2RunnerUtility?.LongLivedMarshalByRefObjectType?.IsAssignableFrom(namedType) ?? false);\n\n\t\t\tif (hasMBRO)\n\t\t\t\treturn;\n\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.NewBaseType] =\n\t\t\t\txunitContext.V2RunnerUtility is not null ? Constants.Types.Xunit.LongLivedMarshalByRefObject_RunnerUtility :\n\t\t\t\txunitContext.V2Execution is not null ? Constants.Types.Xunit.LongLivedMarshalByRefObject_Execution_V2 :\n\t\t\t\tnull;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X3000_CrossAppDomainClassesMustBeLongLivedMarshalByRefObject,\n\t\t\t\t\tnamedType.Locations.First(),\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tnamedType.Name\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\tGuard.ArgumentNotNull(xunitContext).V2Abstractions is not null;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X3000/DoNotTestForConcreteTypeOfJsonSerializableTypes.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Operations;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class DoNotTestForConcreteTypeOfJsonSerializableTypes : XunitV3DiagnosticAnalyzer\n{\n\tpublic DoNotTestForConcreteTypeOfJsonSerializableTypes() :\n\t\tbase(Descriptors.X3002_DoNotTestForConcreteTypeOfJsonSerializableTypes)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar assertType = xunitContext.Assert.AssertType;\n\n\t\tvar jsonTypeIDAttributeType = xunitContext.V3Core?.JsonTypeIDAttributeType;\n\t\tif (jsonTypeIDAttributeType is null)\n\t\t\treturn;\n\n\t\t// \"value is Type\"\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IIsTypeOperation isTypeOperation)\n\t\t\t\treturn;\n\n\t\t\tvar semanticModel = isTypeOperation.SemanticModel;\n\t\t\tif (semanticModel is null)\n\t\t\t\treturn;\n\n\t\t\treportIfMessageType(context.ReportDiagnostic, semanticModel, isTypeOperation.TypeOperand, isTypeOperation.Syntax);\n\t\t}, OperationKind.IsType);\n\n\t\t// \"value is not Type\"\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IIsPatternOperation isPatternOperation)\n\t\t\t\treturn;\n\n\t\t\tvar semanticModel = isPatternOperation.SemanticModel;\n\t\t\tif (semanticModel is null)\n\t\t\t\treturn;\n\n\t\t\tif (isPatternOperation.Pattern is not INegatedPatternOperation negatedPatternOperation)\n\t\t\t\treturn;\n\n#if ROSLYN_LATEST\n\t\t\tif (negatedPatternOperation.ChildOperations.FirstOrDefault() is not ITypePatternOperation typePatternOperation)\n#else\n\t\t\tif (negatedPatternOperation.Children.FirstOrDefault() is not ITypePatternOperation typePatternOperation)\n#endif\n\t\t\t\treturn;\n\n\t\t\treportIfMessageType(context.ReportDiagnostic, semanticModel, typePatternOperation.MatchedType, isPatternOperation.Syntax);\n\t\t}, OperationKind.IsPattern);\n\n\t\t// \"value as Type\"\n\t\t// \"(Type)value\"\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not IConversionOperation conversionOperation)\n\t\t\t\treturn;\n\n\t\t\t// We don't want to prohibit conversion that comes from \"new(...)\"\n\t\t\tif (conversionOperation.Syntax is ImplicitObjectCreationExpressionSyntax)\n\t\t\t\treturn;\n\n\t\t\tvar semanticModel = conversionOperation.SemanticModel;\n\t\t\tif (semanticModel is null)\n\t\t\t\treturn;\n\n\t\t\treportIfMessageType(context.ReportDiagnostic, semanticModel, conversionOperation.Type, conversionOperation.Syntax);\n\t\t}, OperationKind.Conversion);\n\n\t\t// \"typeof(Type)\"\n\t\tcontext.RegisterOperationAction(context =>\n\t\t{\n\t\t\tif (context.Operation is not ITypeOfOperation typeOfOperation)\n\t\t\t\treturn;\n\n\t\t\tvar semanticModel = typeOfOperation.SemanticModel;\n\t\t\tif (semanticModel is null)\n\t\t\t\treturn;\n\n\t\t\treportIfMessageType(context.ReportDiagnostic, semanticModel, typeOfOperation.TypeOperand, typeOfOperation.Syntax);\n\t\t}, OperationKind.TypeOf);\n\n\t\t// \"SomeMethod<Type>()\"\n\t\t// \"GenericType<Type>\"\n\t\tcontext.RegisterSyntaxNodeAction(context =>\n\t\t{\n\t\t\tif (context.Node.ChildNodes().FirstOrDefault() is not TypeArgumentListSyntax typeArgumentListSyntax)\n\t\t\t\treturn;\n\n\t\t\tforeach (var identifierNameSyntax in typeArgumentListSyntax.ChildNodes().OfType<IdentifierNameSyntax>())\n\t\t\t\treportIfMessageType(context.ReportDiagnostic, context.SemanticModel, context.SemanticModel.GetTypeInfo(identifierNameSyntax).ConvertedType, context.Node);\n\t\t}, SyntaxKind.GenericName);\n\n\t\tvoid reportIfMessageType(\n\t\t\tAction<Diagnostic> reportDiagnostic,\n\t\t\tSemanticModel semanticModel,\n\t\t\tITypeSymbol? typeSymbol,\n\t\t\tSyntaxNode syntax)\n\t\t{\n\t\t\tif (typeSymbol is null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var attribute in typeSymbol.GetAttributes())\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, jsonTypeIDAttributeType))\n\t\t\t\t\treportDiagnostic(\n\t\t\t\t\t\tDiagnostic.Create(\n\t\t\t\t\t\t\tDescriptors.X3002_DoNotTestForConcreteTypeOfJsonSerializableTypes,\n\t\t\t\t\t\t\tsyntax.GetLocation(),\n\t\t\t\t\t\t\ttypeSymbol.ToMinimalDisplayString(semanticModel, syntax.SpanStart)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X3000/FactAttributeDerivedClassesShouldProvideSourceInformationConstructor.cs",
    "content": "using System;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class FactAttributeDerivedClassesShouldProvideSourceInformationConstructor() :\n\tXunitV3DiagnosticAnalyzer(Descriptors.X3003_ProvideConstructorForFactAttributeOverride)\n{\n\tstatic readonly Version Version_3_0_0 = new(3, 0, 0);\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tvar factAttributeType = xunitContext.Core.FactAttributeType;\n\t\tif (factAttributeType is null)\n\t\t\treturn;\n\n\t\tvar callerFilePathAttribute = TypeSymbolFactory.CallerFilePathAttribute(context.Compilation);\n\t\tif (callerFilePathAttribute is null)\n\t\t\treturn;\n\n\t\tvar callerLineNumberAttribute = TypeSymbolFactory.CallerLineNumberAttribute(context.Compilation);\n\t\tif (callerLineNumberAttribute is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tvar type = context.Symbol as INamedTypeSymbol;\n\t\t\tif (type is null)\n\t\t\t\treturn;\n\n\t\t\tvar baseType = type.BaseType;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (baseType is null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (SymbolEqualityComparer.Default.Equals(factAttributeType, baseType))\n\t\t\t\t\tbreak;\n\n\t\t\t\tbaseType = baseType.BaseType;\n\t\t\t}\n\n\t\t\tif (type.Constructors.Any(hasSourceInformationParameters))\n\t\t\t\treturn;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X3003_ProvideConstructorForFactAttributeOverride,\n\t\t\t\t\ttype.Locations.First(),\n\t\t\t\t\tSymbolDisplay.ToDisplayString(type)\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\n\t\tbool hasSourceInformationParameters(IMethodSymbol symbol)\n\t\t{\n\t\t\tvar hasCallerFilePath = false;\n\t\t\tvar hasCallerLineNumber = false;\n\n\t\t\tforeach (var parameter in symbol.Parameters)\n\t\t\t\tforeach (var attribute in parameter.GetAttributes().Select(a => a.AttributeClass))\n\t\t\t\t{\n\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(callerFilePathAttribute, attribute))\n\t\t\t\t\t\thasCallerFilePath = true;\n\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(callerLineNumberAttribute, attribute))\n\t\t\t\t\t\thasCallerLineNumber = true;\n\t\t\t\t}\n\n\t\t\treturn hasCallerFilePath && hasCallerLineNumber;\n\t\t}\n\t}\n\n\tprotected override bool ShouldAnalyze(XunitContext xunitContext) =>\n\t\txunitContext?.V3Core is not null && xunitContext.V3Core.Version >= Version_3_0_0;\n}\n"
  },
  {
    "path": "src/xunit.analyzers/X3000/SerializableClassMustHaveParameterlessConstructor.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\n[DiagnosticAnalyzer(LanguageNames.CSharp)]\npublic class SerializableClassMustHaveParameterlessConstructor : XunitDiagnosticAnalyzer\n{\n\tpublic SerializableClassMustHaveParameterlessConstructor() :\n\t\tbase(Descriptors.X3001_SerializableClassMustHaveParameterlessConstructor)\n\t{ }\n\n\tpublic override void AnalyzeCompilation(\n\t\tCompilationStartAnalysisContext context,\n\t\tXunitContext xunitContext)\n\t{\n\t\tGuard.ArgumentNotNull(context);\n\t\tGuard.ArgumentNotNull(xunitContext);\n\n\t\tcontext.RegisterSymbolAction(context =>\n\t\t{\n\t\t\tif (context.Symbol is not INamedTypeSymbol namedType)\n\t\t\t\treturn;\n\t\t\tif (namedType.TypeKind != TypeKind.Class)\n\t\t\t\treturn;\n\t\t\tif (namedType.IsAbstract)\n\t\t\t\treturn;\n\n\t\t\tvar serializableTargetDisplay = GetSerializableTargetDisplay(xunitContext, namedType);\n\t\t\tif (serializableTargetDisplay is null)\n\t\t\t\treturn;\n\n\t\t\tvar parameterlessCtor = namedType.InstanceConstructors.FirstOrDefault(c => c.Parameters.IsEmpty);\n\t\t\tif (parameterlessCtor is not null && parameterlessCtor.DeclaredAccessibility == Accessibility.Public)\n\t\t\t\treturn;\n\n\t\t\tvar builder = ImmutableDictionary.CreateBuilder<string, string?>();\n\t\t\tbuilder[Constants.Properties.IsCtorObsolete] = serializableTargetDisplay.Value.IsCtorObsolete ? bool.TrueString : bool.FalseString;\n\n\t\t\tcontext.ReportDiagnostic(\n\t\t\t\tDiagnostic.Create(\n\t\t\t\t\tDescriptors.X3001_SerializableClassMustHaveParameterlessConstructor,\n\t\t\t\t\tnamedType.Locations.First(),\n\t\t\t\t\tbuilder.ToImmutable(),\n\t\t\t\t\tnamedType.Name,\n\t\t\t\t\tserializableTargetDisplay.Value.DisplayName\n\t\t\t\t)\n\t\t\t);\n\t\t}, SymbolKind.NamedType);\n\t}\n\n\tstatic (string DisplayName, bool IsCtorObsolete)? GetSerializableTargetDisplay(\n\t\tXunitContext xunitContext,\n\t\tINamedTypeSymbol namedType)\n\t{\n\t\t// Types that implement IRunnerReporter (v3 only)\n\t\tif (xunitContext.V3RunnerCommon?.IRunnerReporterType?.IsAssignableFrom(namedType) == true)\n\t\t\treturn (xunitContext.V3RunnerCommon.IRunnerReporterType.ToDisplayString(), false);\n\n\t\t// Types that implement IXunitSerializable\n\t\tif (xunitContext.Common.IXunitSerializableType?.IsAssignableFrom(namedType) == true)\n\t\t\treturn (xunitContext.Common.IXunitSerializableType.ToDisplayString(), true);\n\n\t\t// Types that implement IXunitSerializer\n\t\tif (xunitContext.V3Common?.IXunitSerializerType?.IsAssignableFrom(namedType) == true)\n\t\t\treturn (xunitContext.V3Common.IXunitSerializerType.ToDisplayString(), false);\n\n\t\t// Types that decorate with [JsonTypeID]\n\t\tif (xunitContext.V3Core?.JsonTypeIDAttributeType is INamedTypeSymbol jsonTypeIDAttributeType)\n\t\t\tif (namedType.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, jsonTypeIDAttributeType)))\n\t\t\t\treturn (jsonTypeIDAttributeType.ToDisplayString(), true);\n\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers/xunit.analyzers.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <RootNamespace>Xunit.Analyzers</RootNamespace>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "src/xunit.analyzers/xunit.analyzers.nuspec",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd\">\n\t<metadata minClientVersion=\"2.12\">\n\t\t<id>xunit.analyzers</id>\n\t\t<version>$PackageVersion$</version>\n\t\t<title>xUnit.net [Code Analyzers]</title>\n\t\t<authors>jnewkirk,bradwilson,marcind</authors>\n\t\t<requireLicenseAcceptance>false</requireLicenseAcceptance>\n\t\t<license type=\"expression\">Apache-2.0</license>\n\t\t<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl>\n\t\t<icon>_content/logo-128-transparent.png</icon>\n\t\t<description>xUnit.net is a developer testing framework, built to support Test Driven Development, with a design goal of extreme simplicity and alignment with framework features.\n\nInstalling this package provides code analyzers to help developers find and fix frequent issues when writing tests and xUnit.net extensibility code.</description>\n\t\t<copyright>Copyright (C) .NET Foundation</copyright>\n\t\t<repository type=\"git\" url=\"https://github.com/xunit/xunit.analyzers\" commit=\"$GitCommitId$\" />\n\t\t<developmentDependency>true</developmentDependency>\n\t\t<tags>xunit.analyzers, analyzers, roslyn, xunit, xunit.net</tags>\n\t\t<readme>_content/README.md</readme>\n\t\t<releaseNotes>https://xunit.net/releases/analyzers/$PackageVersion$</releaseNotes>\n\t</metadata>\n\t<files>\n\t\t<file target=\"_content\\\" src=\"..\\..\\README.md\" />\n\t\t<file target=\"_content\\\" src=\"..\\..\\tools\\media\\logo-128-transparent.png\" />\n\n\t\t<file target=\"analyzers\\dotnet\\cs\\\" src=\"..\\xunit.analyzers\\bin\\$Configuration$\\netstandard2.0\\$SignedPath$xunit.analyzers.dll\" />\n\t\t<file target=\"analyzers\\dotnet\\cs\\\" src=\"..\\xunit.analyzers.fixes\\bin\\$Configuration$\\netstandard2.0\\$SignedPath$xunit.analyzers.fixes.dll\" />\n\n\t\t<file target=\"tools\\\" src=\"..\\xunit.analyzers.fixes\\tools\\*.ps1\" />\n\t</files>\n</package>\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyCompany(\".NET Foundation\")]\n[assembly: AssemblyProduct(\"xUnit.net Testing Framework\")]\n[assembly: AssemblyCopyright(\"Copyright (C) .NET Foundation\")]\n[assembly: AssemblyTitle(\"xUnit.net Code Analysis (Fixers)\")]\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/AsyncHelper.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic static class AsyncHelper\n{\n\tstatic TypeSyntax? ConvertActionTypeToAsyncFunctionType(\n\t\tINamedTypeSymbol declarationTypeSymbol,\n\t\tCompilation compilation,\n\t\tDocumentEditor editor)\n\t{\n\t\tvar taskTypeSymbol = TypeSymbolFactory.Task(compilation);\n\t\tif (taskTypeSymbol is null)\n\t\t\treturn null;\n\n\t\tvar unboundFunctionTypeSymbol = TypeSymbolFactory.Func(compilation, declarationTypeSymbol.Arity + 1);\n\t\tif (unboundFunctionTypeSymbol is null)\n\t\t\treturn null;\n\n\t\tvar typeArgumentsLength = declarationTypeSymbol.TypeArguments.Length + 1;\n\t\tvar typeArguments = new ITypeSymbol[typeArgumentsLength];\n\t\tvar returnTypeIndex = typeArgumentsLength - 1;\n\t\tdeclarationTypeSymbol.TypeArguments.CopyTo(typeArguments);\n\t\ttypeArguments[returnTypeIndex] = taskTypeSymbol;\n\n\t\tvar constructedFunctionTypeSymbol =\n\t\t\tunboundFunctionTypeSymbol\n\t\t\t\t.Construct([.. typeArguments])\n\t\t\t\t.WithNullableAnnotation(declarationTypeSymbol.NullableAnnotation);\n\n\t\treturn editor.Generator.TypeExpression(constructedFunctionTypeSymbol) as TypeSyntax;\n\t}\n\n\tstatic TypeSyntax? ConvertFunctionTypeToAsyncFunctionType(\n\t\tINamedTypeSymbol declarationTypeSymbol,\n\t\tCompilation compilation,\n\t\tDocumentEditor editor)\n\t{\n\t\tvar taskTypeSymbol = TypeSymbolFactory.Task(compilation);\n\t\tif (taskTypeSymbol is null)\n\t\t\treturn null;\n\n\t\tvar unboundTaskTypeSymbol = TypeSymbolFactory.TaskOfT(compilation);\n\t\tif (unboundTaskTypeSymbol is null)\n\t\t\treturn null;\n\n\t\tvar unboundFunctionTypeSymbol = TypeSymbolFactory.Func(compilation, declarationTypeSymbol.Arity);\n\t\tif (unboundFunctionTypeSymbol is null)\n\t\t\treturn null;\n\n\t\tvar returnTypeIndex = declarationTypeSymbol.TypeArguments.Length - 1;\n\t\tvar returnTypeSymbol = declarationTypeSymbol.TypeArguments[returnTypeIndex];\n\n\t\t// Function return type is already a task.\n\t\tif (taskTypeSymbol.IsAssignableFrom(returnTypeSymbol))\n\t\t\treturn null;\n\n\t\tvar typeArguments = declarationTypeSymbol.TypeArguments.ToArray();\n\t\tvar constructedTaskTypeSymbol = unboundTaskTypeSymbol.Construct(returnTypeSymbol);\n\t\ttypeArguments[returnTypeIndex] = constructedTaskTypeSymbol;\n\n\t\tvar constructedFunctionTypeSymbol =\n\t\t\tunboundFunctionTypeSymbol\n\t\t\t\t.Construct(typeArguments)\n\t\t\t\t.WithNullableAnnotation(declarationTypeSymbol.NullableAnnotation);\n\n\t\treturn editor.Generator.TypeExpression(constructedFunctionTypeSymbol) as TypeSyntax;\n\t}\n\n\t/// <summary>\n\t/// Get a list of modifiers with the <see langword=\"async\"/> keyword added if not already present.\n\t/// </summary>\n\tpublic static SyntaxTokenList GetModifiersWithAsyncKeywordAdded(SyntaxTokenList modifiers)\n\t{\n\t\treturn modifiers.Any(SyntaxKind.AsyncKeyword)\n\t\t\t? modifiers\n\t\t\t: modifiers.Add(Token(SyntaxKind.AsyncKeyword));\n\t}\n\n\t/// <summary>\n\t/// Convert a return type to the corresponding async return type, if possible.\n\t/// <para>\n\t/// If the return type is already a <see cref=\"Task\"/> or <see cref=\"Task{TResult}\"/>, then <see langword=\"null\"/> is returned.\n\t/// If the return type is <see langword=\"void\"/>, then a <see cref=\"Task\"/> return type is returned.\n\t/// If the return type is another type, then a <see cref=\"Task{TResult}\"/> of that type is returned.\n\t/// However, if symbols cannot be accessed or created through the semantic model, then <see langword=\"null\"/> is returned.\n\t/// </para>\n\t/// </summary>\n\tpublic static async Task<TypeSyntax?> GetAsyncReturnType(\n\t\tTypeSyntax returnType,\n\t\tDocumentEditor editor,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(returnType);\n\t\tGuard.ArgumentNotNull(editor);\n\n\t\tvar semanticModel = await editor.OriginalDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null\n\t\t\t&& semanticModel.GetSymbolInfo(returnType, cancellationToken).Symbol is ITypeSymbol returnTypeSymbol\n\t\t\t&& TypeSymbolFactory.Task(semanticModel.Compilation) is INamedTypeSymbol taskTypeSymbol)\n\t\t{\n\t\t\tif (returnType is PredefinedTypeSyntax predefinedReturnType && predefinedReturnType.Keyword.IsKind(SyntaxKind.VoidKeyword))\n\t\t\t\treturn editor.Generator.TypeExpression(taskTypeSymbol) as TypeSyntax;\n\n\t\t\t// Return type is already a task.\n\t\t\tif (taskTypeSymbol.IsAssignableFrom(returnTypeSymbol))\n\t\t\t\treturn null;\n\n\t\t\tif (TypeSymbolFactory.TaskOfT(semanticModel.Compilation) is INamedTypeSymbol unboundTaskTypeSymbol)\n\t\t\t{\n\t\t\t\tvar constructedTaskTypeSymbol = unboundTaskTypeSymbol.Construct(returnTypeSymbol);\n\t\t\t\treturn editor.Generator.TypeExpression(constructedTaskTypeSymbol) as TypeSyntax;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/// <summary>\n\t/// Convert an anonymous function's declaration type to the corresponding async system delegate type, if possible.\n\t/// <para>\n\t/// If the anonymous function's declaration type is not <see langword=\"var\"/>, and if it is a delegate type,\n\t/// and if it is equal to the anonymous function's inferred converted type (a system delegate type such as\n\t/// <see cref=\"Action\"/>, <see cref=\"Action{T}\"/>, <see cref=\"Func{TResult}\"/>, etc.), then the converted\n\t/// async system delegate type is returned. Otherwise, or if symbols cannot be accessed or created through\n\t/// the semantic model, then <see langword=\"null\"/> is returned.\n\t/// </para>\n\t/// <para>\n\t/// <see cref=\"Action\"/> is converted to a <see cref=\"Func{TResult}\"/> returning <see cref=\"Task\"/>,\n\t/// and <see cref=\"Action{T}\"/> is converted to a <see cref=\"Func{T, TResult}\"/> returning <see cref=\"Task\"/>, etc.\n\t/// </para>\n\t/// <para>\n\t/// <see cref=\"Func{TResult}\"/> is converted to a <see cref=\"Func{TResult}\"/> returning <see cref=\"Task{TResult}\"/>,\n\t/// if it is not already, and <see cref=\"Func{T, TResult}\"/> is converted to a <see cref=\"Func{T, TResult}\"/>\n\t/// returning <see cref=\"Task{TResult}\"/>, if it is not already, etc.\n\t/// </para>\n\t/// </summary>\n\tpublic static async Task<TypeSyntax?> GetAsyncSystemDelegateType(\n\t\tVariableDeclarationSyntax declaration,\n\t\tAnonymousFunctionExpressionSyntax anonymousFunction,\n\t\tDocumentEditor editor,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(declaration);\n\t\tGuard.ArgumentNotNull(anonymousFunction);\n\t\tGuard.ArgumentNotNull(editor);\n\n\t\tvar semanticModel = await editor.OriginalDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null\n\t\t\t&& semanticModel.GetTypeInfo(declaration.Type, cancellationToken).Type is INamedTypeSymbol declarationTypeSymbol\n\t\t\t&& !declaration.Type.IsVar\n\t\t\t&& declarationTypeSymbol.TypeKind == TypeKind.Delegate\n\t\t\t&& semanticModel.GetTypeInfo(anonymousFunction, cancellationToken).ConvertedType is ITypeSymbol functionTypeSymbol\n\t\t\t&& editor.Generator.TypeExpression(declarationTypeSymbol) is TypeSyntax declaredType\n\t\t\t&& editor.Generator.TypeExpression(functionTypeSymbol) is TypeSyntax functionType\n\t\t\t&& declaredType.IsEquivalentTo(functionType))\n\t\t{\n\t\t\tvar compilation = semanticModel.Compilation;\n\n\t\t\tif (IsSystemActionType(declarationTypeSymbol, compilation))\n\t\t\t\treturn ConvertActionTypeToAsyncFunctionType(declarationTypeSymbol, compilation, editor);\n\n\t\t\tif (IsSystemFunctionType(declarationTypeSymbol, compilation))\n\t\t\t\treturn ConvertFunctionTypeToAsyncFunctionType(declarationTypeSymbol, compilation, editor);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tstatic bool IsSystemActionType(\n\t\tINamedTypeSymbol typeSymbol,\n\t\tCompilation compilation)\n\t{\n\t\tvar arity = typeSymbol.Arity;\n\n\t\tif (typeSymbol.Name == \"Action\")\n\t\t{\n\t\t\tif (arity == 0)\n\t\t\t\treturn SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, TypeSymbolFactory.Action(compilation));\n\n\t\t\tif (arity is >= 1 and <= 16)\n\t\t\t\treturn SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, TypeSymbolFactory.Action(compilation, arity));\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tstatic bool IsSystemFunctionType(\n\t\tINamedTypeSymbol typeSymbol,\n\t\tCompilation compilation)\n\t{\n\t\tvar arity = typeSymbol.Arity;\n\n\t\tif (typeSymbol.Name == \"Func\" && arity >= 1 && arity <= 17)\n\t\t\treturn SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, TypeSymbolFactory.Func(compilation, arity));\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/CodeAnalysisExtensions.cs",
    "content": "using System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Simplification;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic static class CodeAnalysisExtensions\n{\n\tpublic static async Task<Document> AddConstructor(\n\t\tthis Document document,\n\t\tClassDeclarationSyntax declaration,\n\t\tstring typeDisplayName,\n\t\tstring typeName,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(document);\n\t\tGuard.ArgumentNotNull(declaration);\n\t\tGuard.ArgumentNotNull(typeDisplayName);\n\t\tGuard.ArgumentNotNull(typeName);\n\n#pragma warning disable CA1308 // These are display names, not normalizations for comparison\n\n\t\t// TODO: Make this respect the user's preferences on identifier name style\n\t\tvar fieldName = \"_\" + typeName.Substring(0, 1).ToLowerInvariant() + typeName.Substring(1);\n\t\tvar constructorArgName = typeName.Substring(0, 1).ToLowerInvariant() + typeName.Substring(1);\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n#pragma warning restore CA1308\n\n\t\tvar fieldDeclaration =\n\t\t\tFieldDeclaration(\n\t\t\t\tVariableDeclaration(ParseTypeName(typeDisplayName))\n\t\t\t\t.WithVariables(SingletonSeparatedList(VariableDeclarator(Identifier(fieldName))))\n\t\t\t)\n\t\t\t.WithModifiers(TokenList(Token(SyntaxKind.PrivateKeyword), Token(SyntaxKind.ReadOnlyKeyword)));\n\n\t\tvar constructor =\n\t\t\tConstructorDeclaration(Identifier(declaration.Identifier.Text))\n\t\t\t.WithModifiers(TokenList(Token(SyntaxKind.PublicKeyword)))\n\t\t\t.WithParameterList(\n\t\t\t\tParameterList(\n\t\t\t\t\tSingletonSeparatedList(\n\t\t\t\t\t\tParameter(Identifier(constructorArgName))\n\t\t\t\t\t\t.WithType(ParseTypeName(typeDisplayName))\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.WithBody(\n\t\t\t\tBlock(\n\t\t\t\t\tSingletonList<StatementSyntax>(\n\t\t\t\t\t\tExpressionStatement(\n\t\t\t\t\t\t\tAssignmentExpression(\n\t\t\t\t\t\t\t\tSyntaxKind.SimpleAssignmentExpression,\n\t\t\t\t\t\t\t\tIdentifierName(fieldName),\n\t\t\t\t\t\t\t\tIdentifierName(constructorArgName)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\teditor.InsertMembers(declaration, 0, [fieldDeclaration, constructor]);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tpublic static async Task<Document> ChangeAccessibility(\n\t\tthis Document document,\n\t\tSyntaxNode declaration,\n\t\tAccessibility accessibility,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(document);\n\t\tGuard.ArgumentNotNull(declaration);\n\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\teditor.SetAccessibility(declaration, accessibility);\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tpublic static async Task<Solution> ChangeMemberAccessibility(\n\t\tthis Solution solution,\n\t\tISymbol memberSymbol,\n\t\tAccessibility accessibility,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(solution);\n\t\tGuard.ArgumentNotNull(memberSymbol);\n\n\t\tvar editor = SymbolEditor.Create(solution);\n\n\t\tawait editor.EditAllDeclarationsAsync(\n\t\t\tmemberSymbol,\n\t\t\t(docEditor, syntaxNode) => docEditor.SetAccessibility(syntaxNode, accessibility),\n\t\t\tcancellationToken\n\t\t).ConfigureAwait(false);\n\n\t\treturn editor.ChangedSolution;\n\t}\n\n\tpublic static async Task<Solution> ChangeMemberStaticModifier(\n\t\tthis Solution solution,\n\t\tISymbol memberSymbol,\n\t\tbool isStatic,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(solution);\n\t\tGuard.ArgumentNotNull(memberSymbol);\n\n\t\tvar editor = SymbolEditor.Create(solution);\n\n\t\tawait editor.EditAllDeclarationsAsync(\n\t\t\tmemberSymbol,\n\t\t\t(docEditor, syntaxNode) =>\n\t\t\t{\n\t\t\t\tvar newMods = DeclarationModifiers.From(memberSymbol).WithIsStatic(isStatic);\n\t\t\t\tif (memberSymbol is IPropertySymbol propertySymbol && propertySymbol.IsReadOnly)\n\t\t\t\t{\n\t\t\t\t\t// Looks like there's a bug in Roslyn where SetModifiers applies the 'readonly'\n\t\t\t\t\t// keyword to a get-only property, producing illegal syntax.\n\t\t\t\t\tnewMods = newMods.WithIsReadOnly(false);\n\t\t\t\t}\n\t\t\t\tdocEditor.SetModifiers(syntaxNode, newMods);\n\t\t\t},\n\t\t\tcancellationToken\n\t\t).ConfigureAwait(false);\n\n\t\treturn editor.ChangedSolution;\n\t}\n\n\tpublic static async Task<Solution> ChangeMemberType(\n\t\tthis Solution solution,\n\t\tISymbol memberSymbol,\n\t\tITypeSymbol type,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(solution);\n\t\tGuard.ArgumentNotNull(memberSymbol);\n\t\tGuard.ArgumentNotNull(type);\n\n\t\tvar editor = SymbolEditor.Create(solution);\n\n\t\tawait editor.EditAllDeclarationsAsync(\n\t\t\tmemberSymbol,\n\t\t\t(docEditor, syntaxNode) => docEditor.SetType(syntaxNode, docEditor.Generator.TypeExpression(type)),\n\t\t\tcancellationToken\n\t\t).ConfigureAwait(false);\n\n\t\treturn editor.ChangedSolution;\n\t}\n\n\tpublic static async Task<Document> RemoveNode(\n\t\tthis Document document,\n\t\tSyntaxNode node,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(document);\n\t\tGuard.ArgumentNotNull(node);\n\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\teditor.RemoveNode(node);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tpublic static async Task<Document> ExtractNodeFromParent(\n\t\tthis Document document,\n\t\tSyntaxNode node,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(document);\n\t\tGuard.ArgumentNotNull(node);\n\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar parent = node.Parent;\n\n\t\tif (parent is not null)\n\t\t{\n\t\t\teditor.RemoveNode(node);\n\n\t\t\tvar formattedNode =\n\t\t\t\tnode\n\t\t\t\t\t.WithLeadingTrivia(ElasticMarker)\n\t\t\t\t\t.WithTrailingTrivia(ElasticMarker)\n\t\t\t\t\t.WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);\n\n\t\t\teditor.InsertAfter(parent, formattedNode);\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tpublic static async Task<Document> SetBaseClass(\n\t\tthis Document document,\n\t\tClassDeclarationSyntax declaration,\n\t\tstring baseType,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tGuard.ArgumentNotNull(document);\n\t\tGuard.ArgumentNotNull(declaration);\n\t\tGuard.ArgumentNotNull(baseType);\n\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar generator = editor.Generator;\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null)\n\t\t{\n\t\t\tvar baseTypeMetadata = semanticModel.Compilation.GetTypeByMetadataName(baseType);\n\t\t\tif (baseTypeMetadata is not null)\n\t\t\t{\n\t\t\t\tvar baseTypeNode = generator.TypeExpression(baseTypeMetadata);\n\t\t\t\tvar baseTypes = generator.GetBaseAndInterfaceTypes(declaration);\n\n\t\t\t\tvar updatedDeclaration =\n\t\t\t\t\tbaseTypes is null || baseTypes.Count == 0 || semanticModel.GetTypeInfo(baseTypes[0], cancellationToken).Type?.TypeKind != TypeKind.Class\n\t\t\t\t\t\t? generator.AddBaseType(declaration, baseTypeNode)\n\t\t\t\t\t\t: generator.ReplaceNode(declaration, baseTypes[0], baseTypeNode);\n\n\t\t\t\teditor.ReplaceNode(declaration, updatedDeclaration);\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/ConvertAttributeCodeAction.cs",
    "content": "using System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic class ConvertAttributeCodeAction(\n\tstring title,\n\tstring equivalenceKey,\n\tDocument document,\n\tSyntaxList<AttributeListSyntax> attributeLists,\n\tstring fromTypeName,\n\tstring toTypeName) :\n\t\tCodeAction\n{\n\treadonly Document document = Guard.ArgumentNotNull(document);\n\treadonly string fromTypeName = Guard.ArgumentNotNull(fromTypeName);\n\treadonly string toTypeName = Guard.ArgumentNotNull(toTypeName);\n\n\tpublic override string EquivalenceKey { get; } = Guard.ArgumentNotNull(equivalenceKey);\n\n\tpublic override string Title { get; } = Guard.ArgumentNotNull(title);\n\n\tprotected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null)\n\t\t{\n\t\t\tvar fromTypeSymbol = semanticModel.Compilation.GetTypeByMetadataName(fromTypeName);\n\n\t\t\tif (fromTypeSymbol is not null)\n\t\t\t\tforeach (var attributeList in attributeLists)\n\t\t\t\t\tforeach (var attribute in attributeList.Attributes)\n\t\t\t\t\t{\n\t\t\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\t\t\tvar currentType = semanticModel.GetTypeInfo(attribute, cancellationToken).Type;\n\t\t\t\t\t\tif (SymbolEqualityComparer.Default.Equals(currentType, fromTypeSymbol))\n\t\t\t\t\t\t\teditor.SetName(attribute, toTypeName);\n\t\t\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/RemoveAttributesOfTypeCodeAction.cs",
    "content": "using System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic class RemoveAttributesOfTypeCodeAction(\n\tstring title,\n\tstring equivalenceKey,\n\tDocument document,\n\tSyntaxList<AttributeListSyntax> attributeLists,\n\tstring attributeType,\n\tbool exactMatch = false) :\n\t\tCodeAction\n{\n\treadonly string attributeType = Guard.ArgumentNotNull(attributeType);\n\treadonly Document document = Guard.ArgumentNotNull(document);\n\n\tpublic override string EquivalenceKey { get; } = Guard.ArgumentNotNull(equivalenceKey);\n\n\tpublic override string Title { get; } = Guard.ArgumentNotNull(title);\n\n\tprotected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null)\n\t\t{\n\t\t\tvar dataAttributeType = semanticModel.Compilation.GetTypeByMetadataName(attributeType);\n\n\t\t\tif (dataAttributeType is not null)\n\t\t\t\tforeach (var attributeList in attributeLists)\n\t\t\t\t\tforeach (var attribute in attributeList.Attributes)\n\t\t\t\t\t\tif (dataAttributeType.IsAssignableFrom(semanticModel.GetTypeInfo(attribute, cancellationToken).Type, exactMatch))\n\t\t\t\t\t\t\teditor.RemoveNode(attribute);\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/XunitCodeAction.cs",
    "content": "using System;\nusing System.Globalization;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\n\nnamespace Microsoft.CodeAnalysis.CodeActions;\n\ninternal static class XunitCodeAction\n{\n\tpublic static CodeAction Create(\n\t\tFunc<CancellationToken, Task<Document>> createChangedDocument,\n\t\tstring equivalenceKey,\n\t\tstring title) =>\n\t\t\tCodeAction.Create(\n\t\t\t\ttitle,\n\t\t\t\tcreateChangedDocument,\n\t\t\t\tequivalenceKey\n\t\t\t);\n\n#pragma warning disable RS1035  // The prohibiton on CultureInfo.CurrentCulture does not apply to fixers\n\n\tpublic static CodeAction Create(\n\t\tFunc<CancellationToken, Task<Document>> createChangedDocument,\n\t\tstring equivalenceKey,\n\t\tstring titleFormat,\n\t\tobject? arg0) =>\n\t\t\tCodeAction.Create(\n\t\t\t\tstring.Format(CultureInfo.CurrentCulture, titleFormat, arg0),\n\t\t\t\tcreateChangedDocument,\n\t\t\t\tequivalenceKey\n\t\t\t);\n\n\tpublic static CodeAction Create(\n\t\tFunc<CancellationToken, Task<Document>> createChangedDocument,\n\t\tstring equivalenceKey,\n\t\tstring titleFormat,\n\t\tobject? arg0,\n\t\tobject? arg1) =>\n\t\t\tCodeAction.Create(\n\t\t\t\tstring.Format(CultureInfo.CurrentCulture, titleFormat, arg0, arg1),\n\t\t\t\tcreateChangedDocument,\n\t\t\t\tequivalenceKey\n\t\t\t);\n\n\tpublic static CodeAction Create(\n\t\tFunc<CancellationToken, Task<Document>> createChangedDocument,\n\t\tstring equivalenceKey,\n\t\tstring titleFormat,\n\t\tobject? arg0,\n\t\tobject? arg1,\n\t\tobject? arg2) =>\n\t\t\tCodeAction.Create(\n\t\t\t\tstring.Format(CultureInfo.CurrentCulture, titleFormat, arg0, arg1, arg2),\n\t\t\t\tcreateChangedDocument,\n\t\t\t\tequivalenceKey\n\t\t\t);\n\n\tpublic static CodeAction Create(\n\t\tFunc<CancellationToken, Task<Document>> createChangedDocument,\n\t\tstring equivalenceKey,\n\t\tstring titleFormat,\n\t\tparams object?[] args) =>\n\t\t\tCodeAction.Create(\n\t\t\t\tstring.Format(CultureInfo.CurrentCulture, titleFormat, args),\n\t\t\t\tcreateChangedDocument,\n\t\t\t\tequivalenceKey\n\t\t\t);\n\n#pragma warning restore RS1035\n\n\tpublic static CodeAction UseDifferentAssertMethod(\n\t\tstring equivalenceKey,\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacementMethod) =>\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Use Assert.\" + replacementMethod,\n\t\t\t\tasync ct =>\n\t\t\t\t{\n\t\t\t\t\tvar editor = await DocumentEditor.CreateAsync(document, ct).ConfigureAwait(false);\n\n\t\t\t\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\t\t\t\tif (editor.Generator.IdentifierName(replacementMethod) is SimpleNameSyntax replacementNameSyntax)\n\t\t\t\t\t\t\teditor.ReplaceNode(memberAccess, memberAccess.WithName(replacementNameSyntax));\n\n\t\t\t\t\treturn editor.GetChangedDocument();\n\t\t\t\t},\n\t\t\t\tequivalenceKey\n\t\t\t);\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/XunitCodeFixProvider.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic abstract class XunitCodeFixProvider(params string[] diagnostics) :\n\tCodeFixProvider\n{\n#pragma warning disable IDE0305  // Cannot convert this due to Roslyn 3.11\n\tpublic sealed override ImmutableArray<string> FixableDiagnosticIds { get; } = diagnostics.ToImmutableArray();\n#pragma warning restore IDE0305\n\n\tpublic override FixAllProvider? GetFixAllProvider() =>\n\t\tnull;\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/Utility/XunitMemberFixProvider.cs",
    "content": "using System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\n\nnamespace Xunit.Analyzers.Fixes;\n\npublic abstract class XunitMemberFixProvider(params string[] diagnostics) :\n\tXunitCodeFixProvider(diagnostics)\n{\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.DeclaringType, out var declaringTypeName))\n\t\t\treturn;\n\t\tif (declaringTypeName is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MemberName, out var memberName))\n\t\t\treturn;\n\t\tif (memberName is null)\n\t\t\treturn;\n\n\t\tvar declaringType = semanticModel.Compilation.GetTypeByMetadataName(declaringTypeName);\n\t\tif (declaringType is null)\n\t\t\treturn;\n\n\t\tvar member = declaringType.GetMembers(memberName).FirstOrDefault();\n\t\tif (member is null)\n\t\t\treturn;\n\n\t\tif (member.Locations.FirstOrDefault()?.IsInMetadata ?? true)\n\t\t\treturn;\n\n\t\tawait RegisterCodeFixesAsync(context, member).ConfigureAwait(false);\n\t}\n\n\tpublic abstract Task RegisterCodeFixesAsync(\n\t\tCodeFixContext context,\n\t\tISymbol member);\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/ClassDataAttributeMustPointAtValidClassFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class ClassDataAttributeMustPointAtValidClassFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_FixDataClass = \"xUnit1007_FixDataClass\";\n\n\tpublic ClassDataAttributeMustPointAtValidClassFixer() :\n\t\tbase(Descriptors.X1007_ClassDataAttributeMustPointAtValidClass.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\t// The context wraps \"ClassData(typeof(T))\", which is an attribute syntax\n\t\tvar attribute = root.FindNode(context.Span);\n\n\t\t// Dig in to find the attribute arguments\n\t\tvar attributeArgumentList = attribute.ChildNodes().OfType<AttributeArgumentListSyntax>().FirstOrDefault();\n\t\tif (attributeArgumentList is null)\n\t\t\treturn;\n\n\t\t// Dig into that to get the attribute argument\n\t\tvar attributeArgument = attributeArgumentList.ChildNodes().OfType<AttributeArgumentSyntax>().FirstOrDefault();\n\t\tif (attributeArgument is null)\n\t\t\treturn;\n\n\t\t// And finally, dig in to get the typeof expression\n\t\tvar typeOfExpression = attributeArgument.ChildNodes().OfType<TypeOfExpressionSyntax>().FirstOrDefault();\n\t\tif (typeOfExpression is null)\n\t\t\treturn;\n\n\t\tif (semanticModel.GetTypeInfo(typeOfExpression.Type, context.CancellationToken).Type is INamedTypeSymbol typeSymbol)\n\t\t\tif (typeSymbol.TypeKind == TypeKind.Class && typeSymbol.Locations.Any(l => l.IsInSource))\n\t\t\t\tcontext.RegisterCodeFix(\n\t\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\t\"Fix data class\",\n\t\t\t\t\t\tct => FixClass(context.Document.Project.Solution, typeSymbol, ct),\n\t\t\t\t\t\tKey_FixDataClass\n\t\t\t\t\t),\n\t\t\t\t\tcontext.Diagnostics\n\t\t\t\t);\n\t}\n\n\tstatic async Task<Solution> FixClass(\n\t\tSolution solution,\n\t\tINamedTypeSymbol typeSymbol,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar symbolEditor = SymbolEditor.Create(solution);\n\n\t\tawait symbolEditor.EditOneDeclarationAsync(typeSymbol, async (editor, declaration, ct) =>\n\t\t{\n\t\t\tvar classDeclaration = (ClassDeclarationSyntax)declaration;\n\t\t\tvar compilation = editor.SemanticModel.Compilation;\n\t\t\tvar generator = editor.Generator;\n\n\t\t\tif (typeSymbol.IsAbstract)\n\t\t\t\teditor.SetModifiers(declaration, DeclarationModifiers.From(typeSymbol).WithIsAbstract(false));\n\n\t\t\tvar ctor = typeSymbol.InstanceConstructors.FirstOrDefault(c => c.Parameters.Length == 0);\n\t\t\tif (ctor is null)\n\t\t\t\teditor.AddMember(classDeclaration, generator.ConstructorDeclaration(accessibility: Accessibility.Public));\n\t\t\telse if (ctor.DeclaredAccessibility != Accessibility.Public && !(ctor.IsImplicitlyDeclared && typeSymbol.IsAbstract))\n\t\t\t{\n\t\t\t\t// Make constructor public unless it's implicit and the class was abstract. Making the class non-abstract will make the implicit constructor public\n\t\t\t\tvar ctorSyntaxRef = ctor.DeclaringSyntaxReferences.FirstOrDefault();\n\t\t\t\tif (ctorSyntaxRef is not null)\n\t\t\t\t\teditor.SetAccessibility(await ctorSyntaxRef.GetSyntaxAsync(ct).ConfigureAwait(false), Accessibility.Public);\n\t\t\t}\n\n\t\t\tvar iEnumerableOfObjectArray = TypeSymbolFactory.IEnumerableOfObjectArray(compilation);\n\t\t\tif (!iEnumerableOfObjectArray.IsAssignableFrom(typeSymbol))\n\t\t\t\teditor.AddInterfaceType(classDeclaration, generator.TypeExpression(iEnumerableOfObjectArray));\n\t\t}, cancellationToken).ConfigureAwait(false);\n\n\t\treturn symbolEditor.ChangedSolution;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/CollectionDefinitionClassesMustBePublicFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class CollectionDefinitionClassesMustBePublicFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_MakeCollectionDefinitionClassPublic = \"xUnit1027_MakeCollectionDefinitionClassPublic\";\n\n\tpublic CollectionDefinitionClassesMustBePublicFixer() :\n\t\tbase(Descriptors.X1027_CollectionDefinitionClassMustBePublic.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make collection definition class public\",\n\t\t\t\tct => context.Document.ChangeAccessibility(classDeclaration, Accessibility.Public, ct),\n\t\t\t\tKey_MakeCollectionDefinitionClassPublic\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/ConvertToFactFix.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class ConvertToFactFix : XunitCodeFixProvider\n{\n\tpublic const string Key_ConvertToFact = \"xUnit1003_xUnit1006_ConvertToFact\";\n\n\tpublic ConvertToFactFix() :\n\t\tbase(\n\t\t\tDescriptors.X1003_TheoryMethodMustHaveTestData.Id,\n\t\t\tDescriptors.X1006_TheoryMethodShouldHaveParameters.Id\n\t\t)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tnew ConvertAttributeCodeAction(\n\t\t\t\t\"Convert to [Fact]\",\n\t\t\t\tKey_ConvertToFact,\n\t\t\t\tcontext.Document,\n\t\t\t\tmethodDeclaration.AttributeLists,\n\t\t\t\tfromTypeName: Constants.Types.Xunit.TheoryAttribute,\n\t\t\t\ttoTypeName: Constants.Types.Xunit.FactAttribute\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/ConvertToTheoryFix.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class ConvertToTheoryFix : XunitCodeFixProvider\n{\n\tpublic const string Key_ConvertToTheory = \"xUnit1001_xUnit1005_ConvertToTheory\";\n\n\tpublic ConvertToTheoryFix() :\n\t\tbase(\n\t\t\tDescriptors.X1001_FactMethodMustNotHaveParameters.Id,\n\t\t\tDescriptors.X1005_FactMethodShouldNotHaveTestData.Id\n\t\t)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tnew ConvertAttributeCodeAction(\n\t\t\t\t\"Convert to [Theory]\",\n\t\t\t\tKey_ConvertToTheory,\n\t\t\t\tcontext.Document,\n\t\t\t\tmethodDeclaration.AttributeLists,\n\t\t\t\tfromTypeName: Constants.Types.Xunit.FactAttribute,\n\t\t\t\ttoTypeName: Constants.Types.Xunit.TheoryAttribute\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/DataAttributeShouldBeUsedOnATheoryFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class DataAttributeShouldBeUsedOnATheoryFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_MarkAsTheory = \"xUnit1008_MarkAsTheory\";\n\tpublic const string Key_RemoveDataAttributes = \"xUnit1008_RemoveDataAttributes\";\n\n\tpublic DataAttributeShouldBeUsedOnATheoryFixer() :\n\t\tbase(Descriptors.X1008_DataAttributeShouldBeUsedOnATheory.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.DataAttributeTypeName, out var dataAttributeTypeName) || dataAttributeTypeName is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Mark as [Theory]\",\n\t\t\t\tct => MarkAsTheoryAsync(context.Document, methodDeclaration, ct),\n\t\t\t\tKey_MarkAsTheory\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tnew RemoveAttributesOfTypeCodeAction(\n\t\t\t\t\"Remove data attributes\",\n\t\t\t\tKey_RemoveDataAttributes,\n\t\t\t\tcontext.Document,\n\t\t\t\tmethodDeclaration.AttributeLists,\n\t\t\t\tdataAttributeTypeName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> MarkAsTheoryAsync(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax methodDeclaration,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tmethodDeclaration,\n\t\t\t(node, generator) => generator.InsertAttributes(node, 0, generator.Attribute(Constants.Types.Xunit.TheoryAttribute))\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/DoNotUseAsyncVoidForTestMethodsFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class DoNotUseAsyncVoidForTestMethodsFixer : XunitMemberFixProvider\n{\n\tpublic const string Key_ConvertToTask = \"xUnit1048_xUnit1049_ConvertToTask\";\n\tpublic const string Key_ConvertToValueTask = \"xUnit1049_ConvertToValueTask\";\n\n\tpublic DoNotUseAsyncVoidForTestMethodsFixer() :\n\t\tbase(\n\t\t\tDescriptors.X1048_DoNotUseAsyncVoidForTestMethods_V2.Id,\n\t\t\tDescriptors.X1049_DoNotUseAsyncVoidForTestMethods_V3.Id\n\t\t)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(\n\t\tCodeFixContext context,\n\t\tISymbol member)\n\t{\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar taskReturnType = TypeSymbolFactory.Task(semanticModel.Compilation);\n\t\tif (taskReturnType is null)\n\t\t\treturn;\n\n\t\tvar valueTaskReturnType = TypeSymbolFactory.ValueTask(semanticModel.Compilation);\n\n\t\tforeach (var diagnostic in context.Diagnostics)\n\t\t{\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Change return type to Task\",\n\t\t\t\t\tct => context.Document.Project.Solution.ChangeMemberType(member, taskReturnType, ct),\n\t\t\t\t\tKey_ConvertToTask\n\t\t\t\t),\n\t\t\t\tdiagnostic\n\t\t\t);\n\n\t\t\tif (valueTaskReturnType is not null && diagnostic.Id == Descriptors.X1049_DoNotUseAsyncVoidForTestMethods_V3.Id)\n\t\t\t\tcontext.RegisterCodeFix(\n\t\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\t\"Change return type to ValueTask\",\n\t\t\t\t\t\tct => context.Document.Project.Solution.ChangeMemberType(member, valueTaskReturnType, ct),\n\t\t\t\t\t\tKey_ConvertToValueTask\n\t\t\t\t\t),\n\t\t\t\t\tdiagnostic\n\t\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/DoNotUseConfigureAwaitFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class DoNotUseConfigureAwaitFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveConfigureAwait = \"xUnit1030_RemoveConfigureAwait\";\n\tpublic const string Key_ReplaceArgumentValue = \"xUnit1030_ReplaceArgumentValue\";\n\n\tpublic DoNotUseConfigureAwaitFixer() :\n\t\tbase(Descriptors.X1030_DoNotUseConfigureAwait.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\t// Get the original and replacement values\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ArgumentValue, out var original))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\n\t\t// The syntax node (the invocation) will include \"(any preceding trivia)(any preceding code).ConfigureAwait(args)\" despite\n\t\t// the context.Span only covering \"ConfigureAwait(args)\". So we need to replace the whole invocation\n\t\t// with an invocation that does not include the ConfigureAwait call.\n\t\tvar syntaxNode = root.FindNode(context.Span);\n\t\tvar syntaxText = syntaxNode.ToFullString();\n\n\t\t// Remove the context span (plus the preceding .)\n\t\tvar removeConfigureAwaitText = syntaxText.Substring(0, context.Span.Start - syntaxNode.FullSpan.Start - 1);\n\t\tvar removeConfigureAwaitNode = SyntaxFactory.ParseExpression(removeConfigureAwaitText);\n\n\t\t// Only offer the removal fix if the replacement value is 'true', because anybody using ConfigureAwaitOptions\n\t\t// will want to just add the extra value, not remove the call entirely.\n\t\tif (replacement == \"true\")\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Remove ConfigureAwait call\",\n\t\t\t\t\tasync ct =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar editor = await DocumentEditor.CreateAsync(context.Document, ct).ConfigureAwait(false);\n\t\t\t\t\t\teditor.ReplaceNode(syntaxNode, removeConfigureAwaitNode);\n\t\t\t\t\t\treturn editor.GetChangedDocument();\n\t\t\t\t\t},\n\t\t\t\t\tKey_RemoveConfigureAwait\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\n\t\t// Offer the replacement fix\n\t\tvar replaceConfigureAwaitText = removeConfigureAwaitText + \".ConfigureAwait(\" + replacement + \")\";\n\t\tvar replaceConfigureAwaitNode = SyntaxFactory.ParseExpression(replaceConfigureAwaitText);\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tasync ct =>\n\t\t\t\t{\n\t\t\t\t\tvar editor = await DocumentEditor.CreateAsync(context.Document, ct).ConfigureAwait(false);\n\t\t\t\t\teditor.ReplaceNode(syntaxNode, replaceConfigureAwaitNode);\n\t\t\t\t\treturn editor.GetChangedDocument();\n\t\t\t\t},\n\t\t\t\tKey_ReplaceArgumentValue,\n\t\t\t\t\"Replace ConfigureAwait({0}) with ConfigureAwait({1})\", original, replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/FactMethodMustNotHaveParametersFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class FactMethodMustNotHaveParametersFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveParameters = \"xUnit1001_RemoveParameters\";\n\n\tpublic FactMethodMustNotHaveParametersFixer() :\n\t\tbase(Descriptors.X1001_FactMethodMustNotHaveParameters.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove parameters\",\n\t\t\t\tct => RemoveParameters(context.Document, methodDeclaration.ParameterList, ct),\n\t\t\t\tKey_RemoveParameters\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveParameters(\n\t\tDocument document,\n\t\tParameterListSyntax parameterListSyntax,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tforeach (var parameter in parameterListSyntax.Parameters)\n\t\t\teditor.RemoveNode(parameter);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/FactMethodShouldNotHaveTestDataFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class FactMethodShouldNotHaveTestDataFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveDataAttributes = \"xUnit1005_RemoveDataAttributes\";\n\n\tpublic FactMethodShouldNotHaveTestDataFixer() :\n\t\tbase(Descriptors.X1005_FactMethodShouldNotHaveTestData.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.DataAttributeTypeName, out var dataAttributeTypeName) || dataAttributeTypeName is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tnew RemoveAttributesOfTypeCodeAction(\n\t\t\t\t\"Remove data attributes\",\n\t\t\t\tKey_RemoveDataAttributes,\n\t\t\t\tcontext.Document,\n\t\t\t\tmethodDeclaration.AttributeLists,\n\t\t\t\tdataAttributeTypeName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/InlineDataMustMatchTheoryParameters_ExtraValueFixer.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Composition;\nusing System.Globalization;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class InlineDataMustMatchTheoryParameters_ExtraValueFixer : XunitCodeFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\tpublic const string Key_AddTheoryParameter = \"xUnit1011_AddTheoryParameter\";\n\tpublic const string Key_RemoveExtraDataValue = \"xUnit1011_RemoveExtraDataValue\";\n\n\tpublic InlineDataMustMatchTheoryParameters_ExtraValueFixer() :\n\t\tbase(Descriptors.X1011_InlineDataMustMatchTheoryParameters_ExtraValue.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar node = root.FindNode(context.Span);\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\t// Fix #1: remove the extra data from the inline data attribute\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove extra data value\",\n\t\t\t\tct => context.Document.RemoveNode(node, ct),\n\t\t\t\tKey_RemoveExtraDataValue\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\t// Fix #2: add a parameter to the theory for the extra data\n\t\t// (only valid for the first item after the supported parameters are exhausted)\n\t\tvar method = node.FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (method is null)\n\t\t\treturn;\n\n\t\tvar parameterIndexText = diagnostic.Properties[Constants.Properties.ParameterIndex];\n\n\t\tif (parameterIndexText is not null)\n\t\t{\n\t\t\tvar parameterIndex = int.Parse(parameterIndexText, CultureInfo.InvariantCulture);\n\t\t\tif (!Enum.TryParse<SpecialType>(diagnostic.Properties[Constants.Properties.ParameterSpecialType], out var parameterSpecialType))\n\t\t\t\treturn;\n\n\t\t\tvar existingParameters = method.ParameterList.Parameters.Select(p => p.Identifier.Text).ToImmutableHashSet();\n\t\t\tvar parameterName = \"p\";\n\t\t\tvar nextIndex = 2;\n\t\t\twhile (existingParameters.Contains(parameterName))\n\t\t\t\tparameterName = $\"p_{nextIndex++}\";\n\n\t\t\tif (method.ParameterList.Parameters.Count == parameterIndex)\n\t\t\t\tcontext.RegisterCodeFix(\n\t\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\t\"Add theory parameter\",\n\t\t\t\t\t\tct => AddTheoryParameter(context.Document, method, parameterSpecialType, parameterName, ct),\n\t\t\t\t\t\tKey_AddTheoryParameter\n\t\t\t\t\t),\n\t\t\t\t\tcontext.Diagnostics\n\t\t\t\t);\n\t\t}\n\t}\n\n\tstatic async Task<Document> AddTheoryParameter(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax method,\n\t\tSpecialType parameterSpecialType,\n\t\tstring parameterName,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar parameterTypeExpression =\n\t\t\tparameterSpecialType != SpecialType.None\n\t\t\t\t? editor.Generator.TypeExpression(parameterSpecialType)\n\t\t\t\t: editor.Generator.TypeExpression(SpecialType.System_Object);\n\n\t\teditor.AddParameter(\n\t\t\tmethod,\n\t\t\teditor.Generator.ParameterDeclaration(parameterName, parameterTypeExpression)\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_MakeParameterNullable = \"xUnit1012_MakeParameterNullable\";\n\n\tpublic InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixer() :\n\t\tbase(Descriptors.X1012_InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameter.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar node = root.FindNode(context.Span);\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ParameterIndex, out var parameterIndexText))\n\t\t\treturn;\n\t\tif (!int.TryParse(parameterIndexText, out var parameterIndex))\n\t\t\treturn;\n\n\t\tvar diagnosticId = diagnostic.Id;\n\t\tvar method = node.FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (method is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make parameter nullable\",\n\t\t\t\tct => MakeParameterNullable(context.Document, method, parameterIndex, ct),\n\t\t\t\tKey_MakeParameterNullable\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> MakeParameterNullable(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax method,\n\t\tint parameterIndex,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (method.ParameterList.Parameters.Count > parameterIndex)\n\t\t{\n\t\t\tvar param = method.ParameterList.Parameters[parameterIndex];\n\t\t\tvar semanticModel = editor.SemanticModel;\n\n\t\t\tif (semanticModel is not null && param.Type is not null)\n\t\t\t{\n\t\t\t\tvar paramTypeSymbol = semanticModel.GetTypeInfo(param.Type, cancellationToken).Type;\n\t\t\t\tif (paramTypeSymbol is not null)\n\t\t\t\t{\n\t\t\t\t\tvar nullableT = paramTypeSymbol.IsReferenceType\n\t\t\t\t\t\t? paramTypeSymbol.WithNullableAnnotation(NullableAnnotation.Annotated)\n\t\t\t\t\t\t: TypeSymbolFactory.NullableOfT(semanticModel.Compilation).Construct(paramTypeSymbol);\n\t\t\t\t\teditor.SetType(param, editor.Generator.TypeExpression(nullableT));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/InlineDataMustMatchTheoryParameters_TooFewValuesFixer.cs",
    "content": "using System;\nusing System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class InlineDataMustMatchTheoryParameters_TooFewValuesFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_AddDefaultValues = \"xUnit1009_AddDefaultValues\";\n\n\tpublic InlineDataMustMatchTheoryParameters_TooFewValuesFixer() :\n\t\tbase(Descriptors.X1009_InlineDataMustMatchTheoryParameters_TooFewValues.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar node = root.FindNode(context.Span);\n\t\tif (node is not AttributeSyntax attribute)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ParameterArrayStyle, out var arrayStyleText))\n\t\t\treturn;\n\n\t\tvar diagnosticId = diagnostic.Id;\n\t\tvar method = node.FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (method is null)\n\t\t\treturn;\n\n\t\tif (!Enum.TryParse<InlineDataMustMatchTheoryParameters.ParameterArrayStyleType>(arrayStyleText, out var arrayStyle))\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Add default values\",\n\t\t\t\tct => AddDefaultValues(context.Document, attribute, method, arrayStyle, ct),\n\t\t\t\tKey_AddDefaultValues\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> AddDefaultValues(\n\t\tDocument document,\n\t\tAttributeSyntax attribute,\n\t\tMethodDeclarationSyntax method,\n\t\tInlineDataMustMatchTheoryParameters.ParameterArrayStyleType arrayStyle,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar arrayInitializer = default(InitializerExpressionSyntax);\n\t\tif (arrayStyle == InlineDataMustMatchTheoryParameters.ParameterArrayStyleType.Initializer)\n\t\t\tarrayInitializer = attribute.DescendantNodes().First(n => n.IsKind(SyntaxKind.ArrayInitializerExpression)) as InitializerExpressionSyntax;\n\n\t\tvar originalInitializer = arrayInitializer;\n\t\tvar i = originalInitializer?.Expressions.Count ?? attribute.ArgumentList?.Arguments.Count ?? 0;\n\t\tfor (; i < method.ParameterList.Parameters.Count; i++)\n\t\t\tif (CreateDefaultValueSyntax(editor, method.ParameterList.Parameters[i].Type) is ExpressionSyntax defaultExpression)\n\t\t\t{\n\t\t\t\tif (arrayInitializer is not null)\n\t\t\t\t\tarrayInitializer = arrayInitializer.AddExpressions(defaultExpression);\n\t\t\t\telse\n\t\t\t\t\teditor.AddAttributeArgument(attribute, defaultExpression);\n\t\t\t}\n\n\t\tif (originalInitializer is not null && arrayInitializer is not null)\n\t\t\teditor.ReplaceNode(originalInitializer, arrayInitializer);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tstatic SyntaxNode CreateDefaultValueSyntax(\n\t\tDocumentEditor editor,\n\t\tTypeSyntax? type)\n\t{\n\t\tif (type is null)\n\t\t\treturn editor.Generator.NullLiteralExpression();\n\n\t\tvar t = editor.SemanticModel.GetTypeInfo(type).Type;\n\t\tif (t is null)\n\t\t\treturn editor.Generator.NullLiteralExpression();\n\n\t\tswitch (t.SpecialType)\n\t\t{\n\t\t\tcase SpecialType.System_Boolean:\n\t\t\t\treturn editor.Generator.FalseLiteralExpression();\n\n\t\t\tcase SpecialType.System_Char:\n\t\t\t\treturn editor.Generator.LiteralExpression(default(char));\n\n\t\t\tcase SpecialType.System_Double:\n\t\t\t\treturn editor.Generator.LiteralExpression(default(double));\n\n\t\t\tcase SpecialType.System_Single:\n\t\t\t\treturn editor.Generator.LiteralExpression(default(float));\n\n\t\t\tcase SpecialType.System_UInt32:\n\t\t\tcase SpecialType.System_UInt64:\n\t\t\t\treturn editor.Generator.LiteralExpression(default(uint));\n\n\t\t\tcase SpecialType.System_Byte:\n\t\t\tcase SpecialType.System_Decimal:\n\t\t\tcase SpecialType.System_Int16:\n\t\t\tcase SpecialType.System_Int32:\n\t\t\tcase SpecialType.System_Int64:\n\t\t\tcase SpecialType.System_SByte:\n\t\t\tcase SpecialType.System_UInt16:\n\t\t\t\treturn editor.Generator.LiteralExpression(default(int));\n\n\t\t\tcase SpecialType.System_String:\n\t\t\t\treturn editor.Generator.LiteralExpression(string.Empty);\n\t\t}\n\n\t\tif (t.TypeKind == TypeKind.Enum)\n\t\t\treturn editor.Generator.DefaultExpression(t);\n\n\t\treturn editor.Generator.NullLiteralExpression();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/InlineDataShouldBeUniqueWithinTheoryFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class InlineDataShouldBeUniqueWithinTheoryFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveDuplicateInlineData = \"xUnit1025_RemoveDuplicateInlineData\";\n\n\tpublic InlineDataShouldBeUniqueWithinTheoryFixer() :\n\t\tbase(Descriptors.X1025_InlineDataShouldBeUniqueWithinTheory.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar reportedNode = root.FindNode(context.Span);\n\t\tif (reportedNode is AttributeSyntax attributeDuplicate)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Remove duplicate InlineData\",\n\t\t\t\t\tct => RemoveInlineDataDuplicate(context.Document, attributeDuplicate, ct),\n\t\t\t\t\tKey_RemoveDuplicateInlineData\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveInlineDataDuplicate(\n\t\tDocument document,\n\t\tAttributeSyntax attributeDuplicate,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.RemoveNode(attributeDuplicate);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/LocalFunctionsCannotBeTestFunctionsFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class LocalFunctionsCannotBeTestFunctionsFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveAttribute = \"xUnit1029_RemoveAttribute\";\n\n\tpublic LocalFunctionsCannotBeTestFunctionsFixer() :\n\t\tbase(Descriptors.X1029_LocalFunctionsCannotBeTestFunctions.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar localFunctionDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<LocalFunctionStatementSyntax>();\n\t\tif (localFunctionDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tnew RemoveAttributesOfTypeCodeAction(\n\t\t\t\t\"Remove attribute\",\n\t\t\t\tKey_RemoveAttribute,\n\t\t\t\tcontext.Document,\n\t\t\t\tlocalFunctionDeclaration.AttributeLists,\n\t\t\t\tConstants.Types.Xunit.FactAttribute\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_ExtraValueFixer.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Composition;\nusing System.Globalization;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class MemberDataShouldReferenceValidMember_ExtraValueFixer : XunitCodeFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic const string Key_AddMethodParameter = \"xUnit1036_AddMethodParameter\";\n\tpublic const string Key_RemoveExtraDataValue = \"xUnit1036_RemoveExtraDataValue\";\n\n\tpublic MemberDataShouldReferenceValidMember_ExtraValueFixer() :\n\t\tbase(Descriptors.X1036_MemberDataArgumentsMustMatchMethodParameters_ExtraValue.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar node = root.FindNode(context.Span);\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\t// Fix #1: remove the extra data from the member data attribute\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove extra data value\",\n\t\t\t\tct => context.Document.RemoveNode(node, ct),\n\t\t\t\tKey_RemoveExtraDataValue\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\t// Fix #2: add a parameter to the theory for the extra data\n\t\t// (only valid for the first item after the supported parameters are exhausted)\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar attributeList = node.FirstAncestorOrSelf<AttributeArgumentListSyntax>();\n\t\tif (attributeList is null)\n\t\t\treturn;\n\n\t\tvar propertyAttributeParameters =\n\t\t\tattributeList\n\t\t\t\t.Arguments\n\t\t\t\t.Count(a => !string.IsNullOrEmpty(a.NameEquals?.Name.Identifier.ValueText));\n\n\t\tvar paramsCount = attributeList.Arguments.Count - 1 - propertyAttributeParameters;\n\n\t\t(_, var declaredMemberTypeSymbol) = MemberDataShouldReferenceValidMember.GetClassTypesForAttribute(\n\t\t\tattributeList, semanticModel, context.CancellationToken);\n\t\tif (declaredMemberTypeSymbol is null)\n\t\t\treturn;\n\n\t\tvar memberName = diagnostic.Properties[Constants.Properties.MemberName];\n\t\tif (memberName is null)\n\t\t\treturn;\n\n\t\tIMethodSymbol? methodSymbol = null;\n\t\twhile (paramsCount >= 0)\n\t\t{\n\t\t\tvar memberSymbol = MemberDataShouldReferenceValidMember.FindMethodSymbol(memberName, declaredMemberTypeSymbol, paramsCount);\n\t\t\tmethodSymbol = memberSymbol as IMethodSymbol;\n\t\t\tif (methodSymbol is not null)\n\t\t\t\tbreak;\n\t\t\tparamsCount--;\n\t\t}\n\t\tif (methodSymbol is null)\n\t\t\treturn;\n\n\t\tvar methodSyntaxes = methodSymbol.DeclaringSyntaxReferences;\n\t\tif (methodSyntaxes.Length != 1)\n\t\t\treturn;\n\t\tif (await methodSyntaxes[0].GetSyntaxAsync().ConfigureAwait(false) is not MethodDeclarationSyntax method)\n\t\t\treturn;\n\n\t\tvar parameterIndexText = diagnostic.Properties[Constants.Properties.ParameterIndex];\n\n\t\tif (parameterIndexText is not null)\n\t\t{\n\t\t\tvar parameterIndex = int.Parse(parameterIndexText, CultureInfo.InvariantCulture);\n\t\t\tif (!Enum.TryParse<SpecialType>(diagnostic.Properties[Constants.Properties.ParameterSpecialType], out var parameterSpecialType))\n\t\t\t\treturn;\n\n\t\t\tvar existingParameters = method.ParameterList.Parameters.Select(p => p.Identifier.Text).ToImmutableHashSet();\n\t\t\tvar parameterName = \"p\";\n\t\t\tvar nextIndex = 2;\n\t\t\twhile (existingParameters.Contains(parameterName))\n\t\t\t\tparameterName = $\"p_{nextIndex++}\";\n\n\t\t\tif (method.ParameterList.Parameters.Count == parameterIndex)\n\t\t\t\tcontext.RegisterCodeFix(\n\t\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\t\"Add method parameter\",\n\t\t\t\t\t\tct => AddMethodParameter(context.Document, method, parameterSpecialType, parameterName, ct),\n\t\t\t\t\t\tKey_AddMethodParameter\n\t\t\t\t\t),\n\t\t\t\t\tcontext.Diagnostics\n\t\t\t\t);\n\t\t}\n\t}\n\n\tstatic async Task<Document> AddMethodParameter(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax method,\n\t\tSpecialType parameterSpecialType,\n\t\tstring parameterName,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar parameterTypeExpression =\n\t\t\tparameterSpecialType != SpecialType.None\n\t\t\t\t? editor.Generator.TypeExpression(parameterSpecialType)\n\t\t\t\t: editor.Generator.TypeExpression(SpecialType.System_Object);\n\n\t\teditor.AddParameter(\n\t\t\tmethod,\n\t\t\teditor.Generator.ParameterDeclaration(parameterName, parameterTypeExpression)\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_NameOfFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class MemberDataShouldReferenceValidMember_NameOfFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseNameof = \"xUnit1014_UseNameof\";\n\n\tpublic MemberDataShouldReferenceValidMember_NameOfFixer() :\n\t\tbase(Descriptors.X1014_MemberDataShouldUseNameOfOperator.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tvar diagnosticId = diagnostic.Id;\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar attributeArgument = root.FindNode(context.Span).FirstAncestorOrSelf<AttributeArgumentSyntax>();\n\t\tif (attributeArgument is null)\n\t\t\treturn;\n\n\t\tif (attributeArgument.Expression is LiteralExpressionSyntax memberNameExpression)\n\t\t{\n\t\t\tvar memberType = default(INamedTypeSymbol);\n\t\t\tif (diagnostic.Properties.TryGetValue(Constants.AttributeProperties.DeclaringType, out var memberTypeName) && memberTypeName is not null)\n\t\t\t{\n\t\t\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\t\t\tif (semanticModel is not null)\n\t\t\t\t\tmemberType = semanticModel.Compilation.GetTypeByMetadataName(memberTypeName);\n\t\t\t}\n\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Use nameof\",\n\t\t\t\t\tct => UseNameOf(context.Document, memberNameExpression, memberType, ct),\n\t\t\t\t\tKey_UseNameof\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic async Task<Document> UseNameOf(\n\t\tDocument document,\n\t\tLiteralExpressionSyntax memberNameExpression,\n\t\tINamedTypeSymbol? memberType,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar documentEditor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tdocumentEditor.ReplaceNode(\n\t\t\tmemberNameExpression,\n\t\t\t(node, generator) =>\n\t\t\t{\n\t\t\t\tvar nameofParam = generator.IdentifierName(memberNameExpression.Token.ValueText);\n\n\t\t\t\tif (memberType is not null)\n\t\t\t\t\tnameofParam = generator.MemberAccessExpression(generator.TypeExpression(memberType), nameofParam);\n\n\t\t\t\treturn generator.InvocationExpression(generator.IdentifierName(\"nameof\"), nameofParam);\n\t\t\t}\n\t\t);\n\n\t\treturn documentEditor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer : XunitCodeFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic const string Key_MakeParameterNullable = \"xUnit1034_MakeParameterNullable\";\n\n\tpublic MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer() :\n\t\tbase(Descriptors.X1034_MemberDataArgumentsMustMatchMethodParameters_NullShouldNotBeUsedForIncompatibleParameter.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar node = root.FindNode(context.Span);\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ParameterIndex, out var parameterIndexText))\n\t\t\treturn;\n\t\tif (!int.TryParse(parameterIndexText, out var parameterIndex))\n\t\t\treturn;\n\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar attributeList = node.FirstAncestorOrSelf<AttributeArgumentListSyntax>();\n\t\tif (attributeList is null)\n\t\t\treturn;\n\n\t\tvar propertyAttributeParameters =\n\t\t\tattributeList\n\t\t\t\t.Arguments\n\t\t\t\t.Count(a => !string.IsNullOrEmpty(a.NameEquals?.Name.Identifier.ValueText));\n\n\t\tvar paramsCount = attributeList.Arguments.Count - 1 - propertyAttributeParameters;\n\n\t\t(_, var declaredMemberTypeSymbol) = MemberDataShouldReferenceValidMember.GetClassTypesForAttribute(\n\t\t\tattributeList, semanticModel, context.CancellationToken);\n\t\tif (declaredMemberTypeSymbol is null)\n\t\t\treturn;\n\n\t\tvar memberName = diagnostic.Properties[Constants.Properties.MemberName];\n\t\tif (memberName is null)\n\t\t\treturn;\n\n\t\tvar memberSymbol = MemberDataShouldReferenceValidMember.FindMethodSymbol(memberName, declaredMemberTypeSymbol, paramsCount);\n\t\tif (memberSymbol is not IMethodSymbol methodSymbol)\n\t\t\treturn;\n\n\t\tvar methodSyntaxes = methodSymbol.DeclaringSyntaxReferences;\n\t\tif (methodSyntaxes.Length != 1)\n\t\t\treturn;\n\t\tif (await methodSyntaxes[0].GetSyntaxAsync().ConfigureAwait(false) is not MethodDeclarationSyntax method)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make parameter nullable\",\n\t\t\t\tct => MakeParameterNullable(context.Document, method, parameterIndex, ct),\n\t\t\t\tKey_MakeParameterNullable\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> MakeParameterNullable(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax method,\n\t\tint parameterIndex,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (method.ParameterList.Parameters.Count > parameterIndex)\n\t\t{\n\t\t\tvar param = method.ParameterList.Parameters[parameterIndex];\n\t\t\tvar semanticModel = editor.SemanticModel;\n\n\t\t\tif (semanticModel is not null && param.Type is not null)\n\t\t\t{\n\t\t\t\tvar paramTypeSymbol = semanticModel.GetTypeInfo(param.Type, cancellationToken).Type;\n\t\t\t\tif (paramTypeSymbol is not null)\n\t\t\t\t{\n\t\t\t\t\tvar nullableT = paramTypeSymbol.IsReferenceType\n\t\t\t\t\t\t? paramTypeSymbol.WithNullableAnnotation(NullableAnnotation.Annotated)\n\t\t\t\t\t\t: TypeSymbolFactory.NullableOfT(semanticModel.Compilation).Construct(paramTypeSymbol);\n\t\t\t\t\teditor.SetType(param, editor.Generator.TypeExpression(nullableT));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_ParamsForNonMethodFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing Microsoft.CodeAnalysis.Text;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class MemberDataShouldReferenceValidMember_ParamsForNonMethodFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveArgumentsFromMemberData = \"xUnit1021_RemoveArgumentsFromMemberData\";\n\n\tpublic MemberDataShouldReferenceValidMember_ParamsForNonMethodFixer() :\n\t\tbase(Descriptors.X1021_MemberDataNonMethodShouldNotHaveParameters.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tvar diagnosticId = diagnostic.Id;\n\t\tvar attribute = root.FindNode(context.Span).FirstAncestorOrSelf<AttributeSyntax>();\n\t\tif (attribute is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove arguments from MemberData\",\n\t\t\t\tct => RemoveUnneededArguments(context.Document, attribute, context.Span, ct),\n\t\t\t\tKey_RemoveArgumentsFromMemberData\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveUnneededArguments(\n\t\tDocument document,\n\t\tAttributeSyntax attribute,\n\t\tTextSpan span,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (attribute.ArgumentList is not null)\n\t\t\tforeach (var argument in attribute.ArgumentList.Arguments)\n\t\t\t\tif (argument.Span.OverlapsWith(span))\n\t\t\t\t\teditor.RemoveNode(argument);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_ReturnTypeFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic sealed class MemberDataShouldReferenceValidMember_ReturnTypeFixer : XunitMemberFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic const string Key_ChangeMemberReturnType_ObjectArray = \"xUnit1019_ChangeMemberReturnType_ObjectArray\";\n\tpublic const string Key_ChangeMemberReturnType_ITheoryDataRow = \"xUnit1019_ChangeMemberReturnType_ITheoryDataRow\";\n\n\tpublic MemberDataShouldReferenceValidMember_ReturnTypeFixer() :\n\t\tbase(Descriptors.X1019_MemberDataMustReferenceMemberOfValidType.Id)\n\t{ }\n\n\tpublic override async Task RegisterCodeFixesAsync(\n\t\tCodeFixContext context,\n\t\tISymbol member)\n\t{\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar objectArrayType = TypeSymbolFactory.IEnumerableOfObjectArray(semanticModel.Compilation);\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Change return type to IEnumerable<object[]>\",\n\t\t\t\tct => context.Document.Project.Solution.ChangeMemberType(member, objectArrayType, ct),\n\t\t\t\tKey_ChangeMemberReturnType_ObjectArray\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\tvar theoryDataRowType = TypeSymbolFactory.IEnumerableOfITheoryDataRow(semanticModel.Compilation);\n\n\t\tif (theoryDataRowType is not null)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Change return type to IEnumerable<ITheoryDataRow>\",\n\t\t\t\t\tct => context.Document.Project.Solution.ChangeMemberType(member, theoryDataRowType, ct),\n\t\t\t\t\tKey_ChangeMemberReturnType_ITheoryDataRow\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_StaticFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic sealed class MemberDataShouldReferenceValidMember_StaticFixer : XunitMemberFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic const string Key_MakeMemberStatic = \"xUnit1017_MakeMemberStatic\";\n\n\tpublic MemberDataShouldReferenceValidMember_StaticFixer() :\n\t\tbase(Descriptors.X1017_MemberDataMustReferenceStaticMember.Id)\n\t{ }\n\n\tpublic override Task RegisterCodeFixesAsync(\n\t\tCodeFixContext context,\n\t\tISymbol member)\n\t{\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make member static\",\n\t\t\t\tct => context.Document.Project.Solution.ChangeMemberStaticModifier(member, true, ct),\n\t\t\t\tKey_MakeMemberStatic\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\treturn Task.CompletedTask;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/MemberDataShouldReferenceValidMember_VisibilityFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic sealed class MemberDataShouldReferenceValidMember_VisibilityFixer : XunitMemberFixProvider\n{\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic const string Key_MakeMemberPublic = \"xUnit1016_MakeMemberPublic\";\n\n\tpublic MemberDataShouldReferenceValidMember_VisibilityFixer() :\n\t\tbase(Descriptors.X1016_MemberDataMustReferencePublicMember.Id)\n\t{ }\n\n\tpublic override Task RegisterCodeFixesAsync(\n\t\tCodeFixContext context,\n\t\tISymbol member)\n\t{\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make member public\",\n\t\t\t\tct => context.Document.Project.Solution.ChangeMemberAccessibility(member, Accessibility.Public, ct),\n\t\t\t\tKey_MakeMemberPublic\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\treturn Task.CompletedTask;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/PublicMethodShouldBeMarkedAsTestFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class PublicMethodShouldBeMarkedAsTestFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_ConvertToFact = \"xUnit1013_ConvertToFact\";\n\tpublic const string Key_ConvertToTheory = \"xUnit1013_ConvertToTheory\";\n\tpublic const string Key_MakeMethodInternal = \"xUnit1013_MakeMethodInternal\";\n\n\tpublic PublicMethodShouldBeMarkedAsTestFixer() :\n\t\tbase(Descriptors.X1013_PublicMethodShouldBeMarkedAsTest.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\t// Fix #1: Offer to convert it to a theory if it has parameters...\n\t\tif (methodDeclaration.ParameterList.Parameters.Any())\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Add [Theory]\",\n\t\t\t\t\tct => AddAttribute(context.Document, methodDeclaration, Constants.Types.Xunit.TheoryAttribute, ct),\n\t\t\t\t\tKey_ConvertToTheory\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t\t// ...otherwise, offer to convert it to a fact\n\t\telse\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Add [Fact]\",\n\t\t\t\t\tct => AddAttribute(context.Document, methodDeclaration, Constants.Types.Xunit.FactAttribute, ct),\n\t\t\t\t\tKey_ConvertToFact\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\n\t\t// Fix #2: Offer to mark the method as internal\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make method internal\",\n\t\t\t\tct => context.Document.ChangeAccessibility(methodDeclaration, Accessibility.Internal, ct),\n\t\t\t\tKey_MakeMethodInternal\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> AddAttribute(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax methodDeclaration,\n\t\tstring type,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.AddAttribute(methodDeclaration, editor.Generator.Attribute(type));\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/RemoveMethodParameterFix.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class RemoveMethodParameterFix : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveParameter = \"xUnit1022_xUnit1026_RemoveParameter\";\n\n\tpublic RemoveMethodParameterFix() :\n\t\tbase(\n\t\t\tDescriptors.X1022_TheoryMethodCannotHaveParameterArray.Id,\n\t\t\tDescriptors.X1026_TheoryMethodShouldUseAllParameters.Id\n\t\t)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar parameter = root.FindNode(context.Span).FirstAncestorOrSelf<ParameterSyntax>();\n\t\tif (parameter is null)\n\t\t\treturn;\n\n\t\tvar parameterName = parameter.Identifier.Text;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => context.Document.RemoveNode(parameter, ct),\n\t\t\t\tKey_RemoveParameter,\n\t\t\t\t\"Remove parameter '{0}'\", parameterName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TestClassCannotBeNestedInGenericClassFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TestClassCannotBeNestedInGenericClassFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_ExtractTestClass = \"xUnit1032_TestClassCannotBeNestedInGenericClass\";\n\n\tpublic TestClassCannotBeNestedInGenericClassFixer() :\n\t\tbase(Descriptors.X1032_TestClassCannotBeNestedInGenericClass.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Extract test class from parent class\",\n\t\t\t\tct => context.Document.ExtractNodeFromParent(classDeclaration, ct),\n\t\t\t\tKey_ExtractTestClass\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TestClassMustBePublicFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TestClassMustBePublicFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_MakeTestClassPublic = \"xUnit1000_MakeTestClassPublic\";\n\n\tpublic TestClassMustBePublicFixer() :\n\t\tbase(Descriptors.X1000_TestClassMustBePublic.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Make test class public\",\n\t\t\t\tct => context.Document.ChangeAccessibility(classDeclaration, Accessibility.Public, ct),\n\t\t\t\tKey_MakeTestClassPublic\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TestClassShouldHaveTFixtureArgumentFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TestClassShouldHaveTFixtureArgumentFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_GenerateConstructor = \"xUnit1033_GenerateConstructor\";\n\n\tpublic TestClassShouldHaveTFixtureArgumentFixer() :\n\t\tbase(Descriptors.X1033_TestClassShouldHaveTFixtureArgument.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.TestClassName, out var testClassName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.TFixtureName, out var tFixtureName))\n\t\t\treturn;\n\t\tif (tFixtureName is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.TFixtureDisplayName, out var tFixtureDisplayName))\n\t\t\treturn;\n\t\tif (tFixtureDisplayName is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => context.Document.AddConstructor(\n\t\t\t\t\tclassDeclaration,\n\t\t\t\t\ttypeDisplayName: tFixtureDisplayName,\n\t\t\t\t\ttypeName: tFixtureName,\n\t\t\t\t\tct\n\t\t\t\t),\n\t\t\t\tKey_GenerateConstructor,\n\t\t\t\t\"Generate constructor '{0}({1})'\", testClassName, tFixtureName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TestMethodMustNotHaveMultipleFactAttributesFixer.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Composition;\nusing System.Globalization;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TestMethodMustNotHaveMultipleFactAttributesFixer : XunitCodeFixProvider\n{\n\tpublic TestMethodMustNotHaveMultipleFactAttributesFixer() :\n\t\tbase(Descriptors.X1002_TestMethodMustNotHaveMultipleFactAttributes.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic static string Key_KeepAttribute(string simpleTypeName) =>\n\t\tstring.Format(CultureInfo.InvariantCulture, \"xUnit1002_KeepAttribute_{0}\", simpleTypeName);\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar methodDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (methodDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tvar attributeTypes = diagnostic.Properties.Keys.ToList();\n\n\t\tforeach (var attributeType in attributeTypes)\n\t\t{\n\t\t\tvar simpleName = GetAttributeSimpleName(attributeType);\n\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.Create(\n\t\t\t\t\tct => RemoveAttributes(context.Document, methodDeclaration, attributeTypes, attributeType, ct),\n\t\t\t\t\tKey_KeepAttribute(simpleName),\n\t\t\t\t\t\"Keep '{0}' attribute\", simpleName\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic string GetAttributeSimpleName(string attributeType)\n\t{\n\t\tvar simpleName = attributeType;\n\t\tif (simpleName.Contains(\".\"))\n\t\t\tsimpleName = simpleName.Substring(attributeType.LastIndexOf('.') + 1);\n\n\t\tconst string nameSuffix = \"Attribute\";\n\t\tif (simpleName.EndsWith(nameSuffix, System.StringComparison.Ordinal))\n\t\t\tsimpleName = simpleName.Substring(0, simpleName.Length - nameSuffix.Length);\n\n\t\treturn simpleName;\n\t}\n\n\tstatic async Task<Document> RemoveAttributes(\n\t\tDocument document,\n\t\tMethodDeclarationSyntax methodDeclaration,\n\t\tIReadOnlyList<string> attributeTypesToConsider,\n\t\tstring attributeTypeToKeep,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (semanticModel is not null)\n\t\t{\n\t\t\tvar oneKept = false;\n\n\t\t\tforeach (var attributeList in methodDeclaration.AttributeLists)\n\t\t\t\tforeach (var attribute in attributeList.Attributes)\n\t\t\t\t{\n\t\t\t\t\tvar attributeType = semanticModel.GetTypeInfo(attribute, cancellationToken).Type;\n\t\t\t\t\tif (attributeType is null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar attributeTypeDisplay = attributeType.ToDisplayString();\n\t\t\t\t\tif (attributeTypesToConsider.Contains(attributeTypeDisplay))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (attributeTypeDisplay == attributeTypeToKeep && !oneKept)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toneKept = true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.RemoveNode(attribute);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TestMethodShouldNotBeSkippedFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TestMethodShouldNotBeSkippedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveSkipArgument = \"xUnit1004_RemoveSkipArgument\";\n\n\tpublic TestMethodShouldNotBeSkippedFixer() :\n\t\tbase(Descriptors.X1004_TestMethodShouldNotBeSkipped.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar argument = root.FindNode(context.Span).FirstAncestorOrSelf<AttributeArgumentSyntax>();\n\t\tif (argument is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove Skip argument\",\n\t\t\t\tct => RemoveArgument(context.Document, argument, ct),\n\t\t\t\tKey_RemoveSkipArgument\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveArgument(\n\t\tDocument document,\n\t\tAttributeArgumentSyntax argument,\n\t\tCancellationToken ct)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, ct).ConfigureAwait(false);\n\n\t\teditor.RemoveNode(argument);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TheoryDataShouldNotUseTheoryDataRowFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TheoryDataShouldNotUseTheoryDataRowFixer() :\n\tXunitCodeFixProvider(Descriptors.X1052_TheoryDataShouldNotUseITheoryDataRow.Id)\n{\n\tpublic const string Key_UseIEnumerable = \"xUnit1052_UseIEnumerable\";\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tforeach (var diagnostic in context.Diagnostics)\n\t\t{\n\t\t\tvar span = diagnostic.Location.SourceSpan;\n\t\t\tvar node = root.FindNode(span);\n\n\t\t\tif (node is not GenericNameSyntax genericNameNode)\n\t\t\t\treturn;\n\n\t\t\tif (genericNameNode.TypeArgumentList.Arguments.Count != 1)\n\t\t\t\treturn;\n\n\t\t\tif (!IsPartOfOnlyTypeDeclaration(genericNameNode))\n\t\t\t\treturn;\n\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Use IEnumerable instead of TheoryData\",\n\t\t\t\t\tct => ConvertToIEnumerable(context.Document, genericNameNode, ct),\n\t\t\t\t\tKey_UseIEnumerable\n\t\t\t\t),\n\t\t\t\tdiagnostic\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic bool IsPartOfOnlyTypeDeclaration(GenericNameSyntax genericName)\n\t{\n\t\tvar parent = genericName.Parent;\n\n\t\tif (parent is VariableDeclarationSyntax variableDeclaration)\n\t\t\treturn variableDeclaration.Variables.All(v => v.Initializer is null);\n\n\t\tif (parent is PropertyDeclarationSyntax propertyDeclaration)\n\t\t\treturn propertyDeclaration.Initializer is null;\n\n\t\treturn parent is ParameterSyntax or MethodDeclarationSyntax;\n\t}\n\n\tstatic async Task<Document> ConvertToIEnumerable(\n\t\tDocument document,\n\t\tGenericNameSyntax node,\n\t\tCancellationToken ct)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, ct).ConfigureAwait(false);\n\t\tvar token = SyntaxFactory.IdentifierName(\"IEnumerable\").Identifier;\n\t\tvar newGenericName = SyntaxFactory.GenericName(token, node.TypeArgumentList);\n\n\t\teditor.ReplaceNode(node, newGenericName);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/TheoryMethodCannotHaveDefaultParameterFixer.cs",
    "content": "using System.Composition;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class TheoryMethodCannotHaveDefaultParameterFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveParameterDefault = \"xUnit1023_RemoveParameterDefault\";\n\n\tpublic TheoryMethodCannotHaveDefaultParameterFixer() :\n\t\tbase(Descriptors.X1023_TheoryMethodCannotHaveDefaultParameter.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar parameter = root.FindNode(context.Span).FirstAncestorOrSelf<ParameterSyntax>();\n\t\tif (parameter is null || parameter.Default is null)\n\t\t\treturn;\n\n\t\tvar parameterName = parameter.Identifier.Text;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => context.Document.RemoveNode(parameter.Default, ct),\n\t\t\t\tKey_RemoveParameterDefault,\n\t\t\t\t\"Remove parameter '{0}' default\", parameterName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X1000/UseCancellationTokenFixer.cs",
    "content": "using System.Collections.Generic;\nusing System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing Microsoft.CodeAnalysis.Operations;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class UseCancellationTokenFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseCancellationTokenArgument = \"xUnit1051_UseCancellationTokenArgument\";\n\n\tpublic UseCancellationTokenFixer() :\n\t\tbase(Descriptors.X1051_UseCancellationToken.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tvar testContextType = TypeSymbolFactory.TestContext_V3(semanticModel.Compilation);\n\t\tif (testContextType is null)\n\t\t\treturn;\n\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ParameterName, out var parameterName))\n\t\t\treturn;\n\t\tif (parameterName is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.ParameterIndex, out var parameterIndexText))\n\t\t\treturn;\n\t\tif (!int.TryParse(parameterIndexText, out var parameterIndex))\n\t\t\treturn;\n\n\t\tif (root.FindNode(diagnostic.Location.SourceSpan) is not InvocationExpressionSyntax invocation)\n\t\t\treturn;\n\n\t\tif (semanticModel.GetOperation(invocation, context.CancellationToken) is not IInvocationOperation invocationOperation)\n\t\t\treturn;\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\n\t\tfor (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++)\n\t\t\tif (arguments[argumentIndex].NameColon?.Name.Identifier.Text == parameterName)\n\t\t\t{\n\t\t\t\tparameterIndex = argumentIndex;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tasync ct =>\n\t\t\t\t{\n\t\t\t\t\tvar editor = await DocumentEditor.CreateAsync(context.Document, ct).ConfigureAwait(false);\n\n\t\t\t\t\tvar testContextCancellationTokenExpression = (ExpressionSyntax)editor.Generator.MemberAccessExpression(\n\t\t\t\t\t\teditor.Generator.MemberAccessExpression(\n\t\t\t\t\t\t\teditor.Generator.TypeExpression(testContextType),\n\t\t\t\t\t\t\t\"Current\"\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\"CancellationToken\"\n\t\t\t\t\t);\n\n\t\t\t\t\tvar args = new List<ArgumentSyntax>(arguments);\n\n\t\t\t\t\tif (invocationOperation.Arguments.FirstOrDefault(arg => arg.ArgumentKind == ArgumentKind.ParamArray) is { } paramsArgument)\n\t\t\t\t\t\tTransformParamsArgument(args, paramsArgument, editor.Generator);\n\n\t\t\t\t\tif (parameterIndex < args.Count)\n\t\t\t\t\t\targs[parameterIndex] = args[parameterIndex].WithExpression(testContextCancellationTokenExpression);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar argument = Argument(testContextCancellationTokenExpression);\n\t\t\t\t\t\tif (parameterIndex > args.Count || args.Any(arg => arg.NameColon is not null))\n\t\t\t\t\t\t\targument = argument.WithNameColon(NameColon(parameterName));\n\n\t\t\t\t\t\targs.Add(argument);\n\t\t\t\t\t}\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(args)))\n\t\t\t\t\t);\n\n\t\t\t\t\treturn editor.GetChangedDocument();\n\t\t\t\t},\n\t\t\t\tKey_UseCancellationTokenArgument,\n\t\t\t\t\"{0} TestContext.Current.CancellationToken\", parameterIndex < arguments.Count ? \"Use\" : \"Add\"\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic void TransformParamsArgument(\n\t\tList<ArgumentSyntax> arguments,\n\t\tIArgumentOperation paramsOperation,\n\t\tSyntaxGenerator generator)\n\t{\n\t\tif (paramsOperation is not { Value: IArrayCreationOperation { Type: IArrayTypeSymbol arrayTypeSymbol, Initializer: { } initializer } })\n\t\t\treturn;\n\n\t\t// We know that the params arguments occupy the end of the list because the language\n\t\t// does not allow regular arguments after params.\n\t\tint paramsCount = initializer.ElementValues.Length;\n\t\tint paramsStart = arguments.Count - paramsCount;\n\n\t\targuments.RemoveRange(paramsStart, paramsCount);\n\n\t\tExpressionSyntax arrayCreation = (ExpressionSyntax)generator.ArrayCreationExpression(\n\t\t\tgenerator.TypeExpression(arrayTypeSymbol.ElementType),\n\t\t\tinitializer.ElementValues.Select(x => x.Syntax)\n\t\t);\n\n\t\targuments.Add(Argument(arrayCreation));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertCollectionContainsShouldNotUseBoolCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertCollectionContainsShouldNotUseBoolCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2017_UseAlternateAssert\";\n\n\tpublic AssertCollectionContainsShouldNotUseBoolCheckFixer() :\n\t\tbase(Descriptors.X2017_AssertCollectionContainsShouldNotUseBoolCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseContainsCheck(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseContainsCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count > 0 && invocation.ArgumentList.Arguments[0].Expression is InvocationExpressionSyntax invocationExpressionSyntax)\n\t\t\t\tif (invocationExpressionSyntax.Expression is MemberAccessExpressionSyntax anyMethodInvocation)\n\t\t\t\t{\n\t\t\t\t\tvar anyTarget = anyMethodInvocation.Expression;\n\t\t\t\t\tvar isTrailingNull =\n\t\t\t\t\t\tinvocationExpressionSyntax.ArgumentList.Arguments.Count == 2\n\t\t\t\t\t\t&& invocationExpressionSyntax.ArgumentList.Arguments[1].Expression.Kind() == SyntaxKind.NullLiteralExpression;\n\t\t\t\t\tvar existingArguments =\n\t\t\t\t\t\tisTrailingNull\n\t\t\t\t\t\t\t? SeparatedList([invocationExpressionSyntax.ArgumentList.Arguments[0]])\n\t\t\t\t\t\t\t: invocationExpressionSyntax.ArgumentList.Arguments;\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(existingArguments.Insert(1, Argument(anyTarget)))))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEmptyCollectionCheckShouldNotBeUsedFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEmptyCollectionCheckShouldNotBeUsedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_AddElementInspector = \"xUnit2011_AddElementInspector\";\n\tpublic const string Key_UseAssertEmpty = \"xUnit2011_UseAssertEmpty\";\n\n\tpublic AssertEmptyCollectionCheckShouldNotBeUsedFixer() :\n\t\tbase(Descriptors.X2011_AssertEmptyCollectionCheckShouldNotBeUsed.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Use Assert.Empty\",\n\t\t\t\tct => UseEmptyCheck(context.Document, invocation, ct),\n\t\t\t\tKey_UseAssertEmpty\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Add element inspector\",\n\t\t\t\tct => AddElementInspector(context.Document, invocation, ct),\n\t\t\t\tKey_AddElementInspector\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseEmptyCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\teditor.ReplaceNode(\n\t\t\t\tinvocation,\n\t\t\t\tinvocation.WithExpression(memberAccess.WithName(IdentifierName(\"Empty\")))\n\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tstatic async Task<Document> AddElementInspector(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tinvocation,\n\t\t\tinvocation.WithArgumentList(invocation.ArgumentList.AddArguments(Argument(SimpleLambdaExpression(Parameter(Identifier(\"x\")), Block()))))\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseDoesNotContain = \"xUnit2029_UseDoesNotContain\";\n\tpublic const string Key_UseContains = \"xUnit2030_UseContains\";\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tstatic readonly string[] targetDiagnostics =\n\t[\n\t\tDescriptors.X2029_AssertEmptyShouldNotBeUsedForCollectionDoesNotContainCheck.Id,\n\t\tDescriptors.X2030_AssertNotEmptyShouldNotBeUsedForCollectionContainsCheck.Id,\n\t];\n\n\tpublic AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer() :\n\t\tbase(targetDiagnostics)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tif (context.Diagnostics.Length != 1)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.Single();\n\t\tstring replaceAssert;\n\t\tstring equivalenceKey;\n\t\tstring title;\n\n\t\tif (diagnostic.Id == targetDiagnostics[0])\n\t\t{\n\t\t\treplaceAssert = Constants.Asserts.DoesNotContain;\n\t\t\tequivalenceKey = Key_UseDoesNotContain;\n\t\t\ttitle = \"Use DoesNotContain\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treplaceAssert = Constants.Asserts.Contains;\n\t\t\tequivalenceKey = Key_UseContains;\n\t\t\ttitle = \"Use Contains\";\n\t\t}\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tc => UseCheck(context.Document, invocation, replaceAssert, c),\n\t\t\t\tequivalenceKey,\n\t\t\t\ttitle\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replaceAssert,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\t\tif (arguments.Count == 1 && arguments[0].Expression is InvocationExpressionSyntax innerInvocationSyntax)\n\t\t\tif (invocation.Expression is MemberAccessExpressionSyntax outerMemberAccess && innerInvocationSyntax.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\t\tif (innerInvocationSyntax.ArgumentList.Arguments[0].Expression is ExpressionSyntax innerArgument)\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList([Argument(memberAccess.Expression), Argument(innerArgument)])))\n\t\t\t\t\t\t\t.WithExpression(outerMemberAccess.WithName(IdentifierName(replaceAssert)))\n\t\t\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2012_UseAlternateAssert\";\n\n\tpublic AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixer() :\n\t\tbase(Descriptors.X2012_AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.AssertMethodName, out var assertMethodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseContainsCheck(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseContainsCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count > 0 && invocation.ArgumentList.Arguments[0].Expression is InvocationExpressionSyntax invocationExpressionSyntax)\n\t\t\t\tif (invocationExpressionSyntax.Expression is MemberAccessExpressionSyntax anyMethodInvocation)\n\t\t\t\t{\n\t\t\t\t\tvar anyTarget = anyMethodInvocation.Expression;\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(invocationExpressionSyntax.ArgumentList.Arguments.Insert(0, Argument(anyTarget)))))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualGenericShouldNotBeUsedForStringValueFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualGenericShouldNotBeUsedForStringValueFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseStringAssertEqual = \"xUnit2006_UseStringAssertEqual\";\n\n\tpublic AssertEqualGenericShouldNotBeUsedForStringValueFixer() :\n\t\tbase(Descriptors.X2006_AssertEqualGenericShouldNotBeUsedForStringValue.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar syntaxNode = root.FindNode(context.Span);\n\t\tvar invocation = syntaxNode.FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tCodeAction.Create(\n\t\t\t\t\t\"Use string Assert.Equal\",\n\t\t\t\t\tct => UseNonGenericStringEqualCheck(context.Document, invocation, ct),\n\t\t\t\t\tKey_UseStringAssertEqual\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n\n\tstatic async Task<Document> UseNonGenericStringEqualCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\teditor.ReplaceNode(\n\t\t\t\tmemberAccess,\n\t\t\t\tmemberAccess.WithName(IdentifierName(Constants.Asserts.Equal))\n\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualLiteralValueShouldBeFirstFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualLiteralValueShouldBeFirstFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_SwapArguments = \"xUnit2000_SwapArguments\";\n\n\tpublic AssertEqualLiteralValueShouldBeFirstFixer() :\n\t\tbase(Descriptors.X2000_AssertEqualLiteralValueShouldBeFirst.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Swap arguments\",\n\t\t\t\tct => SwapArguments(context.Document, invocation, ct),\n\t\t\t\tKey_SwapArguments\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> SwapArguments(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation is not null)\n\t\t{\n\t\t\tvar arguments = invocation.ArgumentList.Arguments;\n\n\t\t\tif (arguments.Count >= 2)\n\t\t\t{\n\t\t\t\tArgumentSyntax expectedArg, actualArg;\n\t\t\t\tif (arguments.All(x => x.NameColon is not null))\n\t\t\t\t{\n\t\t\t\t\texpectedArg = arguments.Single(x => x.NameColon?.Name.Identifier.ValueText == Constants.AssertArguments.Expected);\n\t\t\t\t\tactualArg = arguments.Single(x => x.NameColon?.Name.Identifier.ValueText == Constants.AssertArguments.Actual);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\texpectedArg = arguments[0];\n\t\t\t\t\tactualArg = arguments[1];\n\t\t\t\t}\n\n\t\t\t\teditor.ReplaceNode(expectedArg, expectedArg.WithExpression(actualArg.Expression));\n\t\t\t\teditor.ReplaceNode(actualArg, actualArg.WithExpression(expectedArg.Expression));\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualPrecisionShouldBeInRangeFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualPrecisionShouldBeInRangeFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UsePrecision = \"xUnit2016_UsePrecision\";\n\n\tpublic AssertEqualPrecisionShouldBeInRangeFixer() :\n\t\tbase(Descriptors.X2016_AssertEqualPrecisionShouldBeInRange.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar precisionArgument = root.FindNode(context.Span).FirstAncestorOrSelf<ArgumentSyntax>();\n\t\tif (precisionArgument is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\t\tif (!int.TryParse(replacement, out var replacementInt))\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseRecommendedPrecision(context.Document, precisionArgument, replacementInt, ct),\n\t\t\t\tKey_UsePrecision,\n\t\t\t\t\"Use precision {0}\", replacementInt\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseRecommendedPrecision(\n\t\tDocument document,\n\t\tArgumentSyntax precisionArgument,\n\t\tint replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tprecisionArgument,\n\t\t\tArgument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(replacement)))\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualShouldNotBeUsedForBoolLiteralCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualShouldNotBeUsedForBoolLiteralCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2004_UseAlterateAssert\";\n\n\tpublic AssertEqualShouldNotBeUsedForBoolLiteralCheckFixer() :\n\t\tbase(Descriptors.X2004_AssertEqualShouldNotUsedForBoolLiteralCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.LiteralValue, out var literalValue))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.Create(\n\t\t\t\t\tct => UseBoolCheckAsync(context.Document, invocation, replacement, ct),\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n\n\tstatic async Task<Document> UseBoolCheckAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.ArgumentList.Arguments.Count > 1 && invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\teditor.ReplaceNode(\n\t\t\t\tinvocation,\n\t\t\t\tinvocation\n\t\t\t\t\t.WithArgumentList(invocation.ArgumentList.WithArguments(SingletonSeparatedList(invocation.ArgumentList.Arguments[1])))\n\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualShouldNotBeUsedForCollectionSizeCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualShouldNotBeUsedForCollectionSizeCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2013_UseAlterateAssert\";\n\n\tpublic AssertEqualShouldNotBeUsedForCollectionSizeCheckFixer() :\n\t\tbase(Descriptors.X2013_AssertEqualShouldNotBeUsedForCollectionSizeCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.SizeValue, out var sizeValue))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseCollectionSizeAssertionAsync(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseCollectionSizeAssertionAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t{\n\t\t\tvar expression = GetExpressionSyntax(invocation);\n\n\t\t\tif (expression is not null)\n\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\tinvocation,\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(invocation.ArgumentList.WithArguments(SingletonSeparatedList(Argument(expression))))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t);\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tstatic ExpressionSyntax? GetExpressionSyntax(InvocationExpressionSyntax invocation)\n\t{\n\t\tif (invocation.ArgumentList.Arguments.Count < 2)\n\t\t\treturn null;\n\n\t\tif (invocation.ArgumentList.Arguments[1].Expression is InvocationExpressionSyntax sizeInvocation)\n\t\t\treturn (sizeInvocation.Expression as MemberAccessExpressionSyntax)?.Expression;\n\n\t\tvar sizeMemberAccess = invocation.ArgumentList.Arguments[1].Expression as MemberAccessExpressionSyntax;\n\t\treturn sizeMemberAccess?.Expression;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualShouldNotBeUsedForNullCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualShouldNotBeUsedForNullCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2003_UseAlternateAssert\";\n\n\tpublic AssertEqualShouldNotBeUsedForNullCheckFixer() :\n\t\tbase(Descriptors.X2003_AssertEqualShouldNotUsedForNullCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.Create(\n\t\t\t\t\tct => UseNullCheckAsync(context.Document, invocation, replacement, ct),\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n\n\tstatic async Task<Document> UseNullCheckAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.ArgumentList.Arguments.Count > 1 && invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\teditor.ReplaceNode(\n\t\t\t\tinvocation,\n\t\t\t\tinvocation\n\t\t\t\t\t.WithArgumentList(invocation.ArgumentList.WithArguments(SingletonSeparatedList(invocation.ArgumentList.Arguments[1])))\n\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertEqualsShouldNotBeUsedFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertEqualsShouldNotBeUsedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2001_UseAlternateAssert\";\n\n\tpublic AssertEqualsShouldNotBeUsedFixer() :\n\t\tbase(Descriptors.X2001_AssertEqualsShouldNotBeUsed.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.UseDifferentAssertMethod(\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\tcontext.Document,\n\t\t\t\t\tinvocation,\n\t\t\t\t\treplacement\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertIsTypeShouldNotBeUsedForAbstractTypeFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertIsTypeShouldNotBeUsedForAbstractTypeFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2018_UseAlternateAssert\";\n\n\tpublic AssertIsTypeShouldNotBeUsedForAbstractTypeFixer() :\n\t\tbase(Descriptors.X2018_AssertIsTypeShouldNotBeUsedForAbstractType.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.UseExactMatch, out var useExactMatch))\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tif (useExactMatch == bool.TrueString)\n\t\t{\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.Create(\n\t\t\t\t\tct => UseExactMatchFalse(context.Document, invocation, ct),\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\t\"Use 'exactMatch: false'\"\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar simpleNameSyntax = invocation.GetSimpleName();\n\t\t\tif (simpleNameSyntax is null)\n\t\t\t\treturn;\n\n\t\t\tvar methodName = simpleNameSyntax.Identifier.Text;\n\t\t\tif (!AssertIsTypeShouldNotBeUsedForAbstractType.ReplacementMethods.TryGetValue(methodName, out var replacementName))\n\t\t\t\treturn;\n\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.Create(\n\t\t\t\t\tct => UseIsAssignableFrom(context.Document, simpleNameSyntax, replacementName, ct),\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\t\"Use Assert.{0}\", replacementName\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic async Task<Document> UseExactMatchFalse(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tvar falseArgument =\n\t\t\tParseArgumentList(\"false\")\n\t\t\t\t.Arguments[0]\n\t\t\t\t.WithNameColon(NameColon(\"exactMatch\"));\n\n\t\tvar argumentList = invocation.ArgumentList;\n\t\targumentList =\n\t\t\targumentList.Arguments.Count == 2\n\t\t\t\t? argumentList.ReplaceNode(argumentList.Arguments[1], falseArgument)\n\t\t\t\t: argumentList.AddArguments(falseArgument);\n\n\t\teditor.ReplaceNode(invocation.ArgumentList, argumentList);\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tstatic async Task<Document> UseIsAssignableFrom(\n\t\tDocument document,\n\t\tSimpleNameSyntax simpleName,\n\t\tstring replacementName,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tsimpleName,\n\t\t\tsimpleName.WithIdentifier(Identifier(replacementName))\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertNullShouldNotBeCalledOnValueTypesFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertNullShouldNotBeCalledOnValueTypesFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_RemoveAssert = \"xUnit2002_RemoveAssert\";\n\n\tpublic AssertNullShouldNotBeCalledOnValueTypesFixer() :\n\t\tbase(Descriptors.X2002_AssertNullShouldNotBeCalledOnValueTypes.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar call = root.FindNode(context.Span).FirstAncestorOrSelf<ExpressionStatementSyntax>();\n\t\tif (call is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Remove unnecessary assertion\",\n\t\t\t\tct => RemoveCall(context.Document, call, ct),\n\t\t\t\tKey_RemoveAssert\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveCall(\n\t\tDocument document,\n\t\tExpressionStatementSyntax call,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar containsLeadingComment =\n\t\t\tcall\n\t\t\t\t.GetLeadingTrivia()\n\t\t\t\t.Any(t => t.IsKind(SyntaxKind.MultiLineCommentTrivia) || t.IsKind(SyntaxKind.SingleLineCommentTrivia));\n\t\tvar removeOptions =\n\t\t\tcontainsLeadingComment\n\t\t\t\t? SyntaxRemoveOptions.KeepLeadingTrivia | SyntaxRemoveOptions.AddElasticMarker\n\t\t\t\t: SyntaxRemoveOptions.KeepNoTrivia;\n\n\t\teditor.RemoveNode(call, removeOptions);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertRegexMatchShouldNotUseBoolLiteralCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertRegexMatchShouldNotUseBoolLiteralCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2008_UseAlternateAssert\";\n\n\tpublic AssertRegexMatchShouldNotUseBoolLiteralCheckFixer() :\n\t\tbase(Descriptors.X2008_AssertRegexMatchShouldNotUseBoolLiteralCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.IsStatic, out var isStatic))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseRegexCheckAsync(context.Document, invocation, replacement, isStatic == bool.TrueString, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseRegexCheckAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tbool isStatic,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count > 0 && invocation.ArgumentList.Arguments[0].Expression is InvocationExpressionSyntax regexIsMatchInvocation)\n\t\t\t{\n\t\t\t\tif (isStatic)\n\t\t\t\t{\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(regexIsMatchInvocation.ArgumentList.Arguments.Reverse())))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse if (regexIsMatchInvocation.ArgumentList.Arguments.Count > 0 && regexIsMatchInvocation.Expression is MemberAccessExpressionSyntax regexMemberAccess)\n\t\t\t\t{\n\t\t\t\t\tvar regexMember = regexMemberAccess.Expression;\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList([Argument(regexMember), regexIsMatchInvocation.ArgumentList.Arguments[0]])))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertSameShouldNotBeCalledOnValueTypesFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertSameShouldNotBeCalledOnValueTypesFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2005_UseAlternateAssert\";\n\n\tpublic AssertSameShouldNotBeCalledOnValueTypesFixer() :\n\t\tbase(Descriptors.X2005_AssertSameShouldNotBeCalledOnValueTypes.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax)\n\t\t\tcontext.RegisterCodeFix(\n\t\t\t\tXunitCodeAction.UseDifferentAssertMethod(\n\t\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\tcontext.Document,\n\t\t\t\t\tinvocation,\n\t\t\t\t\treplacement\n\t\t\t\t),\n\t\t\t\tcontext.Diagnostics\n\t\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertSingleShouldBeUsedForSingleParameterFixer.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Composition;\nusing System.Globalization;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Simplification;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertSingleShouldBeUsedForSingleParameterFixer : XunitCodeFixProvider\n{\n\tconst string DefaultParameterName = \"item\";\n\tpublic const string Key_UseSingleMethod = \"xUnit2023_UseSingleMethod\";\n\n\tpublic AssertSingleShouldBeUsedForSingleParameterFixer() :\n\t\tbase(Descriptors.X2023_AssertSingleShouldBeUsedForSingleParameter.Id)\n\t{ }\n\n\tstatic string GetSafeVariableName(\n\t\tstring targetParameterName,\n\t\tImmutableHashSet<string> localSymbols)\n\t{\n\t\tvar idx = 2;\n\t\tvar result = targetParameterName;\n\n\t\twhile (localSymbols.Contains(result))\n\t\t\tresult = string.Format(CultureInfo.InvariantCulture, \"{0}_{1}\", targetParameterName, idx++);\n\n\t\treturn result;\n\t}\n\n\tstatic IEnumerable<SyntaxNode> GetLambdaStatements(SimpleLambdaExpressionSyntax lambdaExpression)\n\t{\n\t\tif (lambdaExpression.ExpressionBody is InvocationExpressionSyntax lambdaBody)\n\t\t\tyield return ExpressionStatement(lambdaBody).WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);\n\t\telse if (lambdaExpression.Block is not null && lambdaExpression.Block.Statements.Count != 0)\n\t\t\tforeach (var statement in lambdaExpression.Block.Statements)\n\t\t\t\tyield return statement.WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);\n\t}\n\n\tstatic SyntaxNode GetMethodInvocation(\n\t\tIdentifierNameSyntax methodExpression,\n\t\tstring parameterName,\n\t\tbool needAwait)\n\t{\n\t\tExpressionSyntax invocation = InvocationExpression(\n\t\t\tmethodExpression,\n\t\t\tArgumentList(SingletonSeparatedList(Argument(IdentifierName(parameterName))))\n\t\t);\n\n\t\tif (needAwait)\n\t\t\tinvocation = AwaitExpression(invocation);\n\n\t\treturn ExpressionStatement(invocation);\n\t}\n\n\tstatic LocalDeclarationStatementSyntax OneItemVariableStatement(\n\t\tstring parameterName,\n\t\tInvocationExpressionSyntax replacementNode)\n\t{\n\t\tvar equalsToReplacementNode = EqualsValueClause(replacementNode);\n\n\t\tvar oneItemVariableDeclaration = VariableDeclaration(\n\t\t\tParseTypeName(\"var\"),\n\t\t\tSingletonSeparatedList(\n\t\t\t\tVariableDeclarator(Identifier(parameterName))\n\t\t\t\t\t.WithInitializer(equalsToReplacementNode)\n\t\t\t)\n\t\t).NormalizeWhitespace();\n\n\t\treturn LocalDeclarationStatement(oneItemVariableDeclaration);\n\t}\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tif (context.Diagnostics.FirstOrDefault() is not Diagnostic diagnostic)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.AssertMethodName, out var assertMethodName) || assertMethodName is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement) || replacement is null)\n\t\t\treturn;\n\n\t\t// We want to remove the 'await' in front of 'Assert.CollectionAsync' since 'Assert.Single' doesn't need it\n\t\tvar nodeToReplace = invocation.Parent;\n\t\tif (assertMethodName == Constants.Asserts.CollectionAsync && nodeToReplace is AwaitExpressionSyntax)\n\t\t\tnodeToReplace = nodeToReplace.Parent;\n\n\t\t// Can't replace something that's not a standlone expression\n\t\tif (nodeToReplace is not ExpressionStatementSyntax)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseSingleMethod(context.Document, invocation, nodeToReplace, assertMethodName, replacement, ct),\n\t\t\t\tKey_UseSingleMethod,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseSingleMethod(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tSyntaxNode nodeToReplace,\n\t\tstring assertMethodName,\n\t\tstring replacementMethod,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t{\n\t\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\t\t\tif (semanticModel is not null && invocation.Parent is not null)\n\t\t\t{\n\t\t\t\tvar statements = new List<SyntaxNode>();\n\t\t\t\tvar startLocation = invocation.GetLocation().SourceSpan.Start;\n\t\t\t\tvar localSymbols = semanticModel.LookupSymbols(startLocation).OfType<ILocalSymbol>().Select(s => s.Name).ToImmutableHashSet();\n\t\t\t\tvar replacementNode =\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList([Argument(invocation.ArgumentList.Arguments[0].Expression)])))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacementMethod)));\n\n\t\t\t\tif (invocation.ArgumentList.Arguments[1].Expression is SimpleLambdaExpressionSyntax lambdaExpression)\n\t\t\t\t{\n\t\t\t\t\tvar originalParameterName = lambdaExpression.Parameter.Identifier.Text;\n\t\t\t\t\tvar parameterName = GetSafeVariableName(originalParameterName, localSymbols);\n\n\t\t\t\t\tif (parameterName != originalParameterName)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar body = lambdaExpression.Body;\n\t\t\t\t\t\tvar tokens =\n\t\t\t\t\t\t\tbody\n\t\t\t\t\t\t\t\t.DescendantTokens()\n\t\t\t\t\t\t\t\t.Where(t => t.IsKind(SyntaxKind.IdentifierToken) && t.Text == originalParameterName)\n\t\t\t\t\t\t\t\t.ToArray();\n\n\t\t\t\t\t\tbody = body.ReplaceTokens(tokens, (t1, t2) => Identifier(t2.LeadingTrivia, parameterName, t2.TrailingTrivia));\n\t\t\t\t\t\tlambdaExpression = lambdaExpression.WithBody(body);\n\t\t\t\t\t}\n\n\t\t\t\t\tstatements.Add(OneItemVariableStatement(parameterName, replacementNode).WithTriviaFrom(nodeToReplace));\n\t\t\t\t\tstatements.AddRange(GetLambdaStatements(lambdaExpression));\n\t\t\t\t}\n\t\t\t\telse if (invocation.ArgumentList.Arguments[1].Expression is IdentifierNameSyntax identifierExpression)\n\t\t\t\t{\n\t\t\t\t\tvar isMethod = semanticModel.GetSymbolInfo(identifierExpression, cancellationToken).Symbol?.Kind == SymbolKind.Method;\n\t\t\t\t\tif (isMethod)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar parameterName = GetSafeVariableName(DefaultParameterName, localSymbols);\n\n\t\t\t\t\t\tstatements.Add(OneItemVariableStatement(parameterName, replacementNode).WithTriviaFrom(nodeToReplace));\n\t\t\t\t\t\tstatements.Add(GetMethodInvocation(identifierExpression, parameterName, needAwait: assertMethodName == Constants.Asserts.CollectionAsync));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\teditor.InsertBefore(nodeToReplace, statements);\n\t\t\t\teditor.RemoveNode(nodeToReplace);\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertSingleShouldUseTwoArgumentCallFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertSingleShouldUseTwoArgumentCallFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseTwoArguments = \"xUnit2031_UseSingleTwoArgumentCall\";\n\n\tpublic AssertSingleShouldUseTwoArgumentCallFixer() :\n\t\tbase(Descriptors.X2031_AssertSingleShouldUseTwoArgumentCall.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tc => UseCheck(context.Document, invocation, c),\n\t\t\t\tKey_UseTwoArguments,\n\t\t\t\t\"Use two-argument call\"\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tvar arguments = invocation.ArgumentList.Arguments;\n\t\tif (arguments.Count == 1 && arguments[0].Expression is InvocationExpressionSyntax innerInvocationSyntax)\n\t\t\tif (innerInvocationSyntax.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\t\tif (innerInvocationSyntax.ArgumentList.Arguments[0].Expression is ExpressionSyntax innerArgument)\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList([Argument(memberAccess.Expression), Argument(innerArgument)])))\n\t\t\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertStringEqualityCheckShouldNotUseBoolCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertStringEqualityCheckShouldNotUseBoolCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2010_UseAlternateAssert\";\n\n\tpublic AssertStringEqualityCheckShouldNotUseBoolCheckFixer() :\n\t\tbase(Descriptors.X2010_AssertStringEqualityCheckShouldNotUseBoolCheckFixer.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.AssertMethodName, out var assertMethodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.IsStaticMethodCall, out var isStaticMethodCall))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.IgnoreCase, out var ignoreCaseText))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar ignoreCase = ignoreCaseText switch\n\t\t{\n\t\t\t\"True\" => true,\n\t\t\t\"False\" => false,\n\t\t\t_ => default(bool?)\n\t\t};\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseEqualCheck(context.Document, invocation, replacement, isStaticMethodCall == bool.TrueString, ignoreCase, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseEqualCheck(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tbool isStaticMethodCall,\n\t\tbool? ignoreCase,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count > 0 && invocation.ArgumentList.Arguments[0].Expression is InvocationExpressionSyntax equalsInvocation)\n\t\t\t\tif (equalsInvocation.Expression is MemberAccessExpressionSyntax equalsMethodInvocation)\n\t\t\t\t{\n\t\t\t\t\tvar equalsTarget = equalsMethodInvocation.Expression;\n\t\t\t\t\tvar arguments =\n\t\t\t\t\t\tisStaticMethodCall\n\t\t\t\t\t\t\t? equalsInvocation.ArgumentList.Arguments\n\t\t\t\t\t\t\t: equalsInvocation.ArgumentList.Arguments.Insert(0, Argument(equalsTarget));\n\n\t\t\t\t\tif (ignoreCase == true)\n\t\t\t\t\t\targuments = arguments.Replace(\n\t\t\t\t\t\t\targuments[arguments.Count - 1],\n\t\t\t\t\t\t\tArgument(\n\t\t\t\t\t\t\t\tNameColon(IdentifierName(Constants.AssertArguments.IgnoreCase)),\n\t\t\t\t\t\t\t\targuments[arguments.Count - 1].RefOrOutKeyword,\n\t\t\t\t\t\t\t\tLiteralExpression(SyntaxKind.TrueLiteralExpression)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\telse if (ignoreCase == false)\n\t\t\t\t\t\targuments = arguments.RemoveAt(arguments.Count - 1);\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(arguments)))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertSubstringCheckShouldNotUseBoolCheckFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertSubstringCheckShouldNotUseBoolCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2009_UseAlternateAssert\";\n\n\tpublic AssertSubstringCheckShouldNotUseBoolCheckFixer() :\n\t\tbase(Descriptors.X2009_AssertSubstringCheckShouldNotUseBoolCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.AssertMethodName, out var assertMethodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.SubstringMethodName, out var substringMethodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseSubstringCheckAsync(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseSubstringCheckAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count > 0 && invocation.ArgumentList.Arguments[0].Expression is InvocationExpressionSyntax substringInvocation)\n\t\t\t\tif (substringInvocation.Expression is MemberAccessExpressionSyntax substringMethodInvocation)\n\t\t\t\t{\n\t\t\t\t\tvar substringTarget = substringMethodInvocation.Expression;\n\n\t\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(substringInvocation.ArgumentList.Arguments.Insert(1, Argument(substringTarget)))))\n\t\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixer.cs",
    "content": "using System.Collections.Generic;\nusing System.Composition;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing Microsoft.CodeAnalysis.Operations;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2014_UseAlternateAssert\";\n\n\tpublic AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixer() :\n\t\tbase(Descriptors.X2014_AssertThrowsShouldNotBeUsedForAsyncThrowsCheck.Id)\n\t{ }\n\n\tstatic ExpressionSyntax GetAsyncAssertionInvocation(\n\t\tInvocationExpressionSyntax invocation,\n\t\tMemberAccessExpressionSyntax memberAccess,\n\t\tstring replacement)\n\t{\n\t\tvar asyncAssertionInvocation = invocation\n\t\t\t.WithExpression(memberAccess.WithName(GetAsyncAssertionMethodName(memberAccess, replacement)))\n\t\t\t.WithArgumentList(invocation.ArgumentList);\n\n\t\tif (invocation.Parent.IsKind(SyntaxKind.AwaitExpression))\n\t\t\treturn asyncAssertionInvocation;\n\n\t\treturn AwaitExpression(asyncAssertionInvocation.WithoutLeadingTrivia())\n\t\t\t.WithLeadingTrivia(invocation.GetLeadingTrivia());\n\t}\n\n\tstatic SimpleNameSyntax GetAsyncAssertionMethodName(\n\t\tMemberAccessExpressionSyntax memberAccess,\n\t\tstring replacement)\n\t{\n\t\tif (memberAccess.Name is not GenericNameSyntax genericNameSyntax)\n\t\t\treturn IdentifierName(replacement);\n\n\t\treturn GenericName(IdentifierName(replacement).Identifier, genericNameSyntax.TypeArgumentList);\n\t}\n\n\tstatic IFunctionFixer? GetFunctionFixer(\n\t\tSyntaxNode? node,\n\t\tSemanticModel semanticModel,\n\t\tDocumentEditor editor)\n\t{\n\t\treturn node switch\n\t\t{\n\t\t\tAnonymousFunctionExpressionSyntax anonymousFunction => new AnonymousFunctionFixer(anonymousFunction, semanticModel, editor),\n\t\t\tLocalFunctionStatementSyntax localFunction => new LocalFunctionFixer(localFunction, semanticModel, editor),\n\t\t\tMethodDeclarationSyntax method => new MethodFixer(method, editor),\n\t\t\t_ => null\n\t\t};\n\t}\n\n\tstatic SyntaxNode? GetParentFunction(InvocationExpressionSyntax invocation)\n\t{\n\t\treturn invocation.Parent?.FirstAncestorOrSelf<SyntaxNode>(IsFunction);\n\t}\n\n\tstatic bool IsFunction(SyntaxNode node)\n\t{\n\t\treturn node switch\n\t\t{\n\t\t\tAnonymousFunctionExpressionSyntax => true,\n\t\t\tLocalFunctionStatementSyntax => true,\n\t\t\tMethodDeclarationSyntax => true,\n\t\t\t_ => false\n\t\t};\n\t}\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar method = invocation.FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (method is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.MethodName, out var methodName))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseAsyncAssertion(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic bool ShouldFixParentFunction(\n\t\t[NotNullWhen(true)] IFunctionFixer? parentFunctionFixer,\n\t\tIFunctionFixer? childFunctionFixer,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\t// 3. Parent function is null, and child function is outer method.\n\t\t// Outer method was just fixed, so should stop fixing now.\n\t\tif (parentFunctionFixer is null)\n\t\t\treturn false;\n\n\t\t// 1. Parent function is innermost function, and child function is null.\n\t\t// Should fix innermost function unconditionally.\n\t\tif (childFunctionFixer is null)\n\t\t\treturn true;\n\n\t\t// 2. Parent function and child function are not null.\n\t\t// Should fix parent function if and only if child function is invoked inside parent function, and otherwise stop fixing.\n\t\treturn childFunctionFixer.ShouldFixParentFunction(parentFunctionFixer.Function, cancellationToken);\n\t}\n\n\tstatic async Task<Document> UseAsyncAssertion(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess && semanticModel is not null)\n\t\t{\n\t\t\tvar asyncAssertionInvocation = GetAsyncAssertionInvocation(invocation, memberAccess, replacement);\n\t\t\teditor.ReplaceNode(invocation, asyncAssertionInvocation);\n\n\t\t\tvar parentFunctionFixer = GetFunctionFixer(GetParentFunction(invocation), semanticModel, editor);\n\t\t\tIFunctionFixer? childFunctionFixer = null;\n\n\t\t\twhile (ShouldFixParentFunction(parentFunctionFixer, childFunctionFixer, cancellationToken))\n\t\t\t{\n\t\t\t\tawait parentFunctionFixer.Fix(cancellationToken).ConfigureAwait(false);\n\n\t\t\t\tchildFunctionFixer = parentFunctionFixer;\n\t\t\t\tparentFunctionFixer = GetFunctionFixer(childFunctionFixer.GetParentFunction(), semanticModel, editor);\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n\n\tinterface IFunctionFixer\n\t{\n\t\tSyntaxNode Function { get; }\n\t\tTask Fix(CancellationToken cancellationToken);\n\t\tSyntaxNode? GetParentFunction();\n\t\tbool ShouldFixParentFunction(SyntaxNode parentFunction, CancellationToken cancellationToken);\n\t}\n\n\tsealed class AnonymousFunctionFixer(\n\t\tAnonymousFunctionExpressionSyntax anonymousFunction,\n\t\tSemanticModel semanticModel,\n\t\tDocumentEditor editor) :\n\t\t\tIFunctionFixer\n\t{\n\t\tpublic SyntaxNode Function => anonymousFunction;\n\n\t\tpublic async Task Fix(CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar modifiers = AsyncHelper.GetModifiersWithAsyncKeywordAdded(anonymousFunction.Modifiers);\n\n\t\t\teditor.ReplaceNode(anonymousFunction, (node, generator) =>\n\t\t\t{\n\t\t\t\tif (node is AnonymousFunctionExpressionSyntax anonymousFunction)\n\t\t\t\t\treturn anonymousFunction.WithModifiers(modifiers);\n\n\t\t\t\treturn node;\n\t\t\t});\n\n\t\t\tvar declaration = await GetLocalDeclaration(cancellationToken).ConfigureAwait(false);\n\t\t\tif (declaration is null)\n\t\t\t\treturn;\n\n\t\t\tvar delegateType = await AsyncHelper.GetAsyncSystemDelegateType(declaration, anonymousFunction, editor, cancellationToken).ConfigureAwait(false);\n\t\t\tif (delegateType is null)\n\t\t\t\treturn;\n\n\t\t\teditor.ReplaceNode(declaration, (node, generator) =>\n\t\t\t{\n\t\t\t\tif (node is VariableDeclarationSyntax declaration)\n\t\t\t\t\treturn declaration\n\t\t\t\t\t\t.WithType(delegateType)\n\t\t\t\t\t\t.WithLeadingTrivia(declaration.GetLeadingTrivia());\n\n\t\t\t\treturn node;\n\t\t\t});\n\t\t}\n\n\t\tstatic IEnumerable<IOperation> GetAncestors(IOperation? operation)\n\t\t{\n\t\t\twhile ((operation = operation?.Parent) is not null)\n\t\t\t\tyield return operation;\n\t\t}\n\n\t\tstatic IConditionalAccessOperation? GetConditionalAccessOperation(IConditionalAccessInstanceOperation instance) =>\n\t\t\tGetAncestors(instance)\n\t\t\t\t.FirstOrDefault(operation =>\n\t\t\t\t\toperation.Syntax.SpanStart >= instance.Syntax.SpanStart\n\t\t\t\t\t&& operation is IConditionalAccessOperation conditionalAccess\n\t\t\t\t\t&& conditionalAccess.Operation.Syntax.Equals(instance.Syntax)\n\t\t\t\t) as IConditionalAccessOperation;\n\n\t\tstatic ILocalSymbol? GetInvocationLocalSymbol(IInvocationOperation invocation)\n\t\t{\n\t\t\tif (invocation.Instance is ILocalReferenceOperation localReference)\n\t\t\t\treturn localReference.Local;\n\n\t\t\tif (invocation.Instance is IConditionalAccessInstanceOperation instance\n\t\t\t\t&& GetConditionalAccessOperation(instance) is IConditionalAccessOperation conditionalAccess\n\t\t\t\t&& conditionalAccess.Operation is ILocalReferenceOperation conditionalAccessLocalReference)\n\t\t\t{\n\t\t\t\treturn conditionalAccessLocalReference.Local;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tasync Task<VariableDeclarationSyntax?> GetLocalDeclaration(CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (anonymousFunction.Parent is EqualsValueClauseSyntax clause\n\t\t\t\t&& clause.Parent is VariableDeclaratorSyntax declarator\n\t\t\t\t&& declarator.Parent is VariableDeclarationSyntax declaration)\n\t\t\t{\n\t\t\t\treturn declaration;\n\t\t\t}\n\n\t\t\tvar operation = semanticModel.GetOperation(anonymousFunction, cancellationToken) as IAnonymousFunctionOperation;\n\t\t\treturn await GetLocalDeclaration(operation, cancellationToken).ConfigureAwait(false);\n\t\t}\n\n\t\tstatic async Task<VariableDeclarationSyntax?> GetLocalDeclaration(\n\t\t\tIAnonymousFunctionOperation? operation,\n\t\t\tCancellationToken cancellationToken)\n\t\t{\n\t\t\tif (operation?.Parent is not IDelegateCreationOperation delegateCreation)\n\t\t\t\treturn null;\n\n\t\t\tif (delegateCreation.Parent is IVariableInitializerOperation initializer\n\t\t\t\t&& initializer.Parent is IVariableDeclaratorOperation declarator\n\t\t\t\t&& declarator.Parent is IVariableDeclarationOperation declaration)\n\t\t\t{\n\t\t\t\treturn declaration.Syntax as VariableDeclarationSyntax;\n\t\t\t}\n\n\t\t\tif (delegateCreation.Parent is IAssignmentOperation assignment\n\t\t\t\t&& assignment.Target is ILocalReferenceOperation localReference)\n\t\t\t{\n\t\t\t\tvar declaratorReference = localReference.Local.DeclaringSyntaxReferences.SingleOrDefault();\n\t\t\t\tif (declaratorReference is null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar node = await declaratorReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);\n\t\t\t\tif (node is VariableDeclaratorSyntax declaratorSyntax)\n\t\t\t\t\treturn declaratorSyntax.Parent as VariableDeclarationSyntax;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tILocalSymbol? GetLocalDeclarationSymbol(CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (semanticModel.GetOperation(anonymousFunction, cancellationToken) is IAnonymousFunctionOperation operation\n\t\t\t\t&& operation.Parent is IDelegateCreationOperation delegateCreation)\n\t\t\t{\n\t\t\t\tif (delegateCreation.Parent is IVariableInitializerOperation initializer\n\t\t\t\t\t&& initializer.Parent is IVariableDeclaratorOperation declarator)\n\t\t\t\t{\n\t\t\t\t\treturn declarator.Symbol;\n\t\t\t\t}\n\n\t\t\t\tif (delegateCreation.Parent is IAssignmentOperation assignment\n\t\t\t\t\t&& assignment.Target is ILocalReferenceOperation localReference)\n\t\t\t\t{\n\t\t\t\t\treturn localReference.Local;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic SyntaxNode? GetParentFunction() =>\n\t\t\tanonymousFunction.Parent?.FirstAncestorOrSelf<SyntaxNode>(IsFunction);\n\n\t\tpublic bool ShouldFixParentFunction(\n\t\t\tSyntaxNode parentFunction,\n\t\t\tCancellationToken cancellationToken)\n\t\t{\n\t\t\tvar symbol = GetLocalDeclarationSymbol(cancellationToken);\n\t\t\tif (symbol is null)\n\t\t\t\treturn false;\n\n\t\t\tvar invocations = parentFunction\n\t\t\t\t.DescendantNodes()\n\t\t\t\t.Where(node => node is InvocationExpressionSyntax)\n\t\t\t\t.Select(node => semanticModel.GetOperation((InvocationExpressionSyntax)node, cancellationToken) as IInvocationOperation)\n\t\t\t\t.Where(invocation => invocation is not null\n\t\t\t\t\t&& invocation.TargetMethod.MethodKind == MethodKind.DelegateInvoke\n\t\t\t\t\t&& GetInvocationLocalSymbol(invocation) is ILocalSymbol invocationLocalSymbol\n\t\t\t\t\t&& SymbolEqualityComparer.Default.Equals(invocationLocalSymbol, symbol));\n\n\t\t\treturn invocations.Any();\n\t\t}\n\t}\n\n\tsealed class LocalFunctionFixer(\n\t\tLocalFunctionStatementSyntax localFunction,\n\t\tSemanticModel semanticModel,\n\t\tDocumentEditor editor) :\n\t\t\tIFunctionFixer\n\t{\n\t\tpublic SyntaxNode Function => localFunction;\n\n\t\tpublic async Task Fix(CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar returnType = await AsyncHelper.GetAsyncReturnType(localFunction.ReturnType, editor, cancellationToken).ConfigureAwait(false);\n\t\t\tif (returnType is null)\n\t\t\t\treturn;\n\n\t\t\tvar modifiers = AsyncHelper.GetModifiersWithAsyncKeywordAdded(localFunction.Modifiers);\n\n\t\t\teditor.ReplaceNode(localFunction, (node, generator) =>\n\t\t\t{\n\t\t\t\tif (node is LocalFunctionStatementSyntax localFunction)\n\t\t\t\t\treturn localFunction\n\t\t\t\t\t\t.WithModifiers(modifiers)\n\t\t\t\t\t\t.WithReturnType(returnType);\n\n\t\t\t\treturn node;\n\t\t\t});\n\t\t}\n\n\t\tpublic SyntaxNode? GetParentFunction() =>\n\t\t\tlocalFunction.Parent?.FirstAncestorOrSelf<SyntaxNode>(IsFunction);\n\n\t\tpublic bool ShouldFixParentFunction(\n\t\t\tSyntaxNode parentFunction,\n\t\t\tCancellationToken cancellationToken)\n\t\t{\n\t\t\tif (semanticModel.GetOperation(localFunction, cancellationToken) is not ILocalFunctionOperation operation)\n\t\t\t\treturn false;\n\n\t\t\tvar symbol = operation.Symbol;\n\t\t\tif (symbol is null)\n\t\t\t\treturn false;\n\n\t\t\treturn\n\t\t\t\tparentFunction\n\t\t\t\t\t.DescendantNodes()\n\t\t\t\t\t.Where(node => node is InvocationExpressionSyntax)\n\t\t\t\t\t.Select(node => semanticModel.GetOperation((InvocationExpressionSyntax)node, cancellationToken) as IInvocationOperation)\n\t\t\t\t\t.Any(invocation => SymbolEqualityComparer.Default.Equals(invocation?.TargetMethod, symbol));\n\t\t}\n\t}\n\n\tsealed class MethodFixer(\n\t\tMethodDeclarationSyntax method,\n\t\tDocumentEditor editor) :\n\t\t\tIFunctionFixer\n\t{\n\t\tpublic SyntaxNode Function => method;\n\n\t\tpublic async Task Fix(CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar returnType = await AsyncHelper.GetAsyncReturnType(method.ReturnType, editor, cancellationToken).ConfigureAwait(false);\n\t\t\tif (returnType is null)\n\t\t\t\treturn;\n\n\t\t\tvar modifiers = AsyncHelper.GetModifiersWithAsyncKeywordAdded(method.Modifiers);\n\n\t\t\teditor.ReplaceNode(method, (node, generator) =>\n\t\t\t{\n\t\t\t\tif (node is MethodDeclarationSyntax method)\n\t\t\t\t\treturn method\n\t\t\t\t\t\t.WithModifiers(modifiers)\n\t\t\t\t\t\t.WithReturnType(returnType);\n\n\t\t\t\treturn node;\n\t\t\t});\n\t\t}\n\n\t\tpublic SyntaxNode? GetParentFunction() =>\n\t\t\tnull;\n\n\t\tpublic bool ShouldFixParentFunction(\n\t\t\tSyntaxNode parentFunction,\n\t\t\tCancellationToken cancellationToken) =>\n\t\t\t\tfalse;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AssignableFromAssertionIsConfusinglyNamedFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AssignableFromAssertionIsConfusinglyNamedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseIsType = \"xUnit2032_UseIsType\";\n\n\tpublic AssignableFromAssertionIsConfusinglyNamedFixer() :\n\t\tbase(Descriptors.X2032_AssignableFromAssertionIsConfusinglyNamed.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar simpleNameSyntax = invocation.GetSimpleName();\n\t\tif (simpleNameSyntax is null)\n\t\t\treturn;\n\n\t\tvar methodName = simpleNameSyntax.Identifier.Text;\n\t\tif (!AssignableFromAssertionIsConfusinglyNamed.ReplacementMethods.TryGetValue(methodName, out var replacementName))\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseIsType(context.Document, invocation, simpleNameSyntax, replacementName, ct),\n\t\t\t\tKey_UseIsType,\n\t\t\t\t\"Use Assert.{0}\", replacementName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseIsType(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tSimpleNameSyntax simpleName,\n\t\tstring replacementName,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tinvocation,\n\t\t\tinvocation\n\t\t\t\t.ReplaceNode(\n\t\t\t\t\tsimpleName,\n\t\t\t\t\tsimpleName.WithIdentifier(Identifier(replacementName))\n\t\t\t\t)\n\t\t\t\t.WithArgumentList(\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.ArgumentList\n\t\t\t\t\t\t.AddArguments(\n\t\t\t\t\t\t\tParseArgumentList(\"false\")\n\t\t\t\t\t\t\t\t.Arguments[0]\n\t\t\t\t\t\t\t\t.WithNameColon(NameColon(\"exactMatch\"))\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/AsyncAssertsShouldBeAwaitedFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class AsyncAssertsShouldBeAwaitedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_AddAwait = \"xUnit2021_AddAwait\";\n\n\tpublic AsyncAssertsShouldBeAwaitedFixer() :\n\t\tbase(Descriptors.X2021_AsyncAssertionsShouldBeAwaited.Id)\n\t{ }\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar method = invocation.FirstAncestorOrSelf<MethodDeclarationSyntax>();\n\t\tif (method is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Add await\",\n\t\t\t\tct => UseAsyncAwait(context.Document, invocation, method, ct),\n\t\t\t\tKey_AddAwait\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseAsyncAwait(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tMethodDeclarationSyntax method,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar modifiers = AsyncHelper.GetModifiersWithAsyncKeywordAdded(method.Modifiers);\n\t\tvar returnType = await AsyncHelper.GetAsyncReturnType(method.ReturnType, editor, cancellationToken).ConfigureAwait(false);\n\t\tvar asyncThrowsInvocation = AwaitExpression(invocation.WithoutLeadingTrivia()).WithLeadingTrivia(invocation.GetLeadingTrivia());\n\n\t\tif (returnType is not null)\n\t\t\teditor.ReplaceNode(\n\t\t\t\tmethod,\n\t\t\t\tmethod\n\t\t\t\t\t.ReplaceNode(invocation, asyncThrowsInvocation)\n\t\t\t\t\t.WithModifiers(modifiers)\n\t\t\t\t\t.WithReturnType(returnType)\n\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/BooleanAssertsShouldNotBeNegatedFixer.cs",
    "content": "using System.Collections.Generic;\nusing System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class BooleanAssertsShouldNotBeNegatedFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseSuggestedAssert = \"xUnit2022_UseSuggestedAssert\";\n\n\tpublic BooleanAssertsShouldNotBeNegatedFixer() :\n\t\tbase(Descriptors.X2022_BooleanAssertionsShouldNotBeNegated.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseSuggestedAssert(context.Document, invocation, replacement, ct),\n\t\t\t\tKey_UseSuggestedAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseSuggestedAssert(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t{\n\t\t\tif (invocation.ArgumentList.Arguments[0].Expression is PrefixUnaryExpressionSyntax prefixUnaryExpression)\n\t\t\t{\n\t\t\t\tvar originalArguments = invocation.ArgumentList.Arguments;\n\t\t\t\tvar newFirstArgument = Argument(prefixUnaryExpression.Operand);\n\n\t\t\t\tvar newArguments = new List<ArgumentSyntax> { newFirstArgument };\n\t\t\t\tif (originalArguments.Count > 1)\n\t\t\t\t\tnewArguments.AddRange(originalArguments.Skip(1));\n\n\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\tinvocation,\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(newArguments)))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseSuggestedAssert = \"xUnit2025_SimplifyBooleanAssert\";\n\n\tpublic BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer() :\n\t\tbase(Descriptors.X2025_BooleanAssertionCanBeSimplified.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.LiteralValue, out var isLeftLiteral))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseSuggestedAssert(context.Document, invocation, replacement, isLeftLiteral == Constants.Asserts.True, ct),\n\t\t\t\tKey_UseSuggestedAssert,\n\t\t\t\t\"Simplify the condition and use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseSuggestedAssert(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tbool isLeftLiteral,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments[0].Expression is BinaryExpressionSyntax binaryExpressionSyntax)\n\t\t\t{\n\t\t\t\tvar newArgument = isLeftLiteral ? binaryExpressionSyntax.Right : binaryExpressionSyntax.Left;\n\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\tinvocation,\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(invocation.ArgumentList.Arguments.Count > 1\n\t\t\t\t\t\t\t? [Argument(newArgument), invocation.ArgumentList.Arguments[1]]\n\t\t\t\t\t\t\t: new[] { Argument(newArgument) })))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t);\n\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseSuggestedAssert = \"xUnit2024_UseSuggestedAssert\";\n\n\tpublic BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer() :\n\t\tbase(Descriptors.X2024_BooleanAssertionsShouldNotBeUsedForSimpleEqualityCheck.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.Replacement, out var replacement))\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.LiteralValue, out var isLeftLiteral))\n\t\t\treturn;\n\t\tif (replacement is null)\n\t\t\treturn;\n\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (semanticModel is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => UseSuggestedAssert(context.Document, invocation, replacement, isLeftLiteral == Constants.Asserts.True, ct),\n\t\t\t\tKey_UseSuggestedAssert,\n\t\t\t\t\"Use Assert.{0}\", replacement\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseSuggestedAssert(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tstring replacement,\n\t\tbool isLeftLiteral,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments[0].Expression is BinaryExpressionSyntax binaryExpressionSyntax)\n\t\t\t{\n\t\t\t\tArgumentSyntax[] separatedList =\n\t\t\t\t\treplacement is Constants.Asserts.Null or Constants.Asserts.NotNull\n\t\t\t\t\t\t? isLeftLiteral\n\t\t\t\t\t\t\t? [Argument(binaryExpressionSyntax.Right)]\n\t\t\t\t\t\t\t: [Argument(binaryExpressionSyntax.Left)]\n\t\t\t\t\t\t: isLeftLiteral\n\t\t\t\t\t\t\t? [Argument(binaryExpressionSyntax.Left), Argument(binaryExpressionSyntax.Right)]\n\t\t\t\t\t\t\t: [Argument(binaryExpressionSyntax.Right), Argument(binaryExpressionSyntax.Left)];\n\n\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\tinvocation,\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList(separatedList)))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(replacement)))\n\t\t\t\t);\n\t\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/UseAssertFailInsteadOfBooleanAssertFixer.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class UseAssertFailInsteadOfBooleanAssertFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAssertFail = \"xUnit2020_UseAssertFail\";\n\n\tpublic UseAssertFailInsteadOfBooleanAssertFixer() :\n\t\tbase(Descriptors.X2020_UseAssertFailInsteadOfBooleanAssert.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar invocation = root.FindNode(context.Span).FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Use Assert.Fail\",\n\t\t\t\tct => UseAssertFail(context.Document, invocation, ct),\n\t\t\t\tKey_UseAssertFail\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> UseAssertFail(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\tif (invocation.Expression is MemberAccessExpressionSyntax memberAccess)\n\t\t\tif (invocation.ArgumentList.Arguments.Count == 2)\n\t\t\t\teditor.ReplaceNode(\n\t\t\t\t\tinvocation,\n\t\t\t\t\tinvocation\n\t\t\t\t\t\t.WithArgumentList(ArgumentList(SeparatedList([invocation.ArgumentList.Arguments[1]])))\n\t\t\t\t\t\t.WithExpression(memberAccess.WithName(IdentifierName(Constants.Asserts.Fail)))\n\t\t\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X2000/UseGenericOverloadFix.cs",
    "content": "using System.Composition;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class UseGenericOverloadFix : XunitCodeFixProvider\n{\n\tpublic const string Key_UseAlternateAssert = \"xUnit2007_xUnit2015_UseAlternateAssert\";\n\n\tpublic UseGenericOverloadFix() :\n\t\tbase(\n\t\t\tDescriptors.X2007_AssertIsTypeShouldUseGenericOverload.Id,\n\t\t\tDescriptors.X2015_AssertThrowsShouldUseGenericOverload.Id\n\t\t)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar syntaxNode = root.FindNode(context.Span);\n\t\tvar invocation = syntaxNode.FirstAncestorOrSelf<InvocationExpressionSyntax>();\n\t\tif (invocation is null)\n\t\t\treturn;\n\n\t\tif (invocation.ArgumentList.Arguments[0].Expression is not TypeOfExpressionSyntax typeOfExpression)\n\t\t\treturn;\n\t\tif (invocation.Expression is not MemberAccessExpressionSyntax memberAccess)\n\t\t\treturn;\n\n\t\tvar semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tvar typeInfo = semanticModel.GetTypeInfo(typeOfExpression.Type);\n\t\tif (typeInfo.Type is null)\n\t\t\treturn;\n\n\t\tvar typeName = SymbolDisplay.ToDisplayString(typeInfo.Type, SymbolDisplayFormat.MinimallyQualifiedFormat);\n\t\tvar methodName = memberAccess.Name.Identifier.ValueText;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tXunitCodeAction.Create(\n\t\t\t\tct => RemoveTypeofInvocationAndAddGenericTypeAsync(context.Document, invocation, memberAccess, typeOfExpression, ct),\n\t\t\t\tKey_UseAlternateAssert,\n\t\t\t\t\"Use Assert.{0}<{1}>\", methodName, typeName\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> RemoveTypeofInvocationAndAddGenericTypeAsync(\n\t\tDocument document,\n\t\tInvocationExpressionSyntax invocation,\n\t\tMemberAccessExpressionSyntax memberAccess,\n\t\tTypeOfExpressionSyntax typeOfExpression,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\n\t\teditor.ReplaceNode(\n\t\t\tinvocation,\n\t\t\tinvocation.WithExpression(\n\t\t\t\tmemberAccess.WithName(\n\t\t\t\t\tGenericName(\n\t\t\t\t\t\tmemberAccess.Name.Identifier,\n\t\t\t\t\t\tTypeArgumentList(SingletonSeparatedList(typeOfExpression.Type))\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.WithArgumentList(\n\t\t\t\tinvocation\n\t\t\t\t\t.ArgumentList\n\t\t\t\t\t.WithArguments(invocation.ArgumentList.Arguments.RemoveAt(0))\n\t\t\t)\n\t\t);\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X3000/CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_SetBaseType = \"xUnit3000_SetBaseType\";\n\n\tpublic CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer() :\n\t\tbase(Descriptors.X3000_CrossAppDomainClassesMustBeLongLivedMarshalByRefObject.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.NewBaseType, out var newBaseType) || newBaseType is null)\n\t\t\treturn;\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\t\"Set Base Type\",\n\t\t\t\tct => context.Document.SetBaseClass(classDeclaration, newBaseType, ct),\n\t\t\t\tKey_SetBaseType\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/X3000/SerializableClassMustHaveParameterlessConstructorFixer.cs",
    "content": "using System.Composition;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeActions;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Editing;\nusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;\nusing static Microsoft.CodeAnalysis.CodeFixes.WellKnownFixAllProviders;\n\nnamespace Xunit.Analyzers.Fixes;\n\n[ExportCodeFixProvider(LanguageNames.CSharp), Shared]\npublic class SerializableClassMustHaveParameterlessConstructorFixer : XunitCodeFixProvider\n{\n\tpublic const string Key_GenerateOrUpdateConstructor = \"xUnit3001_GenerateOrUpdateConstructor\";\n\n\tstatic readonly LiteralExpressionSyntax obsoleteText =\n\t\tLiteralExpression(SyntaxKind.StringLiteralExpression, Literal(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\"));\n\n\tpublic SerializableClassMustHaveParameterlessConstructorFixer() :\n\t\tbase(Descriptors.X3001_SerializableClassMustHaveParameterlessConstructor.Id)\n\t{ }\n\n\tpublic override FixAllProvider? GetFixAllProvider() => BatchFixer;\n\n\tpublic sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)\n\t{\n\t\tvar root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);\n\t\tif (root is null)\n\t\t\treturn;\n\n\t\tvar classDeclaration = root.FindNode(context.Span).FirstAncestorOrSelf<ClassDeclarationSyntax>();\n\t\tif (classDeclaration is null)\n\t\t\treturn;\n\n\t\tvar diagnostic = context.Diagnostics.FirstOrDefault();\n\t\tif (diagnostic is null)\n\t\t\treturn;\n\n\t\tif (!diagnostic.Properties.TryGetValue(Constants.Properties.IsCtorObsolete, out var isCtorObsolete))\n\t\t\treturn;\n\n\t\tvar parameterlessCtor = classDeclaration.Members.OfType<ConstructorDeclarationSyntax>().FirstOrDefault(c => c.ParameterList.Parameters.Count == 0);\n\n\t\tcontext.RegisterCodeFix(\n\t\t\tCodeAction.Create(\n\t\t\t\tparameterlessCtor is null ? \"Create public constructor\" : \"Make parameterless constructor public\",\n\t\t\t\tct => CreateOrUpdateConstructor(context.Document, classDeclaration, isCtorObsolete == bool.TrueString, ct),\n\t\t\t\tKey_GenerateOrUpdateConstructor\n\t\t\t),\n\t\t\tcontext.Diagnostics\n\t\t);\n\t}\n\n\tstatic async Task<Document> CreateOrUpdateConstructor(\n\t\tDocument document,\n\t\tClassDeclarationSyntax declaration,\n\t\tbool isCtorObsolete,\n\t\tCancellationToken cancellationToken)\n\t{\n\t\tvar editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);\n\t\tvar generator = editor.Generator;\n\t\tvar semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);\n\t\tvar parameterlessCtor = declaration.Members.OfType<ConstructorDeclarationSyntax>().FirstOrDefault(c => c.ParameterList.Parameters.Count == 0);\n\n\t\tif (parameterlessCtor is null)\n\t\t{\n\t\t\tvar newCtor = generator.ConstructorDeclaration();\n\t\t\tnewCtor = generator.WithAccessibility(newCtor, Accessibility.Public);\n\n\t\t\tif (isCtorObsolete)\n\t\t\t{\n\t\t\t\tvar obsoleteAttribute = generator.Attribute(Constants.Types.System.ObsoleteAttribute, obsoleteText);\n\t\t\t\tnewCtor = generator.AddAttributes(newCtor, obsoleteAttribute);\n\t\t\t}\n\n\t\t\teditor.InsertMembers(declaration, 0, [newCtor]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar updatedCtor = generator.WithAccessibility(parameterlessCtor, Accessibility.Public);\n\n\t\t\tif (isCtorObsolete)\n\t\t\t{\n\t\t\t\tvar hasObsolete =\n\t\t\t\t\tparameterlessCtor\n\t\t\t\t\t\t.AttributeLists\n\t\t\t\t\t\t.SelectMany(al => al.Attributes)\n\t\t\t\t\t\t.Any(@as => semanticModel.GetTypeInfo(@as, cancellationToken).Type?.ToDisplayString() == Constants.Types.System.ObsoleteAttribute);\n\n\t\t\t\tif (!hasObsolete)\n\t\t\t\t{\n\t\t\t\t\tvar obsoleteAttribute = generator.Attribute(Constants.Types.System.ObsoleteAttribute, obsoleteText);\n\t\t\t\t\tupdatedCtor = generator.AddAttributes(updatedCtor, obsoleteAttribute);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\teditor.ReplaceNode(parameterlessCtor, updatedCtor);\n\t\t}\n\n\t\treturn editor.GetChangedDocument();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/tools/install.ps1",
    "content": "param($installPath, $toolsPath, $package, $project)\r\n\r\nif($project.Object.SupportsPackageDependencyResolution)\r\n{\r\n    if($project.Object.SupportsPackageDependencyResolution())\r\n    {\r\n        # Do not install analyzers via install.ps1, instead let the project system handle it.\r\n        return\r\n    }\r\n}\r\n\r\n$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) \"analyzers\") * -Resolve\r\n\r\nforeach($analyzersPath in $analyzersPaths)\r\n{\r\n    if (Test-Path $analyzersPath)\r\n    {\r\n        # Install the language agnostic analyzers.\r\n        foreach ($analyzerFilePath in Get-ChildItem -Path \"$analyzersPath\\*.dll\" -Exclude *.resources.dll)\r\n        {\r\n            if($project.Object.AnalyzerReferences)\r\n            {\r\n                $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n# $project.Type gives the language name like (C# or VB.NET)\r\n$languageFolder = \"\"\r\nif($project.Type -eq \"C#\")\r\n{\r\n    $languageFolder = \"cs\"\r\n}\r\nif($project.Type -eq \"VB.NET\")\r\n{\r\n    $languageFolder = \"vb\"\r\n}\r\nif($languageFolder -eq \"\")\r\n{\r\n    return\r\n}\r\n\r\nforeach($analyzersPath in $analyzersPaths)\r\n{\r\n    # Install language specific analyzers.\r\n    $languageAnalyzersPath = join-path $analyzersPath $languageFolder\r\n    if (Test-Path $languageAnalyzersPath)\r\n    {\r\n        foreach ($analyzerFilePath in Get-ChildItem -Path \"$languageAnalyzersPath\\*.dll\" -Exclude *.resources.dll)\r\n        {\r\n            if($project.Object.AnalyzerReferences)\r\n            {\r\n                $project.Object.AnalyzerReferences.Add($analyzerFilePath.FullName)\r\n            }\r\n        }\r\n    }\r\n}\r\n# SIG # Begin signature block\r\n# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor\r\n# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG\r\n# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA/i+qRUHsWzI0s\r\n# FVk99zLgt/HOEQ33uvkFsWtHTHZgf6CCDYEwggX/MIID56ADAgECAhMzAAACUosz\r\n# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD\r\n# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p\r\n# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw\r\n# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u\r\n# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\r\n# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I\r\n# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O\r\n# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA\r\n# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o\r\n# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8\r\n# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE\r\n# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw\r\n# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1\r\n# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu\r\n# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu\r\n# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w\r\n# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3\r\n# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx\r\n# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3\r\n# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp\r\n# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7\r\n# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u\r\n# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1\r\n# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti\r\n# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z\r\n# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf\r\n# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK\r\n# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW\r\n# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F\r\n# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS\r\n# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK\r\n# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0\r\n# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0\r\n# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla\r\n# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS\r\n# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT\r\n# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB\r\n# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG\r\n# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S\r\n# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz\r\n# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7\r\n# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u\r\n# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33\r\n# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl\r\n# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP\r\n# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB\r\n# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF\r\n# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM\r\n# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ\r\n# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud\r\n# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO\r\n# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0\r\n# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y\r\n# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p\r\n# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y\r\n# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB\r\n# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw\r\n# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA\r\n# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY\r\n# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj\r\n# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd\r\n# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ\r\n# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf\r\n# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ\r\n# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j\r\n# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B\r\n# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96\r\n# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7\r\n# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I\r\n# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z\r\n# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN\r\n# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor\r\n# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgRjg7DcI6\r\n# uhYfXWwAQ6hK0mPW7iyr2tzHR0DHSDJkscIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS\r\n# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN\r\n# BgkqhkiG9w0BAQEFAASCAQB3ERGpqvGnJrsyU0d9lERK2TJW4/OONhZAFjxrEvEk\r\n# PzdH0Fk0otvagAvjHzJ3q0G8C7gwRbXIyGgiYYIMefheNvgd/UKnubUGEzeG9h0/\r\n# biX5Ro1mxuHBYvc3vqvWD292jXMg00iRmexDsTny8YgSAAWsTdkE8/W2ooEfbG1T\r\n# QkCg6ds9btpA1D1znVYpEbviCJoAfHLbNBr5nzAadgWjQM8nnb3UTvmLDIs5b1LO\r\n# 3lm9w485IBFRnfrj6QinVsCbSD7PU/N1hPY7rKfM9ScZC6QT6kjyuVVa1Ft+VYLH\r\n# qlV9hE6B4CGeB8qkko4x+MKovgbdpCgYz3eePWCakZywoYIXGTCCFxUGCisGAQQB\r\n# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME\r\n# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB\r\n# MDEwDQYJYIZIAWUDBAIBBQAEIC58WTh4Q8r6c2kVXmD8xoHEhya2jc6YZ43KUAIy\r\n# flB4AgZh/WKJ50gYEzIwMjIwMjExMTkwMzQwLjE1M1owBIACAfSggdikgdUwgdIx\r\n# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt\r\n# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p\r\n# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh\r\n# bGVzIFRTUyBFU046M0JENC00QjgwLTY5QzMxJTAjBgNVBAMTHE1pY3Jvc29mdCBU\r\n# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAYm0v4YwhBxL\r\n# jwABAAABiTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK\r\n# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0\r\n# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg\r\n# MjAxMDAeFw0yMTEwMjgxOTI3NDFaFw0yMzAxMjYxOTI3NDFaMIHSMQswCQYDVQQG\r\n# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG\r\n# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg\r\n# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg\r\n# RVNOOjNCRDQtNEI4MC02OUMzMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt\r\n# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvQZXxZFm\r\n# a6plmuOyvNpV8xONOwcYolZG/BjyZWGSk5JOGaLyrKId5VxVHWHlsmJE4Svnzsdp\r\n# sKmVx8otONveIUFvSceEZp8VXmu5m1fu8L7c+3lwXcibjccqtEvtQslokQVx0r+L\r\n# 54abrNDarwFG73IaRidIS1i9c+unJ8oYyhDRLrCysFAVxyQhPNZkWK7Z8/VGukaK\r\n# LAWHXCh/+R53h42gFL+9/mAALxzCXXuofi8f/XKCm7xNwVc1hONCCz6oq94AufzV\r\n# NkkIW4brUQgYpCcJm9U0XNmQvtropYDn9UtY8YQ0NKenXPtdgLHdQ8Nnv3igErKL\r\n# rWI0a5n5jjdKfwk+8mvakqdZmlOseeOS1XspQNJAK1uZllAITcnQZOcO5ofjOQ33\r\n# ujWckAXdz+/x3o7l4AU/TSOMzGZMwhUdtVwC3dSbItpSVFgnjM2COEJ9zgCadvOi\r\n# rGDLN471jZI2jClkjsJTdgPk343TQA4JFvds/unZq0uLr+niZ3X44OBx2x+gVlln\r\n# 2c4UbZXNueA4yS1TJGbbJFIILAmTUA9Auj5eISGTbNiyWx79HnCOTar39QEKozm4\r\n# LnTmDXy0/KI/H/nYZGKuTHfckP28wQS06rD+fDS5xLwcRMCW92DkHXmtbhGyRilB\r\n# OL5LxZelQfxt54wl4WUC0AdAEolPekODwO8CAwEAAaOCATYwggEyMB0GA1UdDgQW\r\n# BBSXbx+zR1p4IIAeguA6rHKkrfl7UDAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl\r\n# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j\r\n# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx\r\n# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3\r\n# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh\r\n# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG\r\n# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQCOtLdpWUI4KwfLLrfaKrLB92Dq\r\n# bAspGWM41TaO4Jl+sHxPo522uu3GKQCjmkRWreHtlfyy9kOk7LWax3k3ke8Gtfet\r\n# fbh7qH0LeV2XOWg39BOnHf6mTcZq7FYSZZch1JDQjc98+Odlow+oWih0Dbt4CV/e\r\n# 19ZcE+1n1zzWkskUEd0f5jPIUis33p+vkY8szduAtCcIcPFUhI8Hb5alPUAPMjGz\r\n# wKb7NIKbnf8j8cP18As5IveckF0oh1cw63RY/vPK62LDYdpi7WnG2ObvngfWVKtw\r\n# iwTI4jHj2cO9q37HDe/PPl216gSpUZh0ap24mKmMDfcKp1N4mEdsxz4oseOrPYeF\r\n# sHHWJFJ6Aivvqn70KTeJpp5r+DxSqbeSy0mxIUOq/lAaUxgNSQVUX26t8r+fciko\r\n# fKv23WHrtRV3t7rVTsB9YzrRaiikmz68K5HWdt9MqULxPQPo+ppZ0LRqkOae466+\r\n# UKRY0JxWtdrMc5vHlHZfnqjawj/RsM2S6Q6fa9T9CnY1Nz7DYBG3yZJyCPFsrgU0\r\n# 5s9ljqfsSptpFdUh9R4ce+L71SWDLM2x/1MFLLHAMbXsEp8KloEGtaDULnxtfS2t\r\n# YhfuKGqRXoEfDPAMnIdTvQPh3GHQ4SjkkBARHL0MY75alhGTKHWjC2aLVOo8obKI\r\n# Bk8hfnFDUf/EyVw4uTCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw\r\n# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n\r\n# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y\r\n# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv\r\n# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z\r\n# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw\r\n# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg\r\n# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO\r\n# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41\r\n# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5\r\n# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL\r\n# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9\r\n# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj\r\n# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE\r\n# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0\r\n# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435\r\n# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB\r\n# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE\r\n# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG\r\n# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93\r\n# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV\r\n# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV\r\n# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo\r\n# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m\r\n# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j\r\n# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv\r\n# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN\r\n# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4\r\n# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54\r\n# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX\r\n# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew\r\n# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0\r\n# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd\r\n# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr\r\n# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh\r\n# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n\r\n# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+\r\n# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw\r\n# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI\r\n# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv\r\n# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh\r\n# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046M0JENC00Qjgw\r\n# LTY5QzMxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB\r\n# ATAHBgUrDgMCGgMVACGlCa3ketyeuey7bJNpWkMuiCcQoIGDMIGApH4wfDELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z\r\n# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDlsRtBMCIY\r\n# DzIwMjIwMjEyMDEyODMzWhgPMjAyMjAyMTMwMTI4MzNaMHcwPQYKKwYBBAGEWQoE\r\n# ATEvMC0wCgIFAOWxG0ECAQAwCgIBAAICDbMCAf8wBwIBAAICEW8wCgIFAOWybMEC\r\n# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK\r\n# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCImCpEJ2AlAWBBkDABmkqIh1kM\r\n# LPDyea3b7evhOk+YSwXCzxnBIXuppujFT3tnk7w0p0a5YS9uwqbDM/M6rAUMBAR0\r\n# boHamumEITNF5nVh0rlYyRZQ3WraVD2YPhouUINQavmS8ueYoh6r3HeM9QPBAnNB\r\n# vv7GDrZ637+2Dfe60jGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD\r\n# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w\r\n# IFBDQSAyMDEwAhMzAAABibS/hjCEHEuPAAEAAAGJMA0GCWCGSAFlAwQCAQUAoIIB\r\n# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIL86\r\n# iebNndOm+CAgIp67s6y+HI1wHdhaMPILGf48RtXXMIH6BgsqhkiG9w0BCRACLzGB\r\n# 6jCB5zCB5DCBvQQgZndHMdxQV1VsbpWHOTHqWEycvcRJm7cY69l/UmT8j0UwgZgw\r\n# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE\r\n# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD\r\n# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAYm0v4YwhBxL\r\n# jwABAAABiTAiBCDET+l3keOFFxaIqOZWSSuWNO774Ng/t5pe3p4QXoKcvjANBgkq\r\n# hkiG9w0BAQsFAASCAgADYrNFej7RbihwGcC0jF+cTik+HJog++dPEDXeIyBB+2pw\r\n# 23hC5KaX9H05ZknluIq2oxf2MLpKL+gA+76T3k5PnzPNJFDogUn5eFIIsMRpNF0h\r\n# MtPWoPJWYFK2odvKz1HwsuqHRg6hO//NwORcv4xPeAWEFO5+DOXzZKKp/BVDGe/D\r\n# c++y9/l41qpz/F2c3a1lugdqnZz7ZeoaQ8/JMlwrmMbciqcAytCn9A59EWJ1xYd/\r\n# DaDhQ5Rd8hkcckuxJksjWf6URmc91cb4Jdatkyupq3dDGwCkjGNd2xetrOpqMLOZ\r\n# quoDONSgc9rGrhkf3xgKKVRhLg9bxd3f2oQ0IsOBg2AC5td1eqp6TILc0gei2E3I\r\n# uEAW1d+KXDnajvQmvQkaFHr5wEocTTLgrDglOPPhEaEumSTJS7jKFzUKHiBU005p\r\n# CgQ1So2WJ2RqFx0ppez1N1AFczOVLFllK3WGPLkDsN1GgT0nFfoqvs1WKkzyb2d2\r\n# /v6PVER9xGky7LCu62dhsJCAFUbxF2dJxaC5ofrl98VaO/z72J9on9BTz+eCtcJ9\r\n# rDIpqktGeL02f6+4zctFCyi2wgm6eh8kKvRlAPmN4/MNt9pWHtEV//xFGzGeDajr\r\n# diRhDoMZwsuon4QwS8b2YcKMoZ6gZ2lZah3960fTTmvBTBNqeBtR94KWCy0C0A==\r\n# SIG # End signature block\r\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/tools/uninstall.ps1",
    "content": "param($installPath, $toolsPath, $package, $project)\r\n\r\nif($project.Object.SupportsPackageDependencyResolution)\r\n{\r\n    if($project.Object.SupportsPackageDependencyResolution())\r\n    {\r\n        # Do not uninstall analyzers via uninstall.ps1, instead let the project system handle it.\r\n        return\r\n    }\r\n}\r\n\r\n$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) \"analyzers\") * -Resolve\r\n\r\nforeach($analyzersPath in $analyzersPaths)\r\n{\r\n    # Uninstall the language agnostic analyzers.\r\n    if (Test-Path $analyzersPath)\r\n    {\r\n        foreach ($analyzerFilePath in Get-ChildItem -Path \"$analyzersPath\\*.dll\" -Exclude *.resources.dll)\r\n        {\r\n            if($project.Object.AnalyzerReferences)\r\n            {\r\n                $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n# $project.Type gives the language name like (C# or VB.NET)\r\n$languageFolder = \"\"\r\nif($project.Type -eq \"C#\")\r\n{\r\n    $languageFolder = \"cs\"\r\n}\r\nif($project.Type -eq \"VB.NET\")\r\n{\r\n    $languageFolder = \"vb\"\r\n}\r\nif($languageFolder -eq \"\")\r\n{\r\n    return\r\n}\r\n\r\nforeach($analyzersPath in $analyzersPaths)\r\n{\r\n    # Uninstall language specific analyzers.\r\n    $languageAnalyzersPath = join-path $analyzersPath $languageFolder\r\n    if (Test-Path $languageAnalyzersPath)\r\n    {\r\n        foreach ($analyzerFilePath in Get-ChildItem -Path \"$languageAnalyzersPath\\*.dll\" -Exclude *.resources.dll)\r\n        {\r\n            if($project.Object.AnalyzerReferences)\r\n            {\r\n                try\r\n                {\r\n                    $project.Object.AnalyzerReferences.Remove($analyzerFilePath.FullName)\r\n                }\r\n                catch\r\n                {\r\n\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n# SIG # Begin signature block\r\n# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor\r\n# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG\r\n# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDC68wb97fg0QGL\r\n# yXrxJhYfmibzcOh8caqC0uZprfczDaCCDYEwggX/MIID56ADAgECAhMzAAACUosz\r\n# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD\r\n# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p\r\n# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw\r\n# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u\r\n# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\r\n# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I\r\n# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O\r\n# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA\r\n# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o\r\n# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8\r\n# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE\r\n# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw\r\n# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1\r\n# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu\r\n# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu\r\n# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w\r\n# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3\r\n# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx\r\n# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3\r\n# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp\r\n# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7\r\n# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u\r\n# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1\r\n# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti\r\n# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z\r\n# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf\r\n# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK\r\n# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW\r\n# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F\r\n# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS\r\n# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK\r\n# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0\r\n# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0\r\n# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla\r\n# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS\r\n# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT\r\n# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB\r\n# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG\r\n# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S\r\n# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz\r\n# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7\r\n# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u\r\n# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33\r\n# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl\r\n# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP\r\n# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB\r\n# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF\r\n# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM\r\n# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ\r\n# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud\r\n# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO\r\n# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0\r\n# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y\r\n# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p\r\n# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y\r\n# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB\r\n# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw\r\n# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA\r\n# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY\r\n# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj\r\n# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd\r\n# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ\r\n# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf\r\n# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ\r\n# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j\r\n# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B\r\n# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96\r\n# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7\r\n# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I\r\n# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z\r\n# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN\r\n# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor\r\n# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgF1ypFyzl\r\n# AvvWGVCeXczrfpXmJNm9vpyjcwd4y4ivfqowQgYKKwYBBAGCNwIBDDE0MDKgFIAS\r\n# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN\r\n# BgkqhkiG9w0BAQEFAASCAQAvi2rSDkhC82RJ4uqq/0WbHkOkzq1hrF6HxneBTNj8\r\n# KX+niFtee3CYVfWaSAQ6xvOiLupRX3fsSfhabRQ+Jl8k28voGrTK1OC906OO3tUN\r\n# jdmv1PooWdxJNt2EbzQrap5Ui9KTUv4mJ4c836HAVMBPCJiq5NwmzAHfbgBxCaYq\r\n# +hupIf+gk8vuNB1bltILgNmU/smJt9OuGqSo5TrFajzb+35SqjnCz9JtAtbPNZvA\r\n# X9N37UPhITOecceAQmrHiEPbA7eu6VDp6VPjPfCEO7a+frWa83chEd4qzyou9xu5\r\n# 3gnj7Ro8nFDnGyUe0+0oCaYGXO9fbIMN1HG2IZg5suj5oYIXGTCCFxUGCisGAQQB\r\n# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME\r\n# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB\r\n# MDEwDQYJYIZIAWUDBAIBBQAEIH+XBTHuyyHZnIXrFWIe64WLvHx5GUFMCM6A56T1\r\n# KwBtAgZh/WKJ52UYEzIwMjIwMjExMTkwMzQwLjU0OFowBIACAfSggdikgdUwgdIx\r\n# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt\r\n# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p\r\n# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh\r\n# bGVzIFRTUyBFU046M0JENC00QjgwLTY5QzMxJTAjBgNVBAMTHE1pY3Jvc29mdCBU\r\n# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAYm0v4YwhBxL\r\n# jwABAAABiTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK\r\n# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0\r\n# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg\r\n# MjAxMDAeFw0yMTEwMjgxOTI3NDFaFw0yMzAxMjYxOTI3NDFaMIHSMQswCQYDVQQG\r\n# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG\r\n# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg\r\n# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg\r\n# RVNOOjNCRDQtNEI4MC02OUMzMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt\r\n# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvQZXxZFm\r\n# a6plmuOyvNpV8xONOwcYolZG/BjyZWGSk5JOGaLyrKId5VxVHWHlsmJE4Svnzsdp\r\n# sKmVx8otONveIUFvSceEZp8VXmu5m1fu8L7c+3lwXcibjccqtEvtQslokQVx0r+L\r\n# 54abrNDarwFG73IaRidIS1i9c+unJ8oYyhDRLrCysFAVxyQhPNZkWK7Z8/VGukaK\r\n# LAWHXCh/+R53h42gFL+9/mAALxzCXXuofi8f/XKCm7xNwVc1hONCCz6oq94AufzV\r\n# NkkIW4brUQgYpCcJm9U0XNmQvtropYDn9UtY8YQ0NKenXPtdgLHdQ8Nnv3igErKL\r\n# rWI0a5n5jjdKfwk+8mvakqdZmlOseeOS1XspQNJAK1uZllAITcnQZOcO5ofjOQ33\r\n# ujWckAXdz+/x3o7l4AU/TSOMzGZMwhUdtVwC3dSbItpSVFgnjM2COEJ9zgCadvOi\r\n# rGDLN471jZI2jClkjsJTdgPk343TQA4JFvds/unZq0uLr+niZ3X44OBx2x+gVlln\r\n# 2c4UbZXNueA4yS1TJGbbJFIILAmTUA9Auj5eISGTbNiyWx79HnCOTar39QEKozm4\r\n# LnTmDXy0/KI/H/nYZGKuTHfckP28wQS06rD+fDS5xLwcRMCW92DkHXmtbhGyRilB\r\n# OL5LxZelQfxt54wl4WUC0AdAEolPekODwO8CAwEAAaOCATYwggEyMB0GA1UdDgQW\r\n# BBSXbx+zR1p4IIAeguA6rHKkrfl7UDAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl\r\n# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j\r\n# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx\r\n# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3\r\n# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh\r\n# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG\r\n# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQCOtLdpWUI4KwfLLrfaKrLB92Dq\r\n# bAspGWM41TaO4Jl+sHxPo522uu3GKQCjmkRWreHtlfyy9kOk7LWax3k3ke8Gtfet\r\n# fbh7qH0LeV2XOWg39BOnHf6mTcZq7FYSZZch1JDQjc98+Odlow+oWih0Dbt4CV/e\r\n# 19ZcE+1n1zzWkskUEd0f5jPIUis33p+vkY8szduAtCcIcPFUhI8Hb5alPUAPMjGz\r\n# wKb7NIKbnf8j8cP18As5IveckF0oh1cw63RY/vPK62LDYdpi7WnG2ObvngfWVKtw\r\n# iwTI4jHj2cO9q37HDe/PPl216gSpUZh0ap24mKmMDfcKp1N4mEdsxz4oseOrPYeF\r\n# sHHWJFJ6Aivvqn70KTeJpp5r+DxSqbeSy0mxIUOq/lAaUxgNSQVUX26t8r+fciko\r\n# fKv23WHrtRV3t7rVTsB9YzrRaiikmz68K5HWdt9MqULxPQPo+ppZ0LRqkOae466+\r\n# UKRY0JxWtdrMc5vHlHZfnqjawj/RsM2S6Q6fa9T9CnY1Nz7DYBG3yZJyCPFsrgU0\r\n# 5s9ljqfsSptpFdUh9R4ce+L71SWDLM2x/1MFLLHAMbXsEp8KloEGtaDULnxtfS2t\r\n# YhfuKGqRXoEfDPAMnIdTvQPh3GHQ4SjkkBARHL0MY75alhGTKHWjC2aLVOo8obKI\r\n# Bk8hfnFDUf/EyVw4uTCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw\r\n# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n\r\n# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y\r\n# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv\r\n# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z\r\n# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw\r\n# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg\r\n# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO\r\n# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41\r\n# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5\r\n# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL\r\n# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9\r\n# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj\r\n# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE\r\n# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0\r\n# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435\r\n# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB\r\n# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE\r\n# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG\r\n# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93\r\n# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV\r\n# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV\r\n# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo\r\n# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m\r\n# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j\r\n# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv\r\n# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN\r\n# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4\r\n# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54\r\n# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX\r\n# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew\r\n# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0\r\n# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd\r\n# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr\r\n# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh\r\n# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n\r\n# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+\r\n# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw\r\n# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI\r\n# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv\r\n# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh\r\n# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046M0JENC00Qjgw\r\n# LTY5QzMxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB\r\n# ATAHBgUrDgMCGgMVACGlCa3ketyeuey7bJNpWkMuiCcQoIGDMIGApH4wfDELMAkG\r\n# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx\r\n# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z\r\n# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDlsRtBMCIY\r\n# DzIwMjIwMjEyMDEyODMzWhgPMjAyMjAyMTMwMTI4MzNaMHcwPQYKKwYBBAGEWQoE\r\n# ATEvMC0wCgIFAOWxG0ECAQAwCgIBAAICDbMCAf8wBwIBAAICEW8wCgIFAOWybMEC\r\n# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK\r\n# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCImCpEJ2AlAWBBkDABmkqIh1kM\r\n# LPDyea3b7evhOk+YSwXCzxnBIXuppujFT3tnk7w0p0a5YS9uwqbDM/M6rAUMBAR0\r\n# boHamumEITNF5nVh0rlYyRZQ3WraVD2YPhouUINQavmS8ueYoh6r3HeM9QPBAnNB\r\n# vv7GDrZ637+2Dfe60jGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD\r\n# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\r\n# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w\r\n# IFBDQSAyMDEwAhMzAAABibS/hjCEHEuPAAEAAAGJMA0GCWCGSAFlAwQCAQUAoIIB\r\n# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIKY2\r\n# Onyhltfi0+oc/UMKaXc0H6Ckw2gGK1/qmjRZNiXnMIH6BgsqhkiG9w0BCRACLzGB\r\n# 6jCB5zCB5DCBvQQgZndHMdxQV1VsbpWHOTHqWEycvcRJm7cY69l/UmT8j0UwgZgw\r\n# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE\r\n# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD\r\n# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAYm0v4YwhBxL\r\n# jwABAAABiTAiBCDET+l3keOFFxaIqOZWSSuWNO774Ng/t5pe3p4QXoKcvjANBgkq\r\n# hkiG9w0BAQsFAASCAgB7AQ0Dv3muHoNAt+cccMfYk23lHgh8LGBitCSFwu0q7ufv\r\n# sXkoaIpwW0U0GikWhQoCH0U38SuzVbafg49FiE6ftkjOtiE03PwPYi1S6NSoDdaV\r\n# kUuvjz3OcuN1IHg3CyLn2dO8xbUlWCUfgoWhI1nax9ch7wT4Sw8RdmGKdYTZoZmq\r\n# vPXFRtDyZdmJDMDbTql/Brye8oEsDMoYKMmEYhY1t9TlusnWfUbxuBnyMqg/FkBy\r\n# QF78WFfT8mygMqUGmINxPGT6daxqmq3nfAC2vOtLT4DplNYMEymfDceJzBhb8VCT\r\n# UHc2CWK0qKT+eqwn30NBkwh//8aNHlXaA9Yq/9k2y+axIGdxFfG+X0stipRRpEXb\r\n# xCFm7FPD5/S4ddBH829yEZLZ4XTwSZ6YS/d3mFzu5rgZl3UhjOJPXx40GQtUiDP4\r\n# XQZ/wW3154X/KtTypv62/Hl+CiMUrsO7MXtgwClfbJ3osg+zlpJgdraetVgmAUc1\r\n# mjz2GCYX7rIliGkAJREKn4rV2MZzuGLEpTjz9dB+1Xp9Ndi9q3jQgs6k3IDIUube\r\n# YjPFFuPmFWRyi6oPTXmc4ExtTIewPvrOhwQ5q4ysxylkXoTS+UQt94BY2SvR+TMu\r\n# 6doU+0Y73xsO8Zz+lREh3fjBsDbPAgOV5989X6bmkJEEIwIK8LYgqvyED8XXTg==\r\n# SIG # End signature block\r\n"
  },
  {
    "path": "src/xunit.analyzers.fixes/xunit.analyzers.fixes.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <RootNamespace>Xunit.Analyzers.Fixes</RootNamespace>\n    <TargetFramework>netstandard2.0</TargetFramework>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\xunit.analyzers\\xunit.analyzers.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Workspaces\" Version=\"[$(MicrosoftCodeAnalysisVersion)]\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/ClassDataAttributeMustPointAtValidClassTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.ClassDataAttributeMustPointAtValidClass>;\n\npublic class ClassDataAttributeMustPointAtValidClassTests\n{\n\tconst string SupportedV2 = \"IEnumerable<object[]>\";\n\tconst string SupportedV3 = \"IEnumerable<object[]>, IAsyncEnumerable<object[]>, IEnumerable<ITheoryDataRow>, or IAsyncEnumerable<ITheoryDataRow>\";\n\n\tpublic class SuccessCases\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask v2_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tclass DataClassObjectArray: IEnumerable<object[]> {\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClassObjectArray))]\n\t\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp7_1, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tclass DataClass_TheoryDataRow_1: IEnumerable<TheoryDataRow<int>> {\n\t\t\t\t\tpublic IEnumerator<TheoryDataRow<int>> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_1_Async : IAsyncEnumerable<TheoryDataRow<int>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_2: IEnumerable<TheoryDataRow<int, string>> {\n\t\t\t\t\tpublic IEnumerator<TheoryDataRow<int, string>> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_2_Async : IAsyncEnumerable<TheoryDataRow<int, string>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, string>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_2A: IEnumerable<TheoryDataRow<int, string[]>> {\n\t\t\t\t\tpublic IEnumerator<TheoryDataRow<int, string[]>> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_2A_Async : IAsyncEnumerable<TheoryDataRow<int, string[]>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, string[]>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_3: IEnumerable<TheoryDataRow<int, string, string>> {\n\t\t\t\t\tpublic IEnumerator<TheoryDataRow<int, string, string>> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_TheoryDataRow_3_Async : IAsyncEnumerable<TheoryDataRow<int, string, string>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, string, string>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_Tuple_Named : IAsyncEnumerable<TheoryDataRow<(int x, int y)>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<(int x, int y)>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_Tuple_Misnamed : IAsyncEnumerable<TheoryDataRow<(int a, int b)>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<(int a, int b)>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_Tuple_Unnamed : IAsyncEnumerable<TheoryDataRow<(int, int)>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<(int, int)>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1_Async))]\n\t\t\t\t\tpublic void TestMethod1(int n) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1_Async))]\n\t\t\t\t\tpublic void TestMethod1Generic1<T>(T t) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1_Async))]\n\t\t\t\t\tpublic void TestMethod1Generic2<T>(T? t) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1_Async))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2_Async))]\n\t\t\t\t\tpublic void TestMethod2(int n, string s = \"\") { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_1_Async))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2_Async))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2A))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_2A_Async))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_3))]\n\t\t\t\t\t[ClassData(typeof(DataClass_TheoryDataRow_3_Async))]\n\t\t\t\t\tpublic void TestMethod3(int n, params string[] a) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass_Tuple_Named))]\n\t\t\t\t\t[ClassData(typeof(DataClass_Tuple_Misnamed))]\n\t\t\t\t\t[ClassData(typeof(DataClass_Tuple_Unnamed))]\n\t\t\t\t\tpublic void TestMethod4((int x, int y) point) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\t}\n\n\tpublic class X1007_ClassDataAttributeMustPointAtValidClass\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask v2_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass_Async : IAsyncEnumerable<object[]> {\n\t\t\t\t\tpublic IAsyncEnumerator<object[]> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:ClassData(typeof(DataClass_Async))|}]\n\t\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1007\").WithLocation(0).WithArguments(\"DataClass_Async\", SupportedV2);\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask v2_and_v3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tclass DataClass_Enumerable_Object: IEnumerable<object> {\n\t\t\t\t\tpublic IEnumerator<object> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tabstract class DataClass_Abstract: IEnumerable<object[]> {\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_NoParameterlessCtor: IEnumerable<object[]> {\n\t\t\t\t\tpublic DataClass_NoParameterlessCtor(string parameter) { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_InternalCtor: IEnumerable<object[]> {\n\t\t\t\t\tinternal DataClass_InternalCtor() { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_PrivateCtor: IEnumerable<object[]> {\n\t\t\t\t\tinternal DataClass_PrivateCtor() { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:ClassData(typeof(DataClass_Enumerable_Object))|}]\n\t\t\t\t\t[{|#1:ClassData(typeof(DataClass_Abstract))|}]\n\t\t\t\t\t[{|#2:ClassData(typeof(DataClass_NoParameterlessCtor))|}]\n\t\t\t\t\t[{|#3:ClassData(typeof(DataClass_InternalCtor))|}]\n\t\t\t\t\t[{|#4:ClassData(typeof(DataClass_PrivateCtor))|}]\n\t\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV2 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(0).WithArguments(\"DataClass_Enumerable_Object\", SupportedV2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(1).WithArguments(\"DataClass_Abstract\", SupportedV2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(2).WithArguments(\"DataClass_NoParameterlessCtor\", SupportedV2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(3).WithArguments(\"DataClass_InternalCtor\", SupportedV2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(4).WithArguments(\"DataClass_PrivateCtor\", SupportedV2),\n\t\t\t};\n\t\t\tvar expectedV3 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(0).WithArguments(\"DataClass_Enumerable_Object\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(1).WithArguments(\"DataClass_Abstract\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(2).WithArguments(\"DataClass_NoParameterlessCtor\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(3).WithArguments(\"DataClass_InternalCtor\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(4).WithArguments(\"DataClass_PrivateCtor\", SupportedV3),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp7_1, source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source, expectedV3);\n\t\t}\n\n#if ROSLYN_LATEST && !NETFRAMEWORK\n\n\t\t[Fact]\n\t\tpublic async ValueTask v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tclass DataClass_Enumerable_Object: IEnumerable<object> {\n\t\t\t\t\tpublic IEnumerator<object> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tabstract class DataClass_Abstract: IEnumerable<object[]> {\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_NoParameterlessCtor: IEnumerable<object[]> {\n\t\t\t\t\tpublic DataClass_NoParameterlessCtor(string parameter) { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_InternalCtor: IEnumerable<object[]> {\n\t\t\t\t\tinternal DataClass_InternalCtor() { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tclass DataClass_PrivateCtor: IEnumerable<object[]> {\n\t\t\t\t\tinternal DataClass_PrivateCtor() { }\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:ClassData<DataClass_Enumerable_Object>|}]\n\t\t\t\t\t[{|#1:ClassData<DataClass_Abstract>|}]\n\t\t\t\t\t[{|#2:ClassData<DataClass_NoParameterlessCtor>|}]\n\t\t\t\t\t[{|#3:ClassData<DataClass_InternalCtor>|}]\n\t\t\t\t\t[{|#4:ClassData<DataClass_PrivateCtor>|}]\n\t\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV3 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(0).WithArguments(\"DataClass_Enumerable_Object\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(1).WithArguments(\"DataClass_Abstract\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(2).WithArguments(\"DataClass_NoParameterlessCtor\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(3).WithArguments(\"DataClass_InternalCtor\", SupportedV3),\n\t\t\t\tVerify.Diagnostic(\"xUnit1007\").WithLocation(4).WithArguments(\"DataClass_PrivateCtor\", SupportedV3),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp11, source, expectedV3);\n\t\t}\n\n#endif  // ROSLYN_LATEST && !NETFRAMEWORK\n\t}\n\n\tpublic class X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters\n\t{\n\t\t[Fact]\n\t\tpublic async Task v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass : IAsyncEnumerable<TheoryDataRow<int>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:ClassData(typeof(DataClass))|}]\n\t\t\t\t\tpublic void TestMethod(int n, string f) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1037\").WithLocation(0).WithArguments(\"Xunit.TheoryDataRow\");\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters\n\t{\n\t\t[Fact]\n\t\tpublic async Task v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass1 : IAsyncEnumerable<TheoryDataRow<int, double>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, double>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass2 : IAsyncEnumerable<TheoryDataRow<int, double[], long>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, double[], long>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:ClassData(typeof(DataClass1))|}]\n\t\t\t\t\tpublic void TestMethod1(int n) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass1))]\n\t\t\t\t\t[{|#1:ClassData(typeof(DataClass2))|}]\n\t\t\t\t\tpublic void TestMethod2(int n, params double[] d) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(0).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(1).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes\n\t{\n\t\t[Fact]\n\t\tpublic async Task v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass1 : IAsyncEnumerable<TheoryDataRow<int, string>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, string>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass2 : IAsyncEnumerable<TheoryDataRow<int, string, int>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<int, string, int>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass1))]\n\t\t\t\t\tpublic void TestMethod1(int n, {|#0:double|} d) { }\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass2))]\n\t\t\t\t\tpublic void TestMethod2(int n, params {|#1:string[]|} s) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"string\", \"DataClass1\", \"d\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"DataClass2\", \"s\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability\n\t{\n\t\t[Fact]\n\t\tpublic async Task v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass : IAsyncEnumerable<TheoryDataRow<string?>> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow<string?>> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[ClassData(typeof(DataClass))]\n\t\t\t\t\tpublic void TestMethod({|#0:string|} s) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"DataClass\", \"s\");\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1050_ClassDataTheoryDataRowIsRecommendedForStronglyTypedAnalysis\n\t{\n\t\t[Fact]\n\t\tpublic async Task v3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DataClass_ObjectArray : IEnumerable<object[]> {\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass_ObjectArray_Async : IAsyncEnumerable<object[]> {\n\t\t\t\t\tpublic IAsyncEnumerator<object[]> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass_ITheoryDataRow : IEnumerable<ITheoryDataRow> {\n\t\t\t\t\tpublic IEnumerator<ITheoryDataRow> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass_ITheoryDataRow_Async : IAsyncEnumerable<ITheoryDataRow> {\n\t\t\t\t\tpublic IAsyncEnumerator<ITheoryDataRow> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass_TheoryDataRow : IEnumerable<TheoryDataRow> {\n\t\t\t\t\tpublic IEnumerator<TheoryDataRow> GetEnumerator() => null;\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class DataClass_TheoryDataRow_Async : IAsyncEnumerable<TheoryDataRow> {\n\t\t\t\t\tpublic IAsyncEnumerator<TheoryDataRow> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_ObjectArray))|}]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_ObjectArray_Async))|}]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_ITheoryDataRow))|}]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_ITheoryDataRow_Async))|}]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_TheoryDataRow))|}]\n\t\t\t\t\t[{|xUnit1050:ClassData(typeof(DataClass_TheoryDataRow_Async))|}]\n\t\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/CollectionDefinitionClassesMustBePublicTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.CollectionDefinitionClassesMustBePublic>;\n\npublic class CollectionDefinitionClassesMustBePublicTests\n{\n\t[Fact]\n\tpublic async Task ForPublicClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\tpublic class CollectionDefinitionClass { }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\")]\n\t[InlineData(\"internal \")]\n\tpublic async Task ForFriendOrInternalClass_Triggers(string classAccessModifier)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\t{0}class [|CollectionDefinitionClass|] {{ }}\n\t\t\t\"\"\", classAccessModifier);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\")]\n\t[InlineData(\"public \")]\n\tpublic async Task ForPartialClassInSameFile_WhenClassIsPublic_DoesNotTrigger(string otherPartAccessModifier)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\tpublic partial class CollectionDefinitionClass {{ }}\n\t\t\t{0}partial class CollectionDefinitionClass {{ }}\n\t\t\t\"\"\", otherPartAccessModifier);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\", \"\")]\n\t[InlineData(\"\", \"internal \")]\n\t[InlineData(\"internal \", \"internal \")]\n\tpublic async Task ForPartialClassInSameFile_WhenClassIsNonPublic_Triggers(\n\t\tstring part1AccessModifier,\n\t\tstring part2AccessModifier)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\t{0}partial class {{|#0:CollectionDefinitionClass|}} {{ }}\n\t\t\t{1}partial class {{|#1:CollectionDefinitionClass|}} {{ }}\n\t\t\t\"\"\", part1AccessModifier, part2AccessModifier);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithLocation(1);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/ConstructorsOnFactAttributeSubclassShouldBePublicTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.ConstructorsOnFactAttributeSubclassShouldBePublic>;\n\npublic class ConstructorsOnFactAttributeSubclassShouldBePublicTests\n{\n\t[Fact]\n\tpublic async Task DefaultConstructor_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute { }\n\n\t\t\tpublic class Tests {\n\t\t\t\t[CustomFact]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ParameterlessPublicConstructor_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute {\n\t\t\t\tpublic CustomFactAttribute() {\n\t\t\t\t\tthis.Skip = \"xxx\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class Tests {\n\t\t\t\t[CustomFact]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicConstructorWithParameters_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute {\n\t\t\t\tpublic CustomFactAttribute(string skip) {\n\t\t\t\t\tthis.Skip = skip;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class Tests {\n\t\t\t\t[CustomFact(\"blah\")]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicConstructorWithOtherConstructors_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute {\n\t\t\t\tpublic CustomFactAttribute() {\n\t\t\t\t\tthis.Skip = \"xxx\";\n\t\t\t\t}\n\n\t\t\t\tinternal CustomFactAttribute(string skip) {\n\t\t\t\t\tthis.Skip = skip;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class Tests {\n\t\t\t\t[CustomFact]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task InternalConstructor_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute {\n\t\t\t\tinternal CustomFactAttribute(string skip, params int[] values) { }\n\t\t\t}\n\n\t\t\tpublic class Tests {\n\t\t\t\t[{|#0:CustomFact(\"Skip\", 42)|}]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"CustomFactAttribute.CustomFactAttribute(string, params int[])\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ProtectedInternalConstructor_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\t[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n\t\t\tinternal sealed class CustomFactAttribute : FactAttribute {\n\t\t\t\tprotected internal CustomFactAttribute() {\n\t\t\t\t\tthis.Skip = \"xxx\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class Tests {\n\t\t\t\t[{|#0:CustomFact|}]\n\t\t\t\tpublic void TestCustomFact() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestFact() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"CustomFactAttribute.CustomFactAttribute()\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/DataAttributeShouldBeUsedOnATheoryTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DataAttributeShouldBeUsedOnATheory>;\n\npublic class DataAttributeShouldBeUsedOnATheoryTests\n{\n\t[Fact]\n\tpublic async Task FactMethodWithNoDataAttributes_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task FactMethodWithDataAttributes_DoesNotTrigger(string dataAttribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task TheoryMethodWithDataAttributes_DoesNotTrigger(string dataAttribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.Theory]\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task MethodsWithDataAttributesButNotFactOrTheory_Triggers(string dataAttribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void [|TestMethod|]() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/DoNotUseAsyncVoidForTestMethodsTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseAsyncVoidForTestMethods>;\n\npublic class DoNotUseAsyncVoidForTestMethodsTests\n{\n\t[Fact]\n\tpublic async Task NonTestMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\n\t\t\tpublic class MyClass {\n\t\t\t\tpublic async void MyMethod() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task NonAsyncTestMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task AsyncTaskMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task AsyncValueTaskMethod_V3_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async ValueTask TestMethod() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task AsyncVoidMethod_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async void {|#0:TestMethod|}() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expectedV2 = Verify.Diagnostic(\"xUnit1048\").WithLocation(0);\n\t\tvar expectedV3 = Verify.Diagnostic(\"xUnit1049\").WithLocation(0);\n\n\t\tawait Verify.VerifyAnalyzerV2(source, expectedV2);\n\t\tawait Verify.VerifyAnalyzerV3(source, expectedV3);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/DoNotUseBlockingTaskOperationsTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseBlockingTaskOperations>;\n\npublic class DoNotUseBlockingTaskOperationsTests\n{\n\t[Fact]\n\tpublic async Task SuccessCase()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tpublic class IValueTaskSource_NonGeneric\n\t{\n\t\t[Fact]\n\t\tpublic async Task GetResult_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks.Sources;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tdefault(IValueTaskSource).[|GetResult(0)|];\n\t\t\t\t\t\tAction<IValueTaskSource> _ = vts => vts.GetResult(0);\n\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\tdefault(IValueTaskSource).GetResult(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\t}\n\n\tpublic class IValueTaskSource_Generic\n\t{\n\t\t[Fact]\n\t\tpublic async Task GetResult_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks.Sources;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tdefault(IValueTaskSource<int>).[|GetResult(0)|];\n\t\t\t\t\t\tFunc<IValueTaskSource<int>, int> _ = vts => vts.GetResult(0);\n\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\tdefault(IValueTaskSource<int>).GetResult(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\t}\n\n\tpublic class Task_NonGeneric\n\t{\n\t\tpublic class Wait\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System;\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tTask.Delay(1).[|Wait()|];\n\t\t\t\t\t\t\tAction<Task> _ = t => t.Wait();\n\t\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\t\tTask.Delay(1).Wait();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_BeforeWhenAll_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task = Task.Delay(1);\n\n\t\t\t\t\t\t\ttask.[|Wait()|];\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_ForUnawaitedTask_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(new[] { task1 });\n\n\t\t\t\t\t\t\ttask1.Wait();\n\t\t\t\t\t\t\ttask2.[|Wait()|];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_InLambda_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tTask.CompletedTask.ContinueWith(x => x.Wait());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_AfterWhenAll_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task1, task2);\n\n\t\t\t\t\t\t\ttask1.Wait();\n\t\t\t\t\t\t\ttask2.Wait();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Wait_AfterWhenAny_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tvar finishedTask = await Task.WhenAny(task1, task2);\n\n\t\t\t\t\t\t\tfinishedTask.Wait();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\n\t\tpublic class WaitAny_WaitAll\n\t\t{\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_Triggers(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System;\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\t\tTask.[|{0}(Task.Delay(1))|];\n\t\t\t\t\t\t\tAction<Task> _ = t => Task.{0}(t);\n\t\t\t\t\t\t\tvoid LocalFunction() {{\n\t\t\t\t\t\t\t\tTask.{0}(Task.Delay(1));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_BeforeWhenAll_Triggers(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar task = Task.Delay(1);\n\n\t\t\t\t\t\t\tTask.[|{0}(task)|];\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task);\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_ForUnawaitedTask_Triggers(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(new[] {{ task1 }});\n\n\t\t\t\t\t\t\tTask.{0}(task1);\n\t\t\t\t\t\t\tTask.[|{0}(task2)|];\n\t\t\t\t\t\t\tTask.[|{0}(task1, task2)|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_InLambda_DoesNotTrigger(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\t\tTask.CompletedTask.ContinueWith(x => Task.{0}(x));\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_AfterWhenAll_DoesNotTrigger(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task1, task2);\n\n\t\t\t\t\t\t\tTask.{0}(task1);\n\t\t\t\t\t\t\tTask.{0}(task2);\n\t\t\t\t\t\t\tTask.{0}(task1, task2);\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"WaitAny\")]\n\t\t\t[InlineData(\"WaitAll\")]\n\t\t\tpublic async Task WaitMethod_AfterWhenAny_DoesNotTrigger(string waitMethod)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tvar finishedTask = await Task.WhenAny(task1, task2);\n\n\t\t\t\t\t\t\tTask.{0}(finishedTask);\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", waitMethod);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\n\t\tpublic class GetAwaiterGetResult\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System;\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tTask.CompletedTask.GetAwaiter().[|GetResult()|];\n\t\t\t\t\t\t\tAction<Task> _ = t => t.GetAwaiter().GetResult();\n\t\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\t\tTask.CompletedTask.GetAwaiter().GetResult();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_BeforeWhenAll_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task = Task.Delay(1);\n\n\t\t\t\t\t\t\ttask.GetAwaiter().[|GetResult()|];\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_OnUnawaitedTask_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(new[] { task1 });\n\n\t\t\t\t\t\t\ttask1.GetAwaiter().GetResult();\n\t\t\t\t\t\t\ttask2.GetAwaiter().[|GetResult()|];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_InLambda_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tTask.CompletedTask.ContinueWith(x => x.GetAwaiter().GetResult());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_AfterWhenAll_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task1, task2);\n\n\t\t\t\t\t\t\ttask1.GetAwaiter().GetResult();\n\t\t\t\t\t\t\ttask2.GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_AfterWhenAny_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.Delay(1);\n\t\t\t\t\t\t\tvar task2 = Task.Delay(2);\n\n\t\t\t\t\t\t\tvar finishedTask = await Task.WhenAny(task1, task2);\n\n\t\t\t\t\t\t\tfinishedTask.GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class Task_Generic\n\t{\n\t\tpublic class Result\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System;\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar _ = Task.FromResult(42).[|Result|];\n\t\t\t\t\t\t\tFunc<Task<int>, int> _2 = t => t.Result;\n\t\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\t\tvar _3 = Task.FromResult(42).Result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_BeforeWhenAll_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\n\t\t\t\t\t\t\tAssert.Equal(42, task.[|Result|]);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_ForUnawaitedTask_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(new[] { task1 });\n\n\t\t\t\t\t\t\tAssert.Equal(42, task1.Result);\n\t\t\t\t\t\t\tAssert.Equal(2112, task2.[|Result|]);\n\t\t\t\t\t\t\tAssert.Equal(2154, task1.Result + task2.[|Result|]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_InLambda_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar _ = Task.FromResult(42).ContinueWith(x => x.Result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_AfterWhenAll_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task1, task2);\n\n\t\t\t\t\t\t\tAssert.Equal(42, task1.Result);\n\t\t\t\t\t\t\tAssert.Equal(2112, task2.Result);\n\t\t\t\t\t\t\tAssert.Equal(2154, task1.Result + task2.Result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task Result_AfterWhenAny_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tvar finishedTask = await Task.WhenAny(task1, task2);\n\n\t\t\t\t\t\t\tAssert.Equal(2600, finishedTask.Result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\n\t\tpublic class GetAwaiterGetResult\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System;\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar _ = Task.FromResult(42).GetAwaiter().[|GetResult()|];\n\t\t\t\t\t\t\tFunc<Task<int>, int> _2 = t => t.GetAwaiter().GetResult();\n\t\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\t\tvar _3 = Task.FromResult(42).GetAwaiter().GetResult();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_BeforeWhenAll_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\n\t\t\t\t\t\t\tAssert.Equal(42, task.GetAwaiter().[|GetResult()|]);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_OnUnawaitedTask_Triggers()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(new[] { task1 });\n\n\t\t\t\t\t\t\tAssert.Equal(42, task1.GetAwaiter().GetResult());\n\t\t\t\t\t\t\tAssert.Equal(2112, task2.GetAwaiter().[|GetResult()|]);\n\t\t\t\t\t\t\tAssert.Equal(2154, task1.GetAwaiter().GetResult() + task2.GetAwaiter().[|GetResult()|]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_InLambda_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar _ = Task.FromResult(42).ContinueWith(x => x.GetAwaiter().GetResult());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_AfterWhenAll_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tawait Task.WhenAll(task1, task2);\n\n\t\t\t\t\t\t\tAssert.Equal(42, task1.GetAwaiter().GetResult());\n\t\t\t\t\t\t\tAssert.Equal(2112, task2.GetAwaiter().GetResult());\n\t\t\t\t\t\t\tAssert.Equal(2154, task1.GetAwaiter().GetResult() + task2.GetAwaiter().GetResult());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task GetResult_AfterWhenAny_DoesNotTrigger()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar task1 = Task.FromResult(42);\n\t\t\t\t\t\t\tvar task2 = Task.FromResult(2112);\n\n\t\t\t\t\t\t\tvar finishedTask = await Task.WhenAny(task1, task2);\n\n\t\t\t\t\t\t\tAssert.Equal(2600, finishedTask.GetAwaiter().GetResult());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ValueTask_NonGeneric\n\t{\n\t\t[Fact]\n\t\tpublic async Task GetResult_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tdefault(ValueTask).GetAwaiter().[|GetResult()|];\n\t\t\t\t\t\tAction<ValueTask> _ = vt => vt.GetAwaiter().GetResult();\n\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\tdefault(ValueTask).GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\t}\n\n\tpublic class ValueTask_Generic\n\t{\n\t\t[Fact]\n\t\tpublic async Task Result_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tvar _ = new ValueTask<int>(42).[|Result|];\n\t\t\t\t\t\tFunc<ValueTask<int>, int> _2 = vt => vt.Result;\n\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\tvar _3 = new ValueTask<int>(42).Result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task GetResult_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tvar _ = new ValueTask<int>(42).GetAwaiter().[|GetResult()|];\n\t\t\t\t\t\tFunc<ValueTask<int>, int> _2 = vt => vt.GetAwaiter().GetResult();\n\t\t\t\t\t\tvoid LocalFunction() {\n\t\t\t\t\t\t\tvar _3 = new ValueTask<int>(42).GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/DoNotUseConfigureAwaitTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseConfigureAwait>;\n\npublic class DoNotUseConfigureAwaitTests\n{\n\t[Fact]\n\tpublic async Task NoCall_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tpublic class ConfigureAwait_Boolean\n\t{\n\t\t[Fact]\n\t\tpublic async Task NonTestMethod_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class NonTestClass {\n\t\t\t\t\tpublic async Task NonTestMethod() {\n\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task True_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\tpublic static TheoryData<string> InvalidValues =\n\t\t[\n\t\t\t\"false\",       // Literal false\n\t\t\t\"1 == 2\",      // Logical false (we don't compute)\n\t\t\t\"1 == 1\",      // Logical true (we don't compute)\n\t\t\t\"booleanVar\",  // Reference value (we don't do lookup)\n\t\t];\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_InsideLambda_DoesNotTrigger(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tvar t = Task.Run(async () => {{\n\t\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0});\n\t\t\t\t\t\t}});\n\t\t\t\t\t\tawait t;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_InsideLocalFunction_DoesNotTrigger(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tasync Task AssertEventStateAsync() {{\n\t\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0});\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskWithAwait_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tawait Task.Delay(1).{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskWithoutAwait_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tTask.Delay(1).{{|#0:ConfigureAwait({0})|}}.GetAwaiter().GetResult();\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskOfT_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\tawait task.{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_ValueTask_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tvar valueTask = default(ValueTask);\n\t\t\t\t\t\tawait valueTask.{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_ValueTaskOfT_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\tvar valueTask = default(ValueTask<int>);\n\t\t\t\t\t\tawait valueTask.{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n#if NETCOREAPP\n\n\tpublic class ConfigureAwait_ConfigureAwaitOptions\n\t{\n\t\t[Fact]\n\t\tpublic async Task NonTestMethod_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class NonTestClass {\n\t\t\t\t\tpublic async Task NonTestMethod() {\n\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait(ConfigureAwaitOptions.None);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"ConfigureAwaitOptions.ContinueOnCapturedContext\")]\n\t\t[InlineData(\"ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ContinueOnCapturedContext\")]\n\t\t[InlineData(\"ConfigureAwaitOptions.ForceYielding | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ContinueOnCapturedContext\")]\n\t\tpublic async Task ValidValue_DoesNotTrigger(string enumValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0});\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", enumValue);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\tpublic static TheoryData<string> InvalidValues =\n\t\t[\n\t\t\t// Literal values\n\t\t\t\"ConfigureAwaitOptions.None\",\n\t\t\t\"ConfigureAwaitOptions.SuppressThrowing\",\n\t\t\t\"ConfigureAwaitOptions.ForceYielding | ConfigureAwaitOptions.SuppressThrowing\",\n\t\t\t// Reference values (we don't do lookup)\n\t\t\t\"enumVar\",\n\t\t];\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_InsideLambda_DoesNotTrigger(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tvar t = Task.Run(async () => {{\n\t\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0});\n\t\t\t\t\t\t}});\n\t\t\t\t\t\tawait t;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_InsideLocalFunction_DoesNotTrigger(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tasync Task AssertEventStateAsync() {{\n\t\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0});\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskWithAwait_Triggers(string enumValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tawait Task.Delay(1).{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", enumValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(enumValue, \"Ensure ConfigureAwaitOptions.ContinueOnCapturedContext in the flags.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskWithoutAwait_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tTask.Delay(1).{{|#0:ConfigureAwait({0})|}}.GetAwaiter().GetResult();\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Ensure ConfigureAwaitOptions.ContinueOnCapturedContext in the flags.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task InvalidValue_TaskOfT_Triggers(string argumentValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\tawait task.{{|#0:ConfigureAwait({0})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(argumentValue, \"Ensure ConfigureAwaitOptions.ContinueOnCapturedContext in the flags.\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n#endif\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/EnsureFixturesHaveASourceTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.EnsureFixturesHaveASource>;\n\npublic class EnsureFixturesHaveASourceTests\n{\n\tpublic class NonTestClass\n\t{\n\t\t[Fact]\n\t\tpublic async Task DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class NonTestClass {\n\t\t\t\t\tpublic NonTestClass(object _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class SupportedNonFixtureData\n\t{\n\t\t[Theory]\n\t\t[InlineData(\"\")]\n\t\t[InlineData(\"[Collection(\\\"TestCollection\\\")]\")]\n\t\tpublic async Task SupportedTypes_V2_DoesNotTrigger(string attribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing Xunit.Abstractions;\n\n\t\t\t\t{0} public class TestClass {{\n\t\t\t\t\tpublic TestClass(ITestOutputHelper _) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", attribute);\n\n\t\t\tawait Verify.VerifyAnalyzerV2(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"\")]\n\t\t[InlineData(\"[Collection(\\\"TestCollection\\\")]\")]\n\t\tpublic async Task SupportedTypes_V3_DoesNotTrigger(string attribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing Xunit.v3;\n\n\t\t\t\t{0} public class TestClass {{\n\t\t\t\t\tpublic TestClass(ITestOutputHelper _1, ITestContextAccessor _2) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", attribute);\n\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task OptionalParameter_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(bool value = true) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ParamsParameter_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(params object[] _) { }\n\t\t\t\t\t\t\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class ClassFixtures\n\t{\n\t\t[Theory]\n\t\t// Everything on the base type\n\t\t[InlineData(\n\t\t\t\"[Collection(\\\"TestCollection\\\")]\", \": IClassFixture<object>\",\n\t\t\t\"\", \"\")]\n\t\t// Everything on the derived type\n\t\t[InlineData(\n\t\t\t\"\", \"\",\n\t\t\t\"[Collection(\\\"TestCollection\\\")]\", \", IClassFixture<object>\")]\n\t\t// Fixture on the base type, collection on the derived type\n\t\t[InlineData(\n\t\t\t\"\", \": IClassFixture<object>\",\n\t\t\t\"[Collection(\\\"TestCollection\\\")]\", \"\")]\n\t\t// Collection on the base type, fixture on the derived type\n\t\t[InlineData(\n\t\t\t\"[Collection(\\\"TestCollection\\\")]\", \"\",\n\t\t\t\"\", \", IClassFixture<object>\")]\n\t\tpublic async Task BaseClassParameter_DerivedClassFixture_DoesNotTrigger(\n\t\t\tstring baseAttribute,\n\t\t\tstring baseInterface,\n\t\t\tstring derivedAttribute,\n\t\t\tstring derivedInterface)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t{0}\n\t\t\t\tpublic abstract class BaseClass {1} {{ }}\n\n\t\t\t\t{2}\n\t\t\t\tpublic class TestClass : BaseClass {3} {{\n\t\t\t\t\tpublic TestClass(object _) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", baseAttribute, baseInterface, derivedAttribute, derivedInterface);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ClassFixtureOnCollectionDefinition_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection : IClassFixture<object> { }\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(object _) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MissingClassFixtureDefinition_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(object [|_|]) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class CollectionFixtures\n\t{\n\t\t[Theory]\n\t\t[InlineData(\"\")]\n\t\t[InlineData(\"[CollectionDefinition(nameof(TestCollection))]\")]\n\t\tpublic async Task NoFixture_DoesNotTrigger(string definitionAttribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t{0}\n\t\t\t\tpublic class TestCollection {{ }}\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", definitionAttribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"[CollectionDefinition(nameof(TestCollection))]\", \"[Collection(nameof(TestCollection))]\", true)]\n\t\t[InlineData(\"\", \"[Collection(typeof(TestCollection))]\", false)]\n#if NETCOREAPP && ROSLYN_LATEST  // C# 11 is required for generic attributes\n\t\t[InlineData(\"\", \"[Collection<TestCollection>]\", false, LanguageVersion.CSharp11)]\n#endif\n\t\tpublic async Task WithInheritedFixture_DoesNotTrigger(\n\t\t\tstring collectionDefinition,\n\t\t\tstring collectionReference,\n\t\t\tbool supportedByV2,\n\t\t\tLanguageVersion? languageVersion = null)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class Fixture {{ }}\n\n\t\t\t\t{0}\n\t\t\t\tpublic class TestCollection : ICollectionFixture<Fixture> {{ }}\n\n\t\t\t\tpublic abstract class TestContext {{\n\t\t\t\t\tprotected TestContext(Fixture fixture) {{ }}\n\t\t\t\t}}\n\n\t\t\t\t{1}\n\t\t\t\tpublic class TestClass : TestContext {{\n\t\t\t\t\tpublic TestClass(Fixture fixture) : base(fixture) {{ }}\n\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", collectionDefinition, collectionReference);\n\n\t\t\tif (supportedByV2)\n\t\t\t\tawait Verify.VerifyAnalyzerV2(languageVersion ?? LanguageVersion.CSharp6, source);\n\t\t\tawait Verify.VerifyAnalyzerV3(languageVersion ?? LanguageVersion.CSharp6, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithGenericFixture_TriggersWithV2_DoesNotTriggerWithV3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class Fixture<T> { }\n\n\t\t\t\t[CollectionDefinition(\"test\")]\n\t\t\t\tpublic class TestCollection<TCollectionFixture> : ICollectionFixture<Fixture<TCollectionFixture>> { }\n\n\t\t\t\t[Collection(\"test\")]\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(Fixture<int> {|#0:fixture|}) { }\n\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV2 = Verify.Diagnostic().WithLocation(0).WithArguments(\"fixture\");\n\n\t\t\tawait Verify.VerifyAnalyzerV2(source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithInheritedGenericFixture_TriggersWithV2_DoesNotTriggerWithV3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class Fixture<T> { }\n\n\t\t\t\t[CollectionDefinition(\"test\")]\n\t\t\t\tpublic class TestCollection<TCollectionFixture> : ICollectionFixture<Fixture<TCollectionFixture>> { }\n\n\t\t\t\t[Collection(\"test\")]\n\t\t\t\tpublic abstract class TestContext<TContextFixture> {\n\t\t\t\t\tprotected TestContext(Fixture<TContextFixture> fixture) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass : TestContext<int> {\n\t\t\t\t\tpublic TestClass(Fixture<int> {|#0:fixture|}) : base(fixture) { }\n\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV2 = Verify.Diagnostic().WithLocation(0).WithArguments(\"fixture\");\n\n\t\t\tawait Verify.VerifyAnalyzerV2(source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"[Collection(nameof(TestCollection))]\", \"\")]\n\t\t[InlineData(\"\", \"[Collection(nameof(TestCollection))]\")]\n\t\tpublic async Task WithFixture_SupportsDerivation(\n\t\t\tstring baseAttribute,\n\t\t\tstring derivedAttribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection : ICollectionFixture<object> {{ }}\n\n\t\t\t\t{0}\n\t\t\t\tpublic abstract class BaseClass {{ }}\n\n\t\t\t\t{1}\n\t\t\t\tpublic class TestClass : BaseClass {{\n\t\t\t\t\tpublic TestClass(object _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", baseAttribute, derivedAttribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithFixture_WithDefinition_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection : ICollectionFixture<object> { }\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(object _) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"\")]\n\t\t[InlineData(\"[CollectionDefinition(nameof(TestCollection))]\")]\n\t\tpublic async Task WithFixture_WithoutCollectionFixtureInterface_Triggers(string definitionAttribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t{0}\n\t\t\t\tpublic class TestCollection {{ }}\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tpublic TestClass(object [|_|]) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", definitionAttribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class AssemblyFixtures\n\t{\n\t\t[Fact]\n\t\tpublic async Task WithAssemblyFixture_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t[assembly: AssemblyFixture(typeof(object))]\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(object _) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\t}\n\n\tpublic class MixedFixtures\n\t{\n\t\t[Theory]\n\t\t[InlineData(\"\")]\n\t\t[InlineData(\"[CollectionDefinition(nameof(TestCollection))]\")]\n\t\tpublic async Task WithClassFixture_WithCollection_DoesNotTrigger(string definitionAttribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\t{0}\n\t\t\t\tpublic class TestCollection {{ }}\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass : IClassFixture<object> {{\n\t\t\t\t\tpublic TestClass(object _) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", definitionAttribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithMixedClassAndCollectionFixture_AndSupportedNonFixture_DoesNotTrigger()\n\t\t{\n\t\t\tvar sourceTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class ClassFixture {{ }}\n\t\t\t\tpublic class CollectionFixture {{ }}\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection : ICollectionFixture<CollectionFixture> {{ }}\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass : IClassFixture<ClassFixture> {{\n\t\t\t\t\tpublic TestClass(ClassFixture _1, CollectionFixture _2, {0} _3) {{ }}\n\n\t\t\t\t\t[Fact] public void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV2(string.Format(sourceTemplate, \"Xunit.Abstractions.ITestOutputHelper\"));\n\t\t\tawait Verify.VerifyAnalyzerV3(string.Format(sourceTemplate, \"Xunit.ITestContextAccessor\"));\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MissingClassFixture_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class ClassFixture { }\n\t\t\t\tpublic class CollectionFixture { }\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection : ICollectionFixture<CollectionFixture> { }\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic TestClass(ClassFixture [|_1|], CollectionFixture _2) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MissingCollectionFixture_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class ClassFixture { }\n\t\t\t\tpublic class CollectionFixture { }\n\n\t\t\t\t[CollectionDefinition(nameof(TestCollection))]\n\t\t\t\tpublic class TestCollection { }\n\n\t\t\t\t[Collection(nameof(TestCollection))]\n\t\t\t\tpublic class TestClass : IClassFixture<ClassFixture> {\n\t\t\t\t\tpublic TestClass(ClassFixture _1, CollectionFixture [|_2|]) { }\n\n\t\t\t\t\t[Fact] public void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/FactMethodMustNotHaveParametersTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.FactMethodMustNotHaveParameters>;\n\npublic class FactMethodMustNotHaveParametersTests\n{\n\t[Fact]\n\tpublic async Task FactWithNoParameters_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryWithParameters_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(string p) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task FactWithParameters_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void [|TestMethod|](string p) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/FactMethodShouldNotHaveTestDataTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.FactMethodShouldNotHaveTestData>;\n\npublic class FactMethodShouldNotHaveTestDataTests\n{\n\t[Fact]\n\tpublic async Task FactWithNoDataAttributes_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task TheoryWithDataAttributes_DoesNotTrigger(string dataAttribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.Theory]\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task FactDerivedMethodWithDataAttributes_DoesNotTrigger(string dataAttribute)\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"public class DerivedFactAttribute: Xunit.FactAttribute {}\";\n\t\tvar source2 = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[DerivedFactAttribute]\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2]);\n\t}\n\n\t[Theory]\n\t[InlineData(\"InlineData\")]\n\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t[InlineData(\"ClassData(typeof(string))\")]\n\tpublic async Task FactWithDataAttributes_Triggers(string dataAttribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void [|TestMethod|]() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", dataAttribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/InlineDataMustMatchTheoryParametersTests.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataMustMatchTheoryParameters>;\nusing Verify_v2_Pre240 = CSharpVerifier<InlineDataMustMatchTheoryParametersTests.Analyzer_v2_Pre240>;\n\npublic class InlineDataMustMatchTheoryParametersTests\n{\n\tpublic class NonErrors\n\t{\n\t\t[Fact]\n\t\tpublic async Task MethodUsingParamsArgument()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", \"xyz\")]\n\t\t\t\t\tpublic void TestMethod(params string[] args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNullParamsArgument_NonNullable()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\tpublic void TestMethod(params string[] args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNullParamsArgument_Nullable()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\tpublic void TestMethod(params string[]? args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNormalAndParamsArgument()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", \"xyz\")]\n\t\t\t\t\tpublic void TestMethod(string first, params string[] args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNormalAndNullParamsArgument_NonNullable()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", null)]\n\t\t\t\t\tpublic void TestMethod(string first, params string[] args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNormalAndNullParamsArgument_Nullable()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", null)]\n\t\t\t\t\tpublic void TestMethod(string first, params string[]? args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNormalAndUnusedParamsArgument()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\")]\n\t\t\t\t\tpublic void TestMethod(string first, params string[] args) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingEmptyArrayForParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new int[] { })]\n\t\t\t\t\tpublic void VariableArgumentsTest(params int[] sq) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingMixedArgumentsAndEmptyArrayForParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(21.12, new int[] { })]\n\t\t\t\t\tpublic void VariableArgumentsTest(double d, params int[] sq) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingNonEmptyArrayForParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new int[] { 1, 2, 3 })]\n\t\t\t\t\tpublic void VariableArgumentsTest(params int[] sq) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MethodUsingMixedArgumentsAndNonEmptyArrayForParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(21.12, new int[] { 1, 2, 3 })]\n\t\t\t\t\tpublic void VariableArgumentsTest(double d, params int[] sq) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingParameters()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", 1, null)]\n\t\t\t\t\tpublic void TestMethod(string a, int b, object c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingParametersWithDefaultValues()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\")]\n\t\t\t\t\tpublic void TestMethod(string a, string b = \"default\", string c = null) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingParametersWithDefaultValuesAndParamsArgument()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\")]\n\t\t\t\t\tpublic void TestMethod(string a, string b = \"default\", string c = null, params string[] d) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingParameterWithOptionalAttribute()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(\"abc\")]\n\t\t\t\t\tpublic void TestMethod(string a, [System.Runtime.InteropServices.Optional] string b) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingMultipleParametersWithOptionalAttributes()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\t[Xunit.InlineData(\"abc\")]\n\t\t\t\t\t[Xunit.InlineData(\"abc\", \"def\")]\n\t\t\t\t\tpublic void TestMethod(\n\t\t\t\t\t\t[System.Runtime.InteropServices.Optional] string a,\n\t\t\t\t\t\t[System.Runtime.InteropServices.Optional] string b) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingExplicitArray()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new object[] { \"abc\", 1, null })]\n\t\t\t\t\tpublic void TestMethod(string a, int b, object c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingExplicitNamedArray()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(data: new object[] { \"abc\", 1, null })]\n\t\t\t\t\tpublic void TestMethod(string a, int b, object c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingImplicitArray()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new[] { (object)\"abc\", 1, null })]\n\t\t\t\t\tpublic void TestMethod(string a, int b, object c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UsingImplicitNamedArray()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(data: new[] { (object)\"abc\", 1, null })]\n\t\t\t\t\tpublic void TestMethod(string a, int b, object c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task EmptyArray()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new byte[0])]\n\t\t\t\t\tpublic void TestMethod(byte[] input) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t// https://github.com/xunit/xunit/issues/3000\n\t\t[Fact]\n\t\tpublic async Task DecimalValue()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic sealed class ReproClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[InlineData({|CS0182:0.1m|})]\n\t\t\t\t\tpublic void ReproMethod(decimal m)\n\t\t\t\t\t{ }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1009_TooFewValues\n\t{\n\t\t[Fact]\n\t\tpublic async Task IgnoresFact()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\tpublic void TestMethod(string a) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"Xunit.InlineData()\")]\n\t\t[InlineData(\"Xunit.InlineData\")]\n\t\tpublic async Task NoArguments(string attribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[{{|xUnit1009:{0}|}}]\n\t\t\t\t\tpublic void TestMethod(int a) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", attribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task TooFewArguments()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[{|xUnit1009:Xunit.InlineData(1)|}]\n\t\t\t\t\tpublic void TestMethod(int a, int b, string c) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task TooFewArguments_WithParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[{|xUnit1009:Xunit.InlineData(1)|}]\n\t\t\t\t\tpublic void TestMethod(int a, int b, params string[] value) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1010_IncompatibleValueType\n\t{\n\t\t[Fact]\n\t\tpublic async Task MethodUsingIncompatibleExplicitArrayForParams()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(21.12, {|xUnit1010:new object[] { }|})]\n\t\t\t\t\tpublic void VariableArgumentsTest(double d, params int[] sq) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\tpublic class NumericParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\tpublic static readonly IEnumerable<TheoryDataRow<string>> NumericTypes =\n\t\t\t[\n\t\t\t\t\"int\",\n\t\t\t\t\"uint\",\n\t\t\t\t\"long\",\n\t\t\t\t\"ulong\",\n\t\t\t\t\"short\",\n\t\t\t\t\"ushort\",\n\t\t\t\t\"byte\",\n\t\t\t\t\"sbyte\",\n\t\t\t\t\"float\",\n\t\t\t\t\"double\",\n\t\t\t\t\"decimal\",\n\t\t\t];\n\n\t\t\tpublic static MatrixTheoryData<string, string> NumericValuesAndNumericTypes =\n\t\t\t\tnew(NumericValues.Select(d => d.Data), NumericTypes.Select(d => d.Data));\n\n\t\t\tpublic static MatrixTheoryData<string, string> BoolValuesAndNumericTypes =\n\t\t\t\tnew(BoolValues.Select(d => d.Data), NumericTypes.Select(d => d.Data));\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValuesAndNumericTypes))]\n\t\t\tpublic async Task CompatibleNumericValue_NonNullableType(\n\t\t\t\tstring value,\n\t\t\t\tstring type)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod({1} a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value, type);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValuesAndNumericTypes))]\n\t\t\tpublic async Task CompatibleNumericValue_NullableType(\n\t\t\t\tstring value,\n\t\t\t\tstring type)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod({1}? a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value, type);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValuesAndNumericTypes))]\n\t\t\tpublic async Task BooleanValue_NumericType(\n\t\t\t\tstring value,\n\t\t\t\tstring type)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod({1} a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value, type);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", type);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericTypes))]\n\t\t\tpublic async Task CharValue_NumericType(string type)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData('a')]\n\t\t\t\t\t\tpublic void TestMethod({0} a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", type);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericTypes))]\n\t\t\tpublic async Task EnumValue_NumericType(string type)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:System.StringComparison.InvariantCulture|}})]\n\t\t\t\t\t\tpublic void TestMethod({0} a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", type);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", type);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class BooleanParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\tpublic async Task FromBooleanValue_ToNonNullable(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(bool a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\tpublic async Task FromBooleanValue_ToNullable(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(bool? a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(bool a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"bool\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class CharParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[MemberData(nameof(IntegerValues))]\n\t\t\tpublic async Task FromCharOrIntegerValue_ToNonNullable(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(char a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[MemberData(nameof(IntegerValues))]\n\t\t\tpublic async Task FromCharOrIntegerValue_ToNullable(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(char? a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(FloatingPointValues))]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(char a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"char\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class EnumParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task FromEnumValue_ToNonNullable()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData(System.StringComparison.Ordinal)]\n\t\t\t\t\t\tpublic void TestMethod(System.StringComparison a) { }\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task FromEnumValue_ToNullable()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData(System.StringComparison.Ordinal)]\n\t\t\t\t\t\tpublic void TestMethod(System.StringComparison? a) { }\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(System.StringComparison a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"System.StringComparison\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class TypeParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\tpublic async Task FromTypeValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(System.Type a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\tpublic async Task FromTypeValue_ToParams(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(params System.Type[] a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(System.Type a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"System.Type\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\tpublic async Task FromIncompatibleValue_ToParams(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(params System.Type[] a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"System.Type\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class StringParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\tpublic async Task FromStringValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(string a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(string a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"string\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class InterfaceParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\tpublic async Task FromTypeImplementingInterface(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(System.IFormattable a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n#if NETFRAMEWORK\n\t\t\t[InlineData(\"'a'\")]\n#endif\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\tpublic async Task FromIncompatibleValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(System.IFormattable a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"System.IFormattable\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class ObjectParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromAnyValue(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(object a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromAnyValue_ToParams(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod(params object[] a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\n\t\tpublic class GenericParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromAnyValue_NoConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\tpublic async Task FromValueTypeValue_WithStructConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: struct {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\tpublic async Task FromReferenceTypeValue_WithStructConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: struct {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"T\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\t[InlineData(\"null\")]\n\t\t\tpublic async Task FromReferenceTypeValue_WithClassConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: class {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[InlineData(\"'a'\")]\n\t\t\tpublic async Task FromValueTypeValue_WithClassConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: class {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"T\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[InlineData(\"null\")]\n\t\t\t[InlineData(\"System.StringComparison.Ordinal\")]\n\t\t\t[MemberData(nameof(NumericValues))]\n\t\t\tpublic async Task FromCompatibleValue_WithTypeConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: System.IConvertible, System.IFormattable {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n#if ROSLYN_LATEST && NET8_0_OR_GREATER\n\t\t\t[Fact]\n\t\t\tpublic async Task TypeConstraint_WithCRTP() // CRTP: Curiously Recurring Template Pattern or T: Interface<T>\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Numerics;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[InlineData(0U)]\n\t\t\t\t\t[InlineData(2U)]\n\t\t\t\t\t[InlineData(5294967295U)] // ulong value\n\t\t\t\t\t[InlineData({|xUnit1010:-1U|})]\n\t\t\t\t\t[InlineData({|xUnit1010:2|})]\n\t\t\t\t\t[InlineData({|xUnit1010:0|})]\n\t\t\t\t\t[InlineData({|xUnit1010:\"A\"|})]\n\t\t\t\t\tpublic void UnsignedNumberIsAtLeastZero<T>(T number)\n\t\t\t\t\t\twhere T : IUnsignedNumber<T> => Assert.False(T.IsNegative(number));\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp11, source);\n\t\t\t}\n#endif\n\n\t\t\t[Theory]\n#if NETFRAMEWORK\n\t\t\t[InlineData(\"'a'\")]\n#endif\n\t\t\t[InlineData(\"\\\"abc\\\"\")]\n\t\t\t[InlineData(\"typeof(string)\")]\n\t\t\t[MemberData(nameof(BoolValues))]\n\t\t\tpublic async Task FromIncompatibleValue_WithTypeConstraint(string value)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: System.IConvertible, System.IFormattable {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", value);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"T\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task FromIncompatibleArray()\n\t\t\t{\n\t\t\t\tvar source =/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData(new int[] { {|#0:1|}, 2, 3 })]\n\t\t\t\t\t\tpublic void TestMethod<T>(T a) where T: System.IConvertible, System.IFormattable { }\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"a\", \"T\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task FromCompatibleArray()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData(new int[] { 1, 2, 3 })]\n\t\t\t\t\t\tpublic void TestMethod<T>(T[] a) { }\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(SignedIntAndUnsignedInt))]\n\t\t\tpublic async Task FromNegativeInteger_ToUnsignedInteger(\n\t\t\t\tstring signedType,\n\t\t\t\tstring unsignedType)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:({0})-1|}})]\n\t\t\t\t\t\tpublic void TestMethod({1} value) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", signedType, unsignedType);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"value\", unsignedType);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(UnsignedIntegralTypes))]\n\t\t\tpublic async Task FromLongMinValue_ToUnsignedInteger(string unsignedType)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:long.MinValue|}})]\n\t\t\t\t\t\tpublic void TestMethod({0} value) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", unsignedType);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"value\", unsignedType);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\t\t}\n\n\t\tpublic class DateTimeLikeParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\tpublic static readonly IEnumerable<TheoryDataRow<string>> ValidDateTimeStrings =\n\t\t\t[\n\t\t\t\t\"\\\"\\\"\",\n\t\t\t\t\"\\\"2018-01-02\\\"\",\n\t\t\t\t\"\\\"2018-01-02 12:34\\\"\",\n\t\t\t\t\"\\\"obviously-rubbish-datetime-value\\\"\",\n\t\t\t\t\"MyConstString\"\n\t\t\t];\n\n\t\t\tpublic static MatrixTheoryData<string, string> ValueTypedArgumentsCombinedWithDateTimeLikeTypes =\n\t\t\t\tnew(ValueTypedValues.Select(d => d.Data), [\"System.DateTime\", \"System.DateTimeOffset\"]);\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValueTypedArgumentsCombinedWithDateTimeLikeTypes))]\n\t\t\t[InlineData(\"MyConstInt\", \"System.DateTime\")]\n\t\t\t[InlineData(\"MyConstInt\", \"System.DateTimeOffset\")]\n\t\t\tpublic async Task NonStringValue(\n\t\t\t\tstring data,\n\t\t\t\tstring parameterType)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\tconst int MyConstInt = 1;\n\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod({1} parameter) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", data, parameterType);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"parameter\", parameterType);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValidDateTimeStrings))]\n\t\t\tpublic async Task StringValue_ToDateTime(string data)\n\t\t\t{\n\t\t\t\tvar source = CreateSourceWithStringConst(data, \"System.DateTime\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValidDateTimeStrings))]\n\t\t\tpublic async Task StringValue_ToDateTimeOffset(string data)\n\t\t\t{\n\t\t\t\tvar source = CreateSourceWithStringConst(data, \"System.DateTimeOffset\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValidDateTimeStrings))]\n\t\t\tpublic async Task StringValue_ToDateTimeOffset_Pre240(string data)\n\t\t\t{\n\t\t\t\tvar source = CreateSourceWithStringConst(\"{|#0:\" + data + \"|}\", \"System.DateTimeOffset\");\n\t\t\t\tvar expected = Verify_v2_Pre240.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"parameter\", \"System.DateTimeOffset\");\n\n\t\t\t\tawait Verify_v2_Pre240.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\tstatic string CreateSourceWithStringConst(\n\t\t\t\tstring data,\n\t\t\t\tstring parameterType) => string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tconst string MyConstString = \"some string\";\n\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\tpublic void TestMethod({1} parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", data, parameterType);\n\t\t}\n\n\t\tpublic class GuidParameter : X1010_IncompatibleValueType\n\t\t{\n\t\t\tpublic static IEnumerable<TheoryDataRow<string>> ValidGuidStrings =\n\t\t\t[\n\t\t\t\t\"\\\"\\\"\",\n\t\t\t\t\"\\\"{5B21E154-15EB-4B1E-BC30-127E8A41ECA1}\\\"\",\n\t\t\t\t\"\\\"4EBCD32C-A2B8-4600-9E72-3873347E285C\\\"\",\n\t\t\t\t\"\\\"39A3B4C85FEF43A988EB4BB4AC4D4103\\\"\",\n\t\t\t\t\"\\\"obviously-rubbish-guid-value\\\"\"\n\t\t\t];\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValueTypedValues))]\n\t\t\t[InlineData(\"MyConstInt\")]\n\t\t\tpublic async Task NonStringValue(string data)\n\t\t\t{\n\t\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\tprivate const int MyConstInt = 1;\n\n\t\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t\t[Xunit.InlineData({{|#0:{0}|}})]\n\t\t\t\t\t\tpublic void TestMethod(System.Guid parameter) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", data);\n\t\t\t\tvar expected = Verify.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"parameter\", \"System.Guid\");\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValidGuidStrings))]\n\t\t\tpublic async Task StringValue(string inlineData)\n\t\t\t{\n\t\t\t\tvar source = CreateSource(inlineData);\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(ValidGuidStrings))]\n\t\t\tpublic async Task StringValue_Pre240(string data)\n\t\t\t{\n\t\t\t\tvar source = CreateSource(\"{|#0:\" + data + \"|}\");\n\t\t\t\tvar expected = Verify_v2_Pre240.Diagnostic(\"xUnit1010\").WithLocation(0).WithArguments(\"parameter\", \"System.Guid\");\n\n\t\t\t\tawait Verify_v2_Pre240.VerifyAnalyzer(source, expected);\n\t\t\t}\n\n\t\t\tstatic string CreateSource(string data) => string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\tpublic void TestMethod(System.Guid parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", data);\n\t\t}\n\n\t\tpublic class UserDefinedConversionOperators : X1010_IncompatibleValueType\n\t\t{\n\t\t\t[Fact]\n\t\t\tpublic async Task SupportsImplicitConversion()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Theory]\n\t\t\t\t\t\t[InlineData(\"abc\")]\n\t\t\t\t\t\tpublic void ParameterDeclaredImplicitConversion(Implicit i) => Assert.Equal(\"abc\", i.Value);\n\n\t\t\t\t\t\tpublic class Implicit {\n\t\t\t\t\t\t\tpublic string Value { get; set; }\n\t\t\t\t\t\t\tpublic static implicit operator Implicit(string value) => new Implicit() { Value = value };\n\t\t\t\t\t\t\tpublic static implicit operator string(Implicit i) => i.Value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\n\t\t\t[Fact]\n\t\t\tpublic async Task SupportsExplicitConversion()\n\t\t\t{\n\t\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Theory]\n\t\t\t\t\t\t[InlineData(\"abc\")]\n\t\t\t\t\t\tpublic void ParameterDeclaredExplicitConversion(Explicit i) => Assert.Equal(\"abc\", i.Value);\n\n\t\t\t\t\t\tpublic class Explicit {\n\t\t\t\t\t\t\tpublic string Value { get; set; }\n\t\t\t\t\t\t\tpublic static explicit operator Explicit(string value) => new Explicit() { Value = value };\n\t\t\t\t\t\t\tpublic static explicit operator string(Explicit i) => i.Value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t\t}\n\t\t}\n\n\t\t// Note: decimal literal 42M is not valid as an attribute argument\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> BoolValues =\n\t\t[\n\t\t\t\"true\",\n\t\t\t\"false\"\n\t\t];\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> FloatingPointValues =\n\t\t[\n\t\t\t\"42f\",\n\t\t\t\"42d\"\n\t\t];\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> IntegerValues =\n\t\t[\n\t\t\t\"42\",\n\t\t\t\"42L\",\n\t\t\t\"42u\",\n\t\t\t\"42ul\",\n\t\t\t\"(short)42\",\n\t\t\t\"(byte)42\",\n\t\t\t\"(ushort)42\",\n\t\t\t\"(sbyte)42\"\n\t\t];\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> NumericValues =\n\t\t\tIntegerValues.Concat(FloatingPointValues);\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> ValueTypedValues =\n\t\t\tIntegerValues.Concat(FloatingPointValues).Concat(BoolValues).Append(new(\"typeof(int)\"));\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> SignedIntegralTypes =\n\t\t\t[\"int\", \"long\", \"short\", \"sbyte\"];\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> UnsignedIntegralTypes =\n\t\t\t[\"uint\", \"ulong\", \"ushort\", \"byte\"];\n\n\t\tpublic static readonly MatrixTheoryData<string, string> SignedIntAndUnsignedInt =\n\t\t\tnew(\n\t\t\t\tSignedIntegralTypes.Select(r => r.Data),\n\t\t\t\tUnsignedIntegralTypes.Select(r => r.Data)\n\t\t\t);\n\t}\n\n\tpublic class X1011_ExtraValue\n\t{\n\t\t[Fact]\n\t\tpublic async Task IgnoresFact()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\t[Xunit.InlineData(1, 2, \"abc\")]\n\t\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ExtraArguments()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, {|#0:2|}, {|#1:\"abc\"|})]\n\t\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit1011\").WithLocation(0).WithArguments(\"2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1011\").WithLocation(1).WithArguments(\"\\\"abc\\\"\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tpublic class X1012_NullShouldNotBeUsedForIncompatibleParameter\n\t{\n\t\t[Fact]\n\t\tpublic async Task IgnoresFact()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"int\")]\n\t\t[InlineData(\"params int[]\")]\n\t\tpublic async Task SingleNullValue(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData({{|#0:null|}})]\n\t\t\t\t\tpublic void TestMethod({0} a) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1012\").WithLocation(0).WithArguments(\"a\", \"int\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(ValueTypes))]\n\t\tpublic async Task NonNullableValueTypes(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, {{|#0:null|}}, {{|#1:null|}})]\n\t\t\t\t\tpublic void TestMethod(int a, {0} b, params {0}[] c) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit1012\").WithLocation(0).WithArguments(\"b\", type),\n\t\t\t\tVerify.Diagnostic(\"xUnit1012\").WithLocation(1).WithArguments(\"c\", type),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(ValueTypes))]\n\t\tpublic async Task NullableValueTypes(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, null)]\n\t\t\t\t\tpublic void TestMethod(int a, {0}? b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"object\")]\n\t\t[InlineData(\"string\")]\n\t\t[InlineData(\"System.Exception\")]\n\t\tpublic async Task ReferenceTypes(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, null)]\n\t\t\t\t\tpublic void TestMethod(int a, {0} b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"object\")]\n\t\t[InlineData(\"string\")]\n\t\t[InlineData(\"System.Exception\")]\n\t\tpublic async Task NonNullableReferenceTypes(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, {{|#0:null|}})]\n\t\t\t\t\tpublic void TestMethod(int a, {0} b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1012\").WithLocation(0).WithArguments(\"b\", type);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"object\")]\n\t\t[InlineData(\"string\")]\n\t\t[InlineData(\"System.Exception\")]\n\t\tpublic async Task NullableReferenceTypes(string type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, null)]\n\t\t\t\t\tpublic void TestMethod(int a, {0}? b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", type);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"1\", \"object\")]\n\t\t[InlineData(\"\\\"bob\\\"\", \"string\")]\n\t\tpublic async Task NullableParamsReferenceTypes(\n\t\t\tstring param,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, {0}, null, null)]\n\t\t\t\t\tpublic void TestMethod(int a, params {1}?[] b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", param, type);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"1\", \"object\")]\n\t\t[InlineData(\"\\\"bob\\\"\", \"string\")]\n\t\tpublic async Task NonNullableParamsReferenceTypes(\n\t\t\tstring param,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, {0}, {{|#0:null|}}, {{|#1:null|}})]\n\t\t\t\t\tpublic void TestMethod(int a, params {1}[] b) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", param, type);\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit1012\").WithLocation(0).WithArguments(\"b\", type),\n\t\t\t\tVerify.Diagnostic(\"xUnit1012\").WithLocation(1).WithArguments(\"b\", type),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\tpublic static IEnumerable<TheoryDataRow<string>> ValueTypes =\n\t\t[\n\t\t\t\"bool\",\n\t\t\t\"int\",\n\t\t\t\"byte\",\n\t\t\t\"short\",\n\t\t\t\"long\",\n\t\t\t\"decimal\",\n\t\t\t\"double\",\n\t\t\t\"float\",\n\t\t\t\"char\",\n\t\t\t\"ulong\",\n\t\t\t\"uint\",\n\t\t\t\"ushort\",\n\t\t\t\"sbyte\",\n\t\t\t\"System.StringComparison\",\n\t\t\t\"System.Guid\",\n\t\t];\n\t}\n\n\tinternal class Analyzer_v2_Pre240 : InlineDataMustMatchTheoryParameters\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 3, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/InlineDataShouldBeUniqueWithinTheoryTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataShouldBeUniqueWithinTheory>;\n\npublic abstract class InlineDataShouldBeUniqueWithinTheoryTests\n{\n\tpublic class ForNonRelatedToInlineDataMethod : InlineDataShouldBeUniqueWithinTheoryTests\n\t{\n\t\t[Fact]\n\t\tpublic async Task WithNoDataAttributes_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"MemberData(\\\"\\\")\")]\n\t\t[InlineData(\"ClassData(typeof(string))\")]\n\t\tpublic async Task WithDataAttributesOtherThanInline_DoesNotTrigger(\n\t\t\tstring dataAttribute)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.{0}]\n\t\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", dataAttribute);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class ForUniqueInlineDataMethod : InlineDataShouldBeUniqueWithinTheoryTests\n\t{\n\t\t[Fact]\n\t\tpublic async Task NonTheory_SingleInlineData_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NonTheory_DoubledInlineData_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task SingleInlineData_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task MultipleInlineData_DifferentValues_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\t[Xunit.InlineData(20)]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(/* lang=c#-test */ \"new object[] { 1, 3 }\")]\n\t\t[InlineData(/* lang=c#-test */ \"data: new object[] { 1, 3 }\")]\n\t\t[InlineData(/* lang=c#-test */ \"new object[] { }\")]\n\t\t[InlineData(/* lang=c#-test */ \"data: new object[] { 1 }\")]\n\t\tpublic async Task UniqueValues_WithParamsInitializerValues_DoesNotTrigger(string data)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, 2)]\n\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\tpublic void TestMethod(params int[] args) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", data);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task UniqueValues_WithOverridingDefaultValues_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1)]\n\t\t\t\t\t[Xunit.InlineData(1, \"non-default-val\")]\n\t\t\t\t\tpublic void TestMethod(int x, string a = \"default-val\") { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NullAndEmpty_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\tpublic void TestMethod(string s) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NullAndArray_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new[] { 0 })]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\tpublic void TestMethod(int[] arr) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ArrayOrderVariance_DoesNotTrigger()\n\t\t{\n\t\t\t// Specially crafted InlineData values that will cause the InlineDataUniquenessComparer\n\t\t\t// to return same hashcodes, because GetFlattenedArgumentPrimitives ignores empty arrays.\n\t\t\t// This will trigger the actual bug, where the first parameter object array being equal\n\t\t\t// would cause the other parameters to not be evaluated for equality at all.\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new int[] { 1 }, new int[0], new int[] { 1 })]\n\t\t\t\t\t[Xunit.InlineData(new int[] { 1 }, new int[] { 1 }, new int[0])]\n\t\t\t\t\tpublic static void Test(int[] x, int[] y, int[] z) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class ForDuplicatedInlineDataMethod : InlineDataShouldBeUniqueWithinTheoryTests\n\t{\n\t\t[Fact]\n\t\tpublic async Task DoubleEmptyInlineData_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\t[{|#0:Xunit.InlineData|}]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubleNullInlineData_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(null)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(null)|}]\n\t\t\t\t\tpublic void TestMethod(string x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubleValues_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(10)|}]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ValueFromConstant_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tprivate const int X = 10;\n\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(X)|}]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(/* lang=c#-test */ \"new object[] { 10, 20 }\")]\n\t\t[InlineData(/* lang=c#-test */ \"data: new object[] { 10, 20 }\")]\n\t\tpublic async Task TwoParams_RawValuesVsArgumentArray_Triggers(string data)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10, 20)]\n\t\t\t\t\t[{{|#0:Xunit.InlineData({0})|}}]\n\t\t\t\t\tpublic void TestMethod(int x, int y) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", data);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(/* lang=c#-test */ \"new object[] { 10, 20 }\")]\n\t\t[InlineData(/* lang=c#-test */ \"data: new object[] { 10, 20 }\")]\n\t\tpublic async Task ParamsArray_RawValuesVsArgumentArray_Triggers(string data)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10, 20)]\n\t\t\t\t\t[{{|#0:Xunit.InlineData({0})|}}]\n\t\t\t\t\tpublic void TestMethod(params int[] args) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", data);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubledArgumentArrays_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new object[] { 10, 20 })]\n\t\t\t\t\t[{|#0:Xunit.InlineData(new object[] { 10, 20 })|}]\n\t\t\t\t\tpublic void TestMethod(int x, int y) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubledComplexValuesForObject_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(new object[] {10, new object[] { new object[] {20}, 30}})]\n\t\t\t\t\t[{|#0:Xunit.InlineData(new object[] {10, new object[] { new object[] {20}, 30}})|}]\n\t\t\t\t\tpublic void TestMethod(object x, object y) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubledComplexValues_RawValuesVsArgumentArray_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10, new object[] { new object[] {20}, 30}, 40)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(new object[] {10, new object[] { new object[] {20}, 30}})|}]\n\t\t\t\t\tpublic void TestMethod(object x, object y, int z = 40) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t// The value 1 doesn't seem to trigger bugs related to comparing boxed values, but 2 does\n\t\tpublic static TheoryData<int> DefaultValueData = [1, 2];\n\n\t\t[Theory]\n\t\t[MemberData(nameof(DefaultValueData))]\n\t\tpublic async Task DefaultValueVsExplicitValue_Triggers(int defaultValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\t[{{|#0:Xunit.InlineData({0})|}}]\n\t\t\t\t\tpublic void TestMethod(int y = {0}) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", defaultValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(DefaultValueData))]\n\t\tpublic async Task ExplicitValueVsDefaultValue_Triggers(int defaultValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t[{{|#0:Xunit.InlineData|}}]\n\t\t\t\t\tpublic void TestMethod(int y = {0}) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", defaultValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(DefaultValueData))]\n\t\tpublic async Task DefaultValueVsDefaultValue_Triggers(int defaultValue)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData]\n\t\t\t\t\t[{{|#0:Xunit.InlineData|}}]\n\t\t\t\t\tpublic void TestMethod(int y = {0}) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", defaultValue);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"null\", \"null\")]\n\t\t[InlineData(\"null\", \"\")]\n\t\t[InlineData(\"\", \"null\")]\n\t\t[InlineData(\"\", \"\")]\n\t\tpublic async Task DefaultValueVsNull_Triggers(\n\t\t\tstring firstArg,\n\t\t\tstring secondArg)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData({0})]\n\t\t\t\t\t[{{|#0:Xunit.InlineData({1})|}}]\n\t\t\t\t\tpublic void TestMethod(string x = null) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", firstArg, secondArg);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task Null_RawValuesVsExplicitArray_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1, null)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(new object[] { 1, null })|}]\n\t\t\t\t\tpublic void TestMethod(object x, object y) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"\", \"\")]\n\t\t[InlineData(\"\", \", default\")]\n\t\t[InlineData(\", default\", \"\")]\n\t\t[InlineData(\", default\", \", default\")]\n\t\tpublic async Task DefaultOfStruct_Triggers(\n\t\t\tstring firstDefaultOverride,\n\t\t\tstring secondDefaultOverride)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1{0})]\n\t\t\t\t\t[{{|#0:Xunit.InlineData(1{1})|}}]\n\t\t\t\t\tpublic void TestMethod(int x, System.DateTime date = default) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", firstDefaultOverride, secondDefaultOverride);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[InlineData(\"\", \"\")]\n\t\t[InlineData(\"\", \", null\")]\n\t\t[InlineData(\", null\", \"\")]\n\t\t[InlineData(\", null\", \", null\")]\n\t\tpublic async Task DefaultOfString_Triggers(\n\t\t\tstring firstDefaultOverride,\n\t\t\tstring secondDefaultOverride)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(1{0})]\n\t\t\t\t\t[{{|#0:Xunit.InlineData(1{1})|}}]\n\t\t\t\t\tpublic void TestMethod(int x, string y = null) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", firstDefaultOverride, secondDefaultOverride);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task Tripled_TriggersTwice()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(10)|}]\n\t\t\t\t\t[{|#1:Xunit.InlineData(10)|}]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\"),\n\t\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task DoubledTwice_TriggersTwice()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Theory]\n\t\t\t\t\t[Xunit.InlineData(10)]\n\t\t\t\t\t[Xunit.InlineData(20)]\n\t\t\t\t\t[{|#0:Xunit.InlineData(10)|}]\n\t\t\t\t\t[{|#1:Xunit.InlineData(20)|}]\n\t\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\"),\n\t\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/LocalFunctionsCannotBeTestFunctionsTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.LocalFunctionsCannotBeTestFunctions>;\n\npublic class LocalFunctionsCannotBeTestFunctionsTests\n{\n\t[Fact]\n\tpublic async Task NoTestAttribute_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void Method() {\n\t\t\t\t\tvoid LocalFunction() { }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\t[InlineData(\"InlineData(42)\")]\n\t[InlineData(\"MemberData(nameof(MyData))\")]\n\t[InlineData(\"ClassData(typeof(TestClass))\")]\n\tpublic async Task TestAttribute_Triggers(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void Method() {{\n\t\t\t\t\t[{{|#0:{0}|}}]\n\t\t\t\t\tvoid LocalFunction() {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic static IEnumerable<object[]> MyData;\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"[{attribute}]\");\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/MemberDataShouldReferenceValidMemberTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMemberTests\n{\n\tpublic class X1014_MemberDataShouldUseNameOfOperator\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> Data { get; set; }\n\n\t\t\t\t\t[MemberData(nameof(Data))]\n\t\t\t\t\t[MemberData(nameof(OtherClass.OtherData), MemberType = typeof(OtherClass))]\n\t\t\t\t\tpublic void TestMethod1(int _) { }\n\n\t\t\t\t\t[MemberData({|#0:\"Data\"|})]\n\t\t\t\t\t[MemberData({|#1:\"OtherData\"|}, MemberType = typeof(OtherClass))]\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class OtherClass {\n\t\t\t\t\tpublic static TheoryData<int> OtherData { get; set; }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1014\").WithLocation(0).WithArguments(\"Data\", \"TestClass\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1014\").WithLocation(1).WithArguments(\"OtherData\", \"OtherClass\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tpublic class X1015_MemberDataMustReferenceExistingMember\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[{|#0:MemberData(\"BogusName\")|}]\n\t\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t\t[{|#1:MemberData(\"BogusName\", MemberType = typeof(TestClass))|}]\n\t\t\t\t\tpublic void TestMethod2() { }\n\n\t\t\t\t\t[{|#2:MemberData(\"BogusName\", MemberType = typeof(OtherClass))|}]\n\t\t\t\t\tpublic void TestMethod3() { }\n\n\t\t\t\t\t[{|#3:MemberData(nameof(TestClass.TestMethod4), MemberType = typeof(OtherClass))|}]\n\t\t\t\t\tpublic void TestMethod4() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar source2 = /* lang=c#-test */ \"public class OtherClass { }\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1015\").WithLocation(0).WithArguments(\"BogusName\", \"TestClass\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1015\").WithLocation(1).WithArguments(\"BogusName\", \"TestClass\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1015\").WithLocation(2).WithArguments(\"BogusName\", \"OtherClass\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1015\").WithLocation(3).WithArguments(\"TestMethod4\", \"OtherClass\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer([source1, source2], expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask DoesNotTrigger_WhenMemberExistsOnDerivedType_AndBaseTypeIsAbstract()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic abstract class BaseClassWithTestWithoutData\n\t\t\t\t{\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(SubClassWithTestData.TestData))]\n\t\t\t\t\tpublic void Test(int x) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class SubClassWithTestData : BaseClassWithTestWithoutData\n\t\t\t\t{\n\t\t\t\t\tpublic static IEnumerable<object?[]> TestData()\n\t\t\t\t\t{\n\t\t\t\t\t\tyield return new object?[] { 42 };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source);\n\t\t}\n\t}\n\n\tpublic class X1016_MemberDataMustReferencePublicMember\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> PublicData = null;\n\n\t\t\t\t\t[MemberData(nameof(PublicData))]\n\t\t\t\t\tpublic void TestMethod1a(int _) { }\n\n\t\t\t\t\tconst string PrivateDataNameConst = \"PrivateData\";\n\t\t\t\t\tconst string PrivateDataNameofConst = nameof(PrivateData);\n\t\t\t\t\tprivate static TheoryData<int> PrivateData = null;\n\n\t\t\t\t\t[{|xUnit1016:MemberData(nameof(PrivateData))|}]\n\t\t\t\t\tpublic void TestMethod2a(int _) { }\n\n\t\t\t\t\t[{|xUnit1016:MemberData(PrivateDataNameConst)|}]\n\t\t\t\t\tpublic void TestMethod2b(int _) { }\n\n\t\t\t\t\t[{|xUnit1016:MemberData(PrivateDataNameofConst)|}]\n\t\t\t\t\tpublic void TestMethod2c(int _) { }\n\n\t\t\t\t\tinternal static TheoryData<int> InternalData = null;\n\n\t\t\t\t\t[{|xUnit1016:MemberData(nameof(InternalData))|}]\n\t\t\t\t\tpublic void TestMethod3(int _) { }\n\n\t\t\t\t\tprotected static TheoryData<int> ProtectedData = null;\n\n\t\t\t\t\t[{|xUnit1016:MemberData(nameof(ProtectedData))|}]\n\t\t\t\t\tpublic void TestMethod4(int _) { }\n\n\t\t\t\t\tprotected internal static TheoryData<int> ProtectedInternalData = null;\n\n\t\t\t\t\t[{|xUnit1016:MemberData(nameof(ProtectedInternalData))|}]\n\t\t\t\t\tpublic void TestMethod5(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1017_MemberDataMustReferenceStaticMember\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> StaticData = null;\n\t\t\t\t\tpublic TheoryData<int> NonStaticData = null;\n\n\t\t\t\t\t[MemberData(nameof(StaticData))]\n\t\t\t\t\t[{|xUnit1017:MemberData(nameof(NonStaticData))|}]\n\t\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1018_MemberDataMustReferenceValidMemberKind\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> FieldData;\n\t\t\t\t\tpublic static TheoryData<int> PropertyData { get; set; }\n\t\t\t\t\tpublic static TheoryData<int> MethodData() { return null; }\n\n\t\t\t\t\tpublic static class ClassData { }\n\t\t\t\t\tpublic delegate IEnumerable<object[]> DelegateData();\n\t\t\t\t\tpublic static event EventHandler EventData;\n\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\tpublic void TestMethod1(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\tpublic void TestMethod3(int _) { }\n\n\t\t\t\t\t[{|xUnit1018:MemberData(nameof(ClassData))|}]\n\t\t\t\t\tpublic void TestMethod4(int _) { }\n\n\t\t\t\t\t[{|xUnit1018:MemberData(nameof(DelegateData))|}]\n\t\t\t\t\tpublic void TestMethod5(int _) { }\n\n\t\t\t\t\t[{|xUnit1018:MemberData(nameof(EventData))|}]\n\t\t\t\t\tpublic void TestMethod6(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1019_MemberDataMustReferenceMemberOfValidType\n\t{\n\t\tconst string V2AllowedTypes = \"'System.Collections.Generic.IEnumerable<object[]>'\";\n\t\tconst string V3AllowedTypes = \"'System.Collections.Generic.IEnumerable<object[]>', 'System.Collections.Generic.IAsyncEnumerable<object[]>', 'System.Collections.Generic.IEnumerable<Xunit.ITheoryDataRow>', 'System.Collections.Generic.IAsyncEnumerable<Xunit.ITheoryDataRow>', 'System.Collections.Generic.IEnumerable<System.Runtime.CompilerServices.ITuple>', or 'System.Collections.Generic.IAsyncEnumerable<System.Runtime.CompilerServices.ITuple>'\";\n\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1042\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class NamedTypeForIEnumerableStringArray : IEnumerable<string[]>\n\t\t\t\t{\n\t\t\t\t    private readonly List<string[]> _items = new List<string[]>();\n\n\t\t\t\t    public void Add(string sdl)\n\t\t\t\t    {\n\t\t\t\t        _items.Add(new string[] { sdl });\n\t\t\t\t    }\n\n\t\t\t\t    public IEnumerator<string[]> GetEnumerator()\n\t\t\t\t    {\n\t\t\t\t        return _items.GetEnumerator();\n\t\t\t\t    }\n\n\t\t\t\t    IEnumerator IEnumerable.GetEnumerator()\n\t\t\t\t    {\n\t\t\t\t        return GetEnumerator();\n\t\t\t\t    }\n\t\t\t\t}\n\n\t\t\t\tpublic class NamedSubtypeForIEnumerableStringArray : NamedTypeForIEnumerableStringArray {}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static IEnumerable<object> ObjectSource;\n\t\t\t\t\tpublic static object NakedObjectSource;\n\t\t\t\t\tpublic static object[] NakedObjectArraySource;\n\t\t\t\t\tpublic static object[][] NakedObjectMatrixSource;\n\n\t\t\t\t\tpublic static IEnumerable<object[]> ObjectArraySource;\n\t\t\t\t\tpublic static IEnumerable<string[]> StringArraySource;\n\t\t\t\t\tpublic static NamedTypeForIEnumerableStringArray NamedTypeForIEnumerableStringArraySource;\n\t\t\t\t\tpublic static NamedSubtypeForIEnumerableStringArray NamedSubtypeForIEnumerableStringArraySource;\n\n\t\t\t\t\tpublic static Task<IEnumerable<object[]>> TaskObjectArraySource;\n\t\t\t\t\tpublic static ValueTask<IEnumerable<object[]>> ValueTaskObjectArraySource;\n\n\t\t\t\t\tpublic static IAsyncEnumerable<object[]> AsyncObjectArraySource;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<object[]>> TaskAsyncObjectArraySource;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<object[]>> ValueTaskAsyncObjectArraySource;\n\n\t\t\t\t\tpublic static TheoryData<string, int> TheoryDataSource;\n\t\t\t\t\tpublic static Task<TheoryData<string, int>> TaskTheoryDataSource;\n\t\t\t\t\tpublic static ValueTask<TheoryData<string, int>> ValueTaskTheoryDataSource;\n\n\t\t\t\t\tpublic static IEnumerable<(string, int)> UntypedTupleSource;\n\t\t\t\t\tpublic static Task<IEnumerable<(string, int)>> TaskUntypedTupleSource;\n\t\t\t\t\tpublic static ValueTask<IEnumerable<(string, int)>> ValueTaskUntypedTupleSource;\n\n\t\t\t\t\tpublic static IAsyncEnumerable<(string, int)> AsyncUntypedTupleSource;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<(string, int)>> TaskAsyncUntypedTupleSource;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<(string, int)>> ValueTaskAsyncUntypedTupleSource;\n\n\t\t\t\t\tpublic static IEnumerable<Tuple<string, int>> TypedTupleSource;\n\t\t\t\t\tpublic static Task<IEnumerable<Tuple<string, int>>> TaskTypedTupleSource;\n\t\t\t\t\tpublic static ValueTask<IEnumerable<Tuple<string, int>>> ValueTaskTypedTupleSource;\n\n\t\t\t\t\tpublic static IAsyncEnumerable<Tuple<string, int>> AsyncTypedTupleSource;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<Tuple<string, int>>> TaskAsyncTypedTupleSource;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<Tuple<string, int>>> ValueTaskAsyncTypedTupleSource;\n\n\t\t\t\t\t[{|#0:MemberData(nameof(ObjectSource))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(NakedObjectSource))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(NakedObjectArraySource))|}]\n\t\t\t\t\t[MemberData(nameof(NakedObjectMatrixSource))]\n\n\t\t\t\t\t[MemberData(nameof(ObjectArraySource))]\n\t\t\t\t\t[MemberData(nameof(StringArraySource))]\n\t\t\t\t\t[MemberData(nameof(NamedTypeForIEnumerableStringArraySource))]\n\t\t\t\t\t[MemberData(nameof(NamedSubtypeForIEnumerableStringArraySource))]\n\n\t\t\t\t\t[{|#10:MemberData(nameof(TaskObjectArraySource))|}]\n\t\t\t\t\t[{|#11:MemberData(nameof(ValueTaskObjectArraySource))|}]\n\n\t\t\t\t\t[{|#20:MemberData(nameof(AsyncObjectArraySource))|}]\n\t\t\t\t\t[{|#21:MemberData(nameof(TaskAsyncObjectArraySource))|}]\n\t\t\t\t\t[{|#22:MemberData(nameof(ValueTaskAsyncObjectArraySource))|}]\n\n\t\t\t\t\t[MemberData(nameof(TheoryDataSource))]\n\t\t\t\t\t[{|#30:MemberData(nameof(TaskTheoryDataSource))|}]\n\t\t\t\t\t[{|#31:MemberData(nameof(ValueTaskTheoryDataSource))|}]\n\n\t\t\t\t\t[{|#40:MemberData(nameof(UntypedTupleSource))|}]\n\t\t\t\t\t[{|#41:MemberData(nameof(TaskUntypedTupleSource))|}]\n\t\t\t\t\t[{|#42:MemberData(nameof(ValueTaskUntypedTupleSource))|}]\n\n\t\t\t\t\t[{|#50:MemberData(nameof(AsyncUntypedTupleSource))|}]\n\t\t\t\t\t[{|#51:MemberData(nameof(TaskAsyncUntypedTupleSource))|}]\n\t\t\t\t\t[{|#52:MemberData(nameof(ValueTaskAsyncUntypedTupleSource))|}]\n\n\t\t\t\t\t[{|#60:MemberData(nameof(TypedTupleSource))|}]\n\t\t\t\t\t[{|#61:MemberData(nameof(TaskTypedTupleSource))|}]\n\t\t\t\t\t[{|#62:MemberData(nameof(ValueTaskTypedTupleSource))|}]\n\n\t\t\t\t\t[{|#70:MemberData(nameof(AsyncTypedTupleSource))|}]\n\t\t\t\t\t[{|#71:MemberData(nameof(TaskAsyncTypedTupleSource))|}]\n\t\t\t\t\t[{|#72:MemberData(nameof(ValueTaskAsyncTypedTupleSource))|}]\n\n\t\t\t\t\tpublic void TestMethod(string _1, int _2) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV2 = new[] {\n\t\t\t\t// Generally invalid types\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(0).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IEnumerable<object>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(1).WithArguments(V2AllowedTypes, $\"object\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(2).WithArguments(V2AllowedTypes, $\"object[]\"),\n\n\t\t\t\t// v2 does not support tuples, wrapping in Task/ValueTask, and does not support IAsyncEnumerable\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(10).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<object[]>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(11).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IEnumerable<object[]>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(20).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IAsyncEnumerable<object[]>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(21).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IAsyncEnumerable<object[]>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(22).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IAsyncEnumerable<object[]>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(30).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<Xunit.TheoryData<string, int>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(31).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<Xunit.TheoryData<string, int>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(40).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IEnumerable<(string, int)>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(41).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<(string, int)>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(42).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IEnumerable<(string, int)>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(50).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IAsyncEnumerable<(string, int)>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(51).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IAsyncEnumerable<(string, int)>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(52).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IAsyncEnumerable<(string, int)>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(60).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IEnumerable<System.Tuple<string, int>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(61).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.Tuple<string, int>>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(62).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IEnumerable<System.Tuple<string, int>>>\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(70).WithArguments(V2AllowedTypes, $\"System.Collections.Generic.IAsyncEnumerable<System.Tuple<string, int>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(71).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.Task<System.Collections.Generic.IAsyncEnumerable<System.Tuple<string, int>>>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(72).WithArguments(V2AllowedTypes, $\"System.Threading.Tasks.ValueTask<System.Collections.Generic.IAsyncEnumerable<System.Tuple<string, int>>>\"),\n\t\t\t};\n\t\t\tvar expectedV3 = new[] {\n\t\t\t\t// Generally invalid types\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(0).WithArguments(V3AllowedTypes, $\"System.Collections.Generic.IEnumerable<object>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(1).WithArguments(V3AllowedTypes, $\"object\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1019\").WithLocation(2).WithArguments(V3AllowedTypes, $\"object[]\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp9, source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source, expectedV3);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1042\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static List<ITheoryDataRow> ITheoryDataRowSource;\n\t\t\t\t\tpublic static Task<List<ITheoryDataRow>> TaskITheoryDataRowSource;\n\t\t\t\t\tpublic static ValueTask<List<ITheoryDataRow>> ValueTaskITheoryDataRowSource;\n\n\t\t\t\t\tpublic static List<TheoryDataRow<int, string>> TheoryDataRowSource;\n\t\t\t\t\tpublic static Task<List<TheoryDataRow<int, string>>> TaskTheoryDataRowSource;\n\t\t\t\t\tpublic static ValueTask<List<TheoryDataRow<int, string>>> ValueTaskTheoryDataRowSource;\n\n\t\t\t\t\tpublic static IAsyncEnumerable<ITheoryDataRow> AsyncITheoryDataRowSource;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<ITheoryDataRow>> TaskAsyncITheoryDataRowSource;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<ITheoryDataRow>> ValueTaskAsyncITheoryDataRowSource;\n\n\t\t\t\t\tpublic static IAsyncEnumerable<TheoryDataRow<int, string>> AsyncTheoryDataRowSource;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<TheoryDataRow<int, string>>> TaskAsyncTheoryDataRowSource;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<TheoryDataRow<int, string>>> ValueTaskAsyncTheoryDataRowSource;\n\n\t\t\t\t\t[MemberData(nameof(ITheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(TaskITheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(ValueTaskITheoryDataRowSource))]\n\n\t\t\t\t\t[MemberData(nameof(TheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(TaskTheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(ValueTaskTheoryDataRowSource))]\n\n\t\t\t\t\t[MemberData(nameof(AsyncITheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(TaskAsyncITheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(ValueTaskAsyncITheoryDataRowSource))]\n\n\t\t\t\t\t[MemberData(nameof(AsyncTheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(TaskAsyncTheoryDataRowSource))]\n\t\t\t\t\t[MemberData(nameof(ValueTaskAsyncTheoryDataRowSource))]\n\n\t\t\t\t\tpublic void TestMethod(int _1, string _2) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\t}\n\n\tpublic class X1020_MemberDataPropertyMustHaveGetter\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> PublicWithGetter => new();\n\t\t\t\t\tpublic static TheoryData<int> PublicWithoutGetter { set { } }\n\t\t\t\t\tpublic static TheoryData<int> ProtectedGetter { protected get { return null; } set { } }\n\t\t\t\t\tpublic static TheoryData<int> InternalGetter { internal get { return null; } set { } }\n\t\t\t\t\tpublic static TheoryData<int> PrivateGetter { private get { return null; } set { } }\n\n\t\t\t\t\t[MemberData(nameof(PublicWithGetter))]\n\t\t\t\t\t[{|xUnit1020:MemberData(nameof(PublicWithoutGetter))|}]\n\t\t\t\t\t[{|xUnit1020:MemberData(nameof(ProtectedGetter))|}]\n\t\t\t\t\t[{|xUnit1020:MemberData(nameof(InternalGetter))|}]\n\t\t\t\t\t[{|xUnit1020:MemberData(nameof(PrivateGetter))|}]\n\t\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source);\n\t\t}\n\t}\n\n\tpublic class X1021_MemberDataNonMethodShouldNotHaveParameters\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClassBase {\n\t\t\t\t\tpublic static TheoryData<int> BaseTestData(int n) => new TheoryData<int> { n };\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass : TestClassBase {\n\t\t\t\t\tprivate static void TestData() { }\n\n\t\t\t\t\tpublic static TheoryData<int> SingleData(int n) => new TheoryData<int> { n };\n\n\t\t\t\t\t[MemberData(nameof(SingleData), 1)]\n\t\t\t\t\t[MemberData(nameof(SingleData), new object[] { 1 })]\n\t\t\t\t\tpublic void TestMethod1(int n) { }\n\n\t\t\t\t\tpublic static TheoryData<int> ParamsData(params int[] n) => new TheoryData<int> { n[0] };\n\n\t\t\t\t\t[MemberData(nameof(ParamsData), 1, 2)]\n\t\t\t\t\t[MemberData(nameof(ParamsData), new object[] { 1, 2 })]\n\t\t\t\t\tpublic void TestMethod2(int n) { }\n\n\t\t\t\t\t[MemberData(nameof(BaseTestData), 1)]\n\t\t\t\t\t[MemberData(nameof(BaseTestData), new object[] { 1 })]\n\t\t\t\t\tpublic void TestMethod3(int n) { }\n\n\t\t\t\t\tpublic static TheoryData<int> FieldData;\n\n\t\t\t\t\t[MemberData(nameof(FieldData), {|xUnit1021:'a', 123|})]\n\t\t\t\t\tpublic void TestMethod4a(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(FieldData), {|xUnit1021:new object[] { 'a', 123 }|})]\n\t\t\t\t\tpublic void TestMethod4b(int _) { }\n\n\t\t\t\t\tpublic static TheoryData<int> PropertyData { get; set; }\n\n\t\t\t\t\t[MemberData(nameof(PropertyData), {|xUnit1021:'a', 123|})]\n\t\t\t\t\tpublic void TestMethod5a(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(PropertyData), {|xUnit1021:new object[] { 'a', 123 }|})]\n\t\t\t\t\tpublic void TestMethod5b(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\t}\n\n\tpublic class X1034_MemberDataArgumentsMustMatchMethodParameters_NullShouldNotBeUsedForIncompatibleParameter\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<string?> NullableReferenceData(string? s) => new TheoryData<string?> { s };\n\n\t\t\t\t\t[MemberData(nameof(NullableReferenceData), default(string))]\n\t\t\t\t\tpublic void TestMethod1(string? _) { }\n\n\t\t\t\t\tpublic static TheoryData<string> NonNullableReferenceData(string s) => new TheoryData<string> { s };\n\n\t\t\t\t\t[MemberData(nameof(NonNullableReferenceData), {|#0:default(string)|})]\n\t\t\t\t\tpublic void TestMethod(string _) { }\n\n\t\t\t\t#nullable disable\n\t\t\t\t\tpublic static TheoryData<string> MaybeNullableReferenceData(string s) => new TheoryData<string> { s };\n\t\t\t\t#nullable enable\n\n\t\t\t\t\t[MemberData(nameof(MaybeNullableReferenceData), default(string))]\n\t\t\t\t\tpublic void TestMethod3(string? _) { }\n\n\t\t\t\t\tpublic static TheoryData<int?> NullableStructData(int? n) => new TheoryData<int?> { n };\n\n\t\t\t\t\t[MemberData(nameof(NullableStructData), new object[] { null })]\n\t\t\t\t\tpublic void TestMethod4(int? _) { }\n\n\t\t\t\t\tpublic static TheoryData<int> NonNullableStructData(int n) => new TheoryData<int> { n };\n\n\t\t\t\t\t[MemberData(nameof(NonNullableStructData), new object[] { {|#1:null|} })]\n\t\t\t\t\tpublic void TestMethod5(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1034\").WithLocation(0).WithArguments(\"s\", \"string\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1034\").WithLocation(1).WithArguments(\"n\", \"int\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1035_MemberDataArgumentsMustMatchMethodParameters_IncompatibleValueType\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic enum Foo { Bar }\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> StringData(string s) => new TheoryData<int> { s.Length };\n\n\t\t\t\t\t[MemberData(nameof(StringData), {|#0:1|})]\n\t\t\t\t\tpublic void TestMethod1(int _) { }\n\n\t\t\t\t\tpublic static TheoryData<int> ParamsIntData(params int[] n) => new TheoryData<int> { n[0] };\n\n\t\t\t\t\t[MemberData(nameof(ParamsIntData), {|#1:\"bob\"|})]\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\n\t\t\t\t\t// https://github.com/xunit/xunit/issues/2817\n\t\t\t\t\tpublic static TheoryData<int> EnumData(Foo foo) => new TheoryData<int> { (int)foo };\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(EnumData), Foo.Bar)]\n\t\t\t\t\t[MemberData(nameof(EnumData), (Foo)42)]\n\t\t\t\t\tpublic void TestMethod3(int _) { }\n\n\t\t\t\t\t// https://github.com/xunit/xunit/issues/2852\n\t\t\t\t\tpublic static TheoryData<int> IntegerSequenceData(IEnumerable<int> seq) => new TheoryData<int> { 42, 2112 };\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(IntegerSequenceData), new int[] { 1, 2 })]\n\t\t\t\t\t[MemberData(nameof(IntegerSequenceData), {|#2:new char[] { 'a', 'b' }|})]\n\t\t\t\t\tpublic void TestMethod4(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1035\").WithLocation(0).WithArguments(\"s\", \"string\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1035\").WithLocation(1).WithArguments(\"n\", \"int\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1035\").WithLocation(2).WithArguments(\"seq\", \"System.Collections.Generic.IEnumerable<int>\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tpublic class X1036_MemberDataArgumentsMustMatchMethodParameters_ExtraValue\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> TestData(int n) => new TheoryData<int> { n };\n\n\t\t\t\t\t[MemberData(nameof(TestData), 1)]\n\t\t\t\t\tpublic void TestMethod1(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(TestData), new object[] { 1 })]\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(TestData), 1, {|#0:2|})]\n\t\t\t\t\tpublic void TestMethod3(int _) { }\n\n\t\t\t\t\t[MemberData(nameof(TestData), new object[] { 1, {|#1:2|} })]\n\t\t\t\t\tpublic void TestMethod4(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1036\").WithLocation(0).WithArguments(\"2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1036\").WithLocation(1).WithArguments(\"2\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tpublic class X1037_TheoryDataTypeArgumentsMustMatchTestMethodParameters_TooFewTypeParameters\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DerivedTheoryData<T, U> : TheoryData<T> { }\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> FieldData = new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> PropertyData => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodData() => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodDataWithArgs(int n) => new TheoryData<int>();\n\n\t\t\t\t\t[{|#0:MemberData(nameof(FieldData))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(PropertyData))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(MethodData))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(MethodDataWithArgs), 42)|}]\n\t\t\t\t\tpublic void TestMethod1(int n, string f) { }\n\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> DerivedFieldData = new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> DerivedPropertyData => new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> DerivedMethodData() => new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> DerivedMethodDataWithArgs(int n) => new DerivedTheoryData<int, string>();\n\n\t\t\t\t\t[{|#10:MemberData(nameof(DerivedFieldData))|}]\n\t\t\t\t\t[{|#11:MemberData(nameof(DerivedPropertyData))|}]\n\t\t\t\t\t[{|#12:MemberData(nameof(DerivedMethodData))|}]\n\t\t\t\t\t[{|#13:MemberData(nameof(DerivedMethodDataWithArgs), 42)|}]\n\t\t\t\t\tpublic void TestMethod3(int n, string f) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(0).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(1).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(2).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(3).WithArguments(\"Xunit.TheoryData\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(10).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(11).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(12).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(13).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> NullFieldData = null;\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> NullPropertyData => null;\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> NullMethodData() => null;\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> NullMethodDataWithArgs(int n) => null;\n\n\t\t\t\t\t[{|#0:MemberData(nameof(NullFieldData))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(NullPropertyData))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(NullMethodData))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(NullMethodDataWithArgs), 42)|}]\n\t\t\t\t\tpublic void TestMethod2(int n, string f) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(0).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(1).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(2).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1037\").WithLocation(3).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(source, expected);\n\t\t}\n\t}\n\n\tpublic class X1038_TheoryDataTypeArgumentsMustMatchTestMethodParameters_ExtraTypeParameters\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class DerivedTheoryData : TheoryData<int> { }\n\t\t\t\tpublic class DerivedTheoryData<T> : TheoryData<T> { }\n\t\t\t\tpublic class DerivedTheoryData<T, U> : TheoryData<T> { }\n\n\t\t\t\tpublic class DerivedTheoryData2 : TheoryData<int, int> { }\n\t\t\t\tpublic class DerivedTheoryData2<T1, T2> : TheoryData<T1, T2> { }\n\n\t\t\t\tpublic class DerivedTheoryData3 : TheoryData<int, string[], string> { }\n\t\t\t\tpublic class DerivedTheoryData3<T1, T2, T3> : TheoryData<T1, T2, T3> { }\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t// ===== Direct TheoryData<> usage =====\n\n\t\t\t\t\tpublic static TheoryData<int> FieldTheoryData = new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> PropertyTheoryData => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodTheoryData() => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodWithArgsTheoryData(int _) => new TheoryData<int>();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod1a(int _) { }\n\n\t\t\t\t\t// Optional paramter, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod1b(int _1, int _2 = 0) { }\n\n\t\t\t\t\t// Params array, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod1c(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Generic match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod1d<T>(T _) { }\n\n\t\t\t\t\t// Generic nullable match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod1e<T>(T? _) { }\n\n\t\t\t\t\tpublic static TheoryData<int, int> FieldTheoryData2 = new TheoryData<int, int>();\n\t\t\t\t\tpublic static TheoryData<int, int> PropertyTheoryData2 => new TheoryData<int, int>();\n\t\t\t\t\tpublic static TheoryData<int, int> MethodTheoryData2() => new TheoryData<int, int>();\n\t\t\t\t\tpublic static TheoryData<int, int> MethodWithArgsTheoryData2(int _) => new TheoryData<int, int>();\n\n\t\t\t\t\t// Params array, single non-array argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryData2), 42)]\n\t\t\t\t\tpublic void TestMethod1f(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Too many arguments\n\t\t\t\t\t[{|#0:MemberData(nameof(FieldTheoryData2))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(PropertyTheoryData2))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(MethodTheoryData2))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(MethodWithArgsTheoryData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod1g(int _) { }\n\n\t\t\t\t\tpublic static TheoryData<int, string[], string> FieldTheoryData3 = new TheoryData<int, string[], string>();\n\t\t\t\t\tpublic static TheoryData<int, string[], string> PropertyTheoryData3 => new TheoryData<int, string[], string>();\n\t\t\t\t\tpublic static TheoryData<int, string[], string> MethodTheoryData3() => new TheoryData<int, string[], string>();\n\t\t\t\t\tpublic static TheoryData<int, string[], string> MethodWithArgsTheoryData3(int _) => new TheoryData<int, string[], string>();\n\n\t\t\t\t\t// Extra parameter type on data source\n\t\t\t\t\t[{|#4:MemberData(nameof(FieldTheoryData3))|}]\n\t\t\t\t\t[{|#5:MemberData(nameof(PropertyTheoryData3))|}]\n\t\t\t\t\t[{|#6:MemberData(nameof(MethodTheoryData3))|}]\n\t\t\t\t\t[{|#7:MemberData(nameof(MethodWithArgsTheoryData3), 42)|}]\n\t\t\t\t\tpublic void TestMethod1h(int _1, params string[] _2) { }\n\n\t\t\t\t\t// ===== Indirect TheoryData<> without generics =====\n\n\t\t\t\t\tpublic static DerivedTheoryData FieldDerivedTheoryData = new DerivedTheoryData();\n\t\t\t\t\tpublic static DerivedTheoryData PropertyDerivedTheoryData => new DerivedTheoryData();\n\t\t\t\t\tpublic static DerivedTheoryData MethodDerivedTheoryData() => new DerivedTheoryData();\n\t\t\t\t\tpublic static DerivedTheoryData MethodWithArgsDerivedTheoryData(int _) => new DerivedTheoryData();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod2a(int _) { }\n\n\t\t\t\t\t// Optional paramter, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod2b(int _1, int _2 = 0) { }\n\n\t\t\t\t\t// Params array, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod2c(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Generic match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod2d<T>(T _) { }\n\n\t\t\t\t\t// Generic nullable match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod2e<T>(T? _) { }\n\n\t\t\t\t\tpublic static DerivedTheoryData2 FieldDerivedTheoryData2 = new DerivedTheoryData2();\n\t\t\t\t\tpublic static DerivedTheoryData2 PropertyDerivedTheoryData2 => new DerivedTheoryData2();\n\t\t\t\t\tpublic static DerivedTheoryData2 MethodDerivedTheoryData2() => new DerivedTheoryData2();\n\t\t\t\t\tpublic static DerivedTheoryData2 MethodWithArgsDerivedTheoryData2(int _) => new DerivedTheoryData2();\n\n\t\t\t\t\t// Params array, single non-array argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedTheoryData2), 42)]\n\t\t\t\t\tpublic void TestMethod2f(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Too many arguments\n\t\t\t\t\t[{|#10:MemberData(nameof(FieldDerivedTheoryData2))|}]\n\t\t\t\t\t[{|#11:MemberData(nameof(PropertyDerivedTheoryData2))|}]\n\t\t\t\t\t[{|#12:MemberData(nameof(MethodDerivedTheoryData2))|}]\n\t\t\t\t\t[{|#13:MemberData(nameof(MethodWithArgsDerivedTheoryData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod2g(int _) { }\n\n\t\t\t\t\tpublic static DerivedTheoryData3 FieldDerivedTheoryData3 = new DerivedTheoryData3();\n\t\t\t\t\tpublic static DerivedTheoryData3 PropertyDerivedTheoryData3 => new DerivedTheoryData3();\n\t\t\t\t\tpublic static DerivedTheoryData3 MethodDerivedTheoryData3() => new DerivedTheoryData3();\n\t\t\t\t\tpublic static DerivedTheoryData3 MethodWithArgsDerivedTheoryData3(int _) => new DerivedTheoryData3();\n\n\t\t\t\t\t// Extra parameter type on data source\n\t\t\t\t\t[{|#14:MemberData(nameof(FieldDerivedTheoryData3))|}]\n\t\t\t\t\t[{|#15:MemberData(nameof(PropertyDerivedTheoryData3))|}]\n\t\t\t\t\t[{|#16:MemberData(nameof(MethodDerivedTheoryData3))|}]\n\t\t\t\t\t[{|#17:MemberData(nameof(MethodWithArgsDerivedTheoryData3), 42)|}]\n\t\t\t\t\tpublic void TestMethod2h(int _1, params string[] _2) { }\n\n\t\t\t\t\t// ===== Indirect TheoryData<> with generics =====\n\n\t\t\t\t\tpublic static DerivedTheoryData<int> FieldDerivedGenericTheoryData = new DerivedTheoryData<int>();\n\t\t\t\t\tpublic static DerivedTheoryData<int> PropertyDerivedGenericTheoryData => new DerivedTheoryData<int>();\n\t\t\t\t\tpublic static DerivedTheoryData<int> MethodDerivedGenericTheoryData() => new DerivedTheoryData<int>();\n\t\t\t\t\tpublic static DerivedTheoryData<int> MethodWithArgsDerivedGenericTheoryData(int _) => new DerivedTheoryData<int>();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod3a(int _) { }\n\n\t\t\t\t\t// Optional paramter, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod3b(int _1, int _2 = 0) { }\n\n\t\t\t\t\t// Params array, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod3c(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Generic match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod3d<T>(T _) { }\n\n\t\t\t\t\t// Generic nullable match\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData), 42)]\n\t\t\t\t\tpublic void TestMethod3e<T>(T? _) { }\n\n\t\t\t\t\tpublic static DerivedTheoryData2<int, int> FieldDerivedGenericTheoryData2 = new DerivedTheoryData2<int, int>();\n\t\t\t\t\tpublic static DerivedTheoryData2<int, int> PropertyDerivedGenericTheoryData2 => new DerivedTheoryData2<int, int>();\n\t\t\t\t\tpublic static DerivedTheoryData2<int, int> MethodDerivedGenericTheoryData2() => new DerivedTheoryData2<int, int>();\n\t\t\t\t\tpublic static DerivedTheoryData2<int, int> MethodWithArgsDerivedGenericTheoryData2(int _) => new DerivedTheoryData2<int, int>();\n\n\t\t\t\t\t// Params array, single non-array argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldDerivedGenericTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(PropertyDerivedGenericTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodDerivedGenericTheoryData2))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDerivedGenericTheoryData2), 42)]\n\t\t\t\t\tpublic void TestMethod3f(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Too many arguments\n\t\t\t\t\t[{|#20:MemberData(nameof(FieldDerivedGenericTheoryData2))|}]\n\t\t\t\t\t[{|#21:MemberData(nameof(PropertyDerivedGenericTheoryData2))|}]\n\t\t\t\t\t[{|#22:MemberData(nameof(MethodDerivedGenericTheoryData2))|}]\n\t\t\t\t\t[{|#23:MemberData(nameof(MethodWithArgsDerivedGenericTheoryData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod3g(int _) { }\n\n\t\t\t\t\tpublic static DerivedTheoryData3<int, string[], string> FieldDerivedGenericTheoryData3 = new DerivedTheoryData3<int, string[], string>();\n\t\t\t\t\tpublic static DerivedTheoryData3<int, string[], string> PropertyDerivedGenericTheoryData3 => new DerivedTheoryData3<int, string[], string>();\n\t\t\t\t\tpublic static DerivedTheoryData3<int, string[], string> MethodDerivedGenericTheoryData3() => new DerivedTheoryData3<int, string[], string>();\n\t\t\t\t\tpublic static DerivedTheoryData3<int, string[], string> MethodWithArgsDerivedGenericTheoryData3(int _) => new DerivedTheoryData3<int, string[], string>();\n\n\t\t\t\t\t// Extra parameter type on data source\n\t\t\t\t\t[{|#24:MemberData(nameof(FieldDerivedGenericTheoryData3))|}]\n\t\t\t\t\t[{|#25:MemberData(nameof(PropertyDerivedGenericTheoryData3))|}]\n\t\t\t\t\t[{|#26:MemberData(nameof(MethodDerivedGenericTheoryData3))|}]\n\t\t\t\t\t[{|#27:MemberData(nameof(MethodWithArgsDerivedGenericTheoryData3), 42)|}]\n\t\t\t\t\tpublic void TestMethod3h(int _1, params string[] _2) { }\n\n\t\t\t\t\t// ===== Indirect TheoryData<> with generic type reduction =====\n\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> FieldTheoryDataTypeReduced = new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> PropertyTheoryDataTypeReduced => new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> MethodTheoryDataTypeReduced() => new DerivedTheoryData<int, string>();\n\t\t\t\t\tpublic static DerivedTheoryData<int, string> MethodWithArgsTheoryDataTypeReduced(int _) => new DerivedTheoryData<int, string>();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryDataTypeReduced), 42)]\n\t\t\t\t\tpublic void TestMethod4a(int _) { }\n\n\t\t\t\t\t// Generic match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryDataTypeReduced), 42)]\n\t\t\t\t\tpublic void TestMethod4d<T>(T _) { }\n\n\t\t\t\t\t// Generic nullable match\n\t\t\t\t\t[MemberData(nameof(FieldTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(PropertyTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodTheoryDataTypeReduced))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsTheoryDataTypeReduced), 42)]\n\t\t\t\t\tpublic void TestMethod4e<T>(T? _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(0).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(1).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(2).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(3).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(4).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(5).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(6).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(7).WithArguments(\"Xunit.TheoryData\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(10).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(11).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(12).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(13).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(14).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(15).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(16).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(17).WithArguments(\"Xunit.TheoryData\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(20).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(21).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(22).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(23).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(24).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(25).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(26).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(27).WithArguments(\"Xunit.TheoryData\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp9, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryDataRow<int>[] FieldData = new TheoryDataRow<int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int>[] PropertyData => new TheoryDataRow<int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int>[] MethodData() => new TheoryDataRow<int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int>[] MethodWithArgsData(int _) => new TheoryDataRow<int>[0];\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1a(int _) { }\n\n\t\t\t\t\t// Optional paramter, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1b(int _1, int _2 = 0) { }\n\n\t\t\t\t\t// Params array, no argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1c(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Generic match\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1d<T>(T _) { }\n\n\t\t\t\t\t// Generic nullable match\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1e<T>(T? _) { }\n\n\t\t\t\t\tpublic static TheoryDataRow<int, int>[] FieldData2 = new TheoryDataRow<int, int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, int>[] PropertyData2 => new TheoryDataRow<int, int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, int>[] MethodData2() => new TheoryDataRow<int, int>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, int>[] MethodWithArgsData2(int _) => new TheoryDataRow<int, int>[0];\n\n\t\t\t\t\t// Params array, single non-array argument from data source\n\t\t\t\t\t[MemberData(nameof(FieldData2))]\n\t\t\t\t\t[MemberData(nameof(PropertyData2))]\n\t\t\t\t\t[MemberData(nameof(MethodData2))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData2), 42)]\n\t\t\t\t\tpublic void TestMethod1f(int _1, params int[] _2) { }\n\n\t\t\t\t\t// Too many arguments\n\t\t\t\t\t[{|#0:MemberData(nameof(FieldData2))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(PropertyData2))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(MethodData2))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(MethodWithArgsData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod1g(int _) { }\n\n\t\t\t\t\tpublic static TheoryDataRow<int, string[], string>[] FieldData3 = new TheoryDataRow<int, string[], string>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, string[], string>[] PropertyData3 => new TheoryDataRow<int, string[], string>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, string[], string>[] MethodData3() => new TheoryDataRow<int, string[], string>[0];\n\t\t\t\t\tpublic static TheoryDataRow<int, string[], string>[] MethodWithArgsData3(int _) => new TheoryDataRow<int, string[], string>[0];\n\n\t\t\t\t\t// Extra parameter type on data source\n\t\t\t\t\t[{|#4:MemberData(nameof(FieldData3))|}]\n\t\t\t\t\t[{|#5:MemberData(nameof(PropertyData3))|}]\n\t\t\t\t\t[{|#6:MemberData(nameof(MethodData3))|}]\n\t\t\t\t\t[{|#7:MemberData(nameof(MethodWithArgsData3), 42)|}]\n\t\t\t\t\tpublic void TestMethod1h(int _1, params string[] _2) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(0).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(1).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(2).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(3).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(4).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(5).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(6).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1038\").WithLocation(7).WithArguments(\"Xunit.TheoryDataRow\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1039_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleTypes\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int, string[]> FieldData = new TheoryData<int, string[]>();\n\t\t\t\t\tpublic static TheoryData<int, string[]> PropertyData => new TheoryData<int, string[]>();\n\t\t\t\t\tpublic static TheoryData<int, string[]> MethodData() => new TheoryData<int, string[]>();\n\t\t\t\t\tpublic static TheoryData<int, string[]> MethodWithArgsData(int _) => new TheoryData<int, string[]>();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1(int _1, params string[] _2) { }\n\n\t\t\t\t\tpublic static TheoryData<int, string, string> FieldDataCollapse = new TheoryData<int, string, string>();\n\t\t\t\t\tpublic static TheoryData<int, string, string> PropertyDataCollapse => new TheoryData<int, string, string>();\n\t\t\t\t\tpublic static TheoryData<int, string, string> MethodDataCollapse() => new TheoryData<int, string, string>();\n\t\t\t\t\tpublic static TheoryData<int, string, string> MethodWithArgsDataCollapse(int _) => new TheoryData<int, string, string>();\n\n\t\t\t\t\t// Multiple values can be collapsed into the params array\n\t\t\t\t\t[MemberData(nameof(FieldDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(PropertyDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(MethodDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDataCollapse), 42)]\n\t\t\t\t\tpublic void TestMethod2(int _1, params string[] _2) { }\n\n\t\t\t\t\tpublic static TheoryData<(int, int)> FieldNamelessTupleData = new TheoryData<(int, int)>();\n\t\t\t\t\tpublic static TheoryData<(int, int)> PropertyNamelessTupleData => new TheoryData<(int, int)>();\n\t\t\t\t\tpublic static TheoryData<(int, int)> MethodNamelessTupleData() => new TheoryData<(int, int)>();\n\t\t\t\t\tpublic static TheoryData<(int, int)> MethodWithArgsNamelessTupleData(int _) => new TheoryData<(int, int)>();\n\n\t\t\t\t\t// Nameless anonymous tuples\n\t\t\t\t\t[MemberData(nameof(FieldNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsNamelessTupleData), 42)]\n\t\t\t\t\tpublic void TestMethod3((int a, int b) _) { }\n\n\t\t\t\t\tpublic static TheoryData<(int x, int y)> FieldNamedTupleData = new TheoryData<(int x, int y)>();\n\t\t\t\t\tpublic static TheoryData<(int x, int y)> PropertyNamedTupleData => new TheoryData<(int x, int y)>();\n\t\t\t\t\tpublic static TheoryData<(int x, int y)> MethodNamedTupleData() => new TheoryData<(int x, int y)>();\n\t\t\t\t\tpublic static TheoryData<(int x, int y)> MethodWithArgsNamedTupleData(int _) => new TheoryData<(int x, int y)>();\n\n\t\t\t\t\t// Named anonymous tuples (names don't need to match, just the shape)\n\t\t\t\t\t[MemberData(nameof(FieldNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsNamedTupleData), 42)]\n\t\t\t\t\tpublic void TestMethod4((int a, int b) _) { }\n\n\t\t\t\t\tpublic static TheoryData<object[]> FieldArrayData = new TheoryData<object[]>();\n\t\t\t\t\tpublic static TheoryData<object[]> PropertyArrayData => new TheoryData<object[]>();\n\t\t\t\t\tpublic static TheoryData<object[]> MethodArrayData() => new TheoryData<object[]>();\n\t\t\t\t\tpublic static TheoryData<object[]> MethodWithArgsArrayData(int _) => new TheoryData<object[]>();\n\n\t\t\t\t\t// https://github.com/xunit/xunit/issues/3007\n\t\t\t\t\t[MemberData(nameof(FieldArrayData))]\n\t\t\t\t\t[MemberData(nameof(PropertyArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsArrayData), 42)]\n\t\t\t\t\tpublic void TestMethod5a<T>(T[] _1) {{ }}\n\n\t\t\t\t\t[MemberData(nameof(FieldArrayData))]\n\t\t\t\t\t[MemberData(nameof(PropertyArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsArrayData), 42)]\n\t\t\t\t\tpublic void TestMethod5b<T>(IEnumerable<T> _1) {{ }}\n\n\t\t\t\t\tpublic static TheoryData<int, string, int> FieldWithExtraArgData = new TheoryData<int, string, int>();\n\t\t\t\t\tpublic static TheoryData<int, string, int> PropertyWithExtraArgData => new TheoryData<int, string, int>();\n\t\t\t\t\tpublic static TheoryData<int, string, int> MethodWithExtraArgData() => new TheoryData<int, string, int>();\n\t\t\t\t\tpublic static TheoryData<int, string, int> MethodWithArgsWithExtraArgData(int _) => new TheoryData<int, string, int>();\n\n\t\t\t\t\t// Extra argument does not match params array type\n\t\t\t\t\t[MemberData(nameof(FieldWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(PropertyWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsWithExtraArgData))]\n\t\t\t\t\tpublic void TestMethod6(int _1, params {|#0:string[]|} _2) { }\n\n\t\t\t\t\tpublic static TheoryData<int> FieldIncompatibleData = new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> PropertyIncompatibleData => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodIncompatibleData() => new TheoryData<int>();\n\t\t\t\t\tpublic static TheoryData<int> MethodWithArgsIncompatibleData(int _) => new TheoryData<int>();\n\n\t\t\t\t\t// Incompatible data type\n\t\t\t\t\t[MemberData(nameof(FieldIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(MethodIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsIncompatibleData))]\n\t\t\t\t\tpublic void TestMethod7({|#1:string|} _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.FieldWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.PropertyWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.MethodWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.MethodWithArgsWithExtraArgData\", \"_2\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.FieldIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.PropertyIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.MethodIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.MethodWithArgsIncompatibleData\", \"_\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string[]>> FieldData = new List<TheoryDataRow<int, string[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string[]>> PropertyData => new List<TheoryDataRow<int, string[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string[]>> MethodData() => new List<TheoryDataRow<int, string[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string[]>> MethodWithArgsData(int _) => new List<TheoryDataRow<int, string[]>>();\n\n\t\t\t\t\t// Exact match\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1(int _1, params string[] _2) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, string>> FieldDataCollapse = new List<TheoryDataRow<int, string, string>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, string>> PropertyDataCollapse => new List<TheoryDataRow<int, string, string>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, string>> MethodDataCollapse() => new List<TheoryDataRow<int, string, string>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, string>> MethodWithArgsDataCollapse(int _) => new List<TheoryDataRow<int, string, string>>();\n\n\t\t\t\t\t// Multiple values can be collapsed into the params array\n\t\t\t\t\t[MemberData(nameof(FieldDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(PropertyDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(MethodDataCollapse))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsDataCollapse), 42)]\n\t\t\t\t\tpublic void TestMethod2(int _1, params string[] _2) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int, int)>> FieldNamelessTupleData = new List<TheoryDataRow<(int, int)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int, int)>> PropertyNamelessTupleData => new List<TheoryDataRow<(int, int)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int, int)>> MethodNamelessTupleData() => new List<TheoryDataRow<(int, int)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int, int)>> MethodWithArgsNamelessTupleData(int _) => new List<TheoryDataRow<(int, int)>>();\n\n\t\t\t\t\t// Nameless anonymous tuples\n\t\t\t\t\t[MemberData(nameof(FieldNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodNamelessTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsNamelessTupleData), 42)]\n\t\t\t\t\tpublic void TestMethod3((int a, int b) _) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int x, int y)>> FieldNamedTupleData = new List<TheoryDataRow<(int x, int y)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int x, int y)>> PropertyNamedTupleData => new List<TheoryDataRow<(int x, int y)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int x, int y)>> MethodNamedTupleData() => new List<TheoryDataRow<(int x, int y)>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<(int x, int y)>> MethodWithArgsNamedTupleData(int _) => new List<TheoryDataRow<(int x, int y)>>();\n\n\t\t\t\t\t// Named anonymous tuples (names don't need to match, just the shape)\n\t\t\t\t\t[MemberData(nameof(FieldNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodNamedTupleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsNamedTupleData), 42)]\n\t\t\t\t\tpublic void TestMethod4((int a, int b) _) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<object[]>> FieldArrayData = new List<TheoryDataRow<object[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<object[]>> PropertyArrayData => new List<TheoryDataRow<object[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<object[]>> MethodArrayData() => new List<TheoryDataRow<object[]>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<object[]>> MethodWithArgsArrayData(int _) => new List<TheoryDataRow<object[]>>();\n\n\t\t\t\t\t// https://github.com/xunit/xunit/issues/3007\n\t\t\t\t\t[MemberData(nameof(FieldArrayData))]\n\t\t\t\t\t[MemberData(nameof(PropertyArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsArrayData), 42)]\n\t\t\t\t\tpublic void TestMethod5a<T>(T[] _1) {{ }}\n\n\t\t\t\t\t[MemberData(nameof(FieldArrayData))]\n\t\t\t\t\t[MemberData(nameof(PropertyArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodArrayData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsArrayData), 42)]\n\t\t\t\t\tpublic void TestMethod5b<T>(IEnumerable<T> _1) {{ }}\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, int>> FieldWithExtraArgData = new List<TheoryDataRow<int, string, int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, int>> PropertyWithExtraArgData => new List<TheoryDataRow<int, string, int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, int>> MethodWithExtraArgData() => new List<TheoryDataRow<int, string, int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int, string, int>> MethodWithArgsWithExtraArgData(int _) => new List<TheoryDataRow<int, string, int>>();\n\n\t\t\t\t\t// Extra argument does not match params array type\n\t\t\t\t\t[MemberData(nameof(FieldWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(PropertyWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithExtraArgData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsWithExtraArgData))]\n\t\t\t\t\tpublic void TestMethod6(int _1, params {|#0:string[]|} _2) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> FieldIncompatibleData = new List<TheoryDataRow<int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> PropertyIncompatibleData => new List<TheoryDataRow<int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> MethodIncompatibleData() => new List<TheoryDataRow<int>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> MethodWithArgsIncompatibleData(int _) => new List<TheoryDataRow<int>>();\n\n\t\t\t\t\t// Incompatible data type\n\t\t\t\t\t[MemberData(nameof(FieldIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(PropertyIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(MethodIncompatibleData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsIncompatibleData))]\n\t\t\t\t\tpublic void TestMethod7({|#1:string|} _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.FieldWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.PropertyWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.MethodWithExtraArgData\", \"_2\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(0).WithArguments(\"int\", \"TestClass.MethodWithArgsWithExtraArgData\", \"_2\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.FieldIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.PropertyIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.MethodIncompatibleData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1039\").WithLocation(1).WithArguments(\"int\", \"TestClass.MethodWithArgsIncompatibleData\", \"_\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1040_TheoryDataTypeArgumentsMustMatchTestMethodParameters_IncompatibleNullability\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<string?> FieldData = new TheoryData<string?>();\n\t\t\t\t\tpublic static TheoryData<string?> PropertyData => new TheoryData<string?>();\n\t\t\t\t\tpublic static TheoryData<string?> MethodData() => new TheoryData<string?>();\n\t\t\t\t\tpublic static TheoryData<string?> MethodWithArgsData(int _) => new TheoryData<string?>();\n\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod({|#0:string|} _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.FieldData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.PropertyData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.MethodData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.MethodWithArgsData\", \"_\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<string?>> FieldData = new List<TheoryDataRow<string?>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<string?>> PropertyData => new List<TheoryDataRow<string?>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<string?>> MethodData() => new List<TheoryDataRow<string?>>();\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<string?>> MethodWithArgsData(int _) => new List<TheoryDataRow<string?>>();\n\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod({|#0:string|} _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.FieldData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.PropertyData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.MethodData\", \"_\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1040\").WithLocation(0).WithArguments(\"string?\", \"TestClass.MethodWithArgsData\", \"_\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1042_MemberDataTheoryDataIsRecommendedForStronglyTypedAnalysis\n\t{\n\t\tconst string V2AllowedTypes = \"TheoryData<>\";\n\t\tconst string V3AllowedTypes = \"TheoryData<> or IEnumerable<TheoryDataRow<>>\";\n\n\t\t[Fact]\n\t\tpublic async ValueTask V2_and_V3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> FieldData;\n\t\t\t\t\tpublic static TheoryData<int> PropertyData { get; set; }\n\t\t\t\t\tpublic static TheoryData<int> MethodData() => null;\n\t\t\t\t\tpublic static TheoryData<int> MethodWithArgsData(int _) => null;\n\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1(int _) { }\n\n\t\t\t\t\tpublic static IEnumerable<object[]> FieldUntypedData;\n\t\t\t\t\tpublic static IEnumerable<object[]> PropertyUntypedData { get; set; }\n\t\t\t\t\tpublic static List<object[]> MethodUntypedData() => null;\n\t\t\t\t\tpublic static object[][] MethodWithArgsUntypedData(int _) => null;\n\n\t\t\t\t\t[{|#0:MemberData(nameof(FieldUntypedData))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(PropertyUntypedData))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(MethodUntypedData))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(MethodWithArgsUntypedData), 42)|}]\n\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expectedV2 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(0).WithArguments(V2AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(1).WithArguments(V2AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(2).WithArguments(V2AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(3).WithArguments(V2AllowedTypes),\n\t\t\t};\n\t\t\tvar expectedV3 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(0).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(1).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(2).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(3).WithArguments(V3AllowedTypes),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV2(source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(source, expectedV3);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task V3_only()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#pragma warning disable xUnit1053\n\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static MatrixTheoryData<int, string> FieldData;\n\t\t\t\t\tpublic static MatrixTheoryData<int, string> PropertyData { get; set; }\n\t\t\t\t\tpublic static MatrixTheoryData<int, string> MethodData() => null;\n\t\t\t\t\tpublic static MatrixTheoryData<int, string> MethodWithArgsData(int _) => null;\n\n\t\t\t\t\t[MemberData(nameof(FieldData))]\n\t\t\t\t\t[MemberData(nameof(PropertyData))]\n\t\t\t\t\t[MemberData(nameof(MethodData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsData), 42)]\n\t\t\t\t\tpublic void TestMethod1(int _1, string _2) { }\n\n\t\t\t\t\tpublic static IEnumerable<TheoryDataRow<int>> FieldEnumerableData;\n\t\t\t\t\tpublic static IAsyncEnumerable<TheoryDataRow<int>> PropertyEnumerableData { get; set; }\n\t\t\t\t\tpublic static List<TheoryDataRow<int>> MethodEnumerableData() => null;\n\t\t\t\t\tpublic static TheoryDataRow<int>[] MethodWithArgsEnumerableData(int _) => null;\n\n\t\t\t\t\t[MemberData(nameof(FieldEnumerableData))]\n\t\t\t\t\t[MemberData(nameof(PropertyEnumerableData))]\n\t\t\t\t\t[MemberData(nameof(MethodEnumerableData))]\n\t\t\t\t\t[MemberData(nameof(MethodWithArgsEnumerableData), 42)]\n\t\t\t\t\tpublic void TestMethod2(int _) { }\n\n\t\t\t\t\tpublic static Task<IEnumerable<object[]>> FieldUntypedTaskData;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<object[]>> PropertyUntypedTaskData { get; set; }\n\t\t\t\t\tpublic static Task<List<object[]>> MethodUntypedTaskData() => null;\n\t\t\t\t\tpublic static Task<object[][]> MethodWithArgsUntypedTaskData(int _) => null;\n\n\t\t\t\t\t[{|#0:MemberData(nameof(FieldUntypedTaskData))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(PropertyUntypedTaskData))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(MethodUntypedTaskData))|}]\n\t\t\t\t\t[{|#3:MemberData(nameof(MethodWithArgsUntypedTaskData), 42)|}]\n\t\t\t\t\tpublic void TestMethod3(int _) { }\n\n\t\t\t\t\tpublic static ValueTask<IEnumerable<object[]>> FieldUntypedValueTaskData;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<object[]>> PropertyUntypedValueTaskData { get; set; }\n\t\t\t\t\tpublic static ValueTask<List<object[]>> MethodUntypedValueTaskData() => default;\n\t\t\t\t\tpublic static ValueTask<object[][]> MethodWithArgsUntypedValueTaskData(int _) => default;\n\n\t\t\t\t\t[{|#10:MemberData(nameof(FieldUntypedValueTaskData))|}]\n\t\t\t\t\t[{|#11:MemberData(nameof(PropertyUntypedValueTaskData))|}]\n\t\t\t\t\t[{|#12:MemberData(nameof(MethodUntypedValueTaskData))|}]\n\t\t\t\t\t[{|#13:MemberData(nameof(MethodWithArgsUntypedValueTaskData), 42)|}]\n\t\t\t\t\tpublic void TestMethod4(int _) { }\n\n\t\t\t\t\tpublic static Task<IEnumerable<ITheoryDataRow>> FieldUntypedTaskData2;\n\t\t\t\t\tpublic static Task<IAsyncEnumerable<ITheoryDataRow>> PropertyUntypedTaskData2 { get; set; }\n\t\t\t\t\tpublic static Task<List<TheoryDataRow>> MethodUntypedTaskData2() => null;\n\t\t\t\t\tpublic static Task<TheoryDataRow[]> MethodWithArgsUntypedTaskData2(int _) => null;\n\n\t\t\t\t\t[{|#20:MemberData(nameof(FieldUntypedTaskData2))|}]\n\t\t\t\t\t[{|#21:MemberData(nameof(PropertyUntypedTaskData2))|}]\n\t\t\t\t\t[{|#22:MemberData(nameof(MethodUntypedTaskData2))|}]\n\t\t\t\t\t[{|#23:MemberData(nameof(MethodWithArgsUntypedTaskData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod5(int _) { }\n\n\t\t\t\t\tpublic static ValueTask<IEnumerable<ITheoryDataRow>> FieldUntypedValueTaskData2;\n\t\t\t\t\tpublic static ValueTask<IAsyncEnumerable<ITheoryDataRow>> PropertyUntypedValueTaskData2 { get; set; }\n\t\t\t\t\tpublic static ValueTask<List<TheoryDataRow>> MethodUntypedValueTaskData2() => default;\n\t\t\t\t\tpublic static ValueTask<TheoryDataRow[]> MethodWithArgsUntypedValueTaskData2(int _) => default;\n\n\t\t\t\t\t[{|#30:MemberData(nameof(FieldUntypedValueTaskData2))|}]\n\t\t\t\t\t[{|#31:MemberData(nameof(PropertyUntypedValueTaskData2))|}]\n\t\t\t\t\t[{|#32:MemberData(nameof(MethodUntypedValueTaskData2))|}]\n\t\t\t\t\t[{|#33:MemberData(nameof(MethodWithArgsUntypedValueTaskData2), 42)|}]\n\t\t\t\t\tpublic void TestMethod6(int _) { }\n\n\t\t\t\t\tpublic static TheoryData<int, int, int, int, int, int, int, int, int, int, int, int, int, int, int> LongData;\n\n\t\t\t\t\t[MemberData(nameof(LongData))]\n\t\t\t\t\tpublic void TestMethod7(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, int n, int o) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(0).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(1).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(2).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(3).WithArguments(V3AllowedTypes),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(10).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(11).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(12).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(13).WithArguments(V3AllowedTypes),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(20).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(21).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(22).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(23).WithArguments(V3AllowedTypes),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(30).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(31).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(32).WithArguments(V3AllowedTypes),\n\t\t\t\tVerify.Diagnostic(\"xUnit1042\").WithLocation(33).WithArguments(V3AllowedTypes),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source, expected);\n\t\t}\n\t}\n\n\tpublic class X1053_MemberDataMemberMustBeStaticallyWrittenTo\n\t{\n\t\t[Fact]\n\t\tpublic async ValueTask Initializers_AndGetExpressions_MarkAsWrittenTo()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> Field = null;\n\t\t\t\t\tpublic static TheoryData<int> Property { get; } = null;\n\t\t\t\t\tpublic static TheoryData<int> PropertyWithGetBody { get { return null; } }\n\t\t\t\t\tpublic static TheoryData<int> PropertyWithGetExpression => null;\n\t\t\t\t\tpublic static TheoryData<int> FieldWrittenInStaticConstructor;\n\t\t\t\t\tpublic static TheoryData<int> PropertyWrittenInStaticConstructor { get; set; }\n\n\t\t\t\t\tstatic TestClass()\n\t\t\t\t\t{\n\t\t\t\t\t\tTestClass.FieldWrittenInStaticConstructor = null;\n\t\t\t\t\t\tPropertyWrittenInStaticConstructor = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(Field))]\n\t\t\t\t\t[MemberData(nameof(Property))]\n\t\t\t\t\t[MemberData(nameof(PropertyWithGetBody))]\n\t\t\t\t\t[MemberData(nameof(PropertyWithGetExpression))]\n\t\t\t\t\t[MemberData(nameof(FieldWrittenInStaticConstructor))]\n\t\t\t\t\t[MemberData(nameof(PropertyWrittenInStaticConstructor))]\n\t\t\t\t\tpublic void TestCase(int _) {}\n\t\t\t\t}\n\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source, []);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask SimpleCase_GeneratesResult()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> {|#0:Field|};\n\t\t\t\t\tpublic static TheoryData<int> {|#1:Property|} { get; set; }\n\n\t\t\t\t\tpublic TestClass()\n\t\t\t\t\t{\n\t\t\t\t\t\tTestClass.Field = null;\n\t\t\t\t\t\tProperty = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(Field))]\n\t\t\t\t\t[MemberData(nameof(Property))]\n\t\t\t\t\tpublic void TestCase(int _) {}\n\t\t\t\t}\n\t\t\t\"\"\";\n\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1053\").WithLocation(0).WithArguments(\"Field\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1053\").WithLocation(1).WithArguments(\"Property\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async ValueTask OutOfScopeCase_GeneratesResult()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TheoryInitializer {\n\t\t\t\t\tstatic TheoryInitializer()\n\t\t\t\t\t{\n\t\t\t\t\t\tTestClass.Field = null;\n\t\t\t\t\t\tTestClass.Property = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static TheoryData<int> {|#0:Field|};\n\t\t\t\t\tpublic static TheoryData<int> {|#1:Property|} { get; set; }\n\n\t\t\t\t\tstatic TestClass()\n\t\t\t\t\t{\n\t\t\t\t\t\tnew TheoryInitializer();\n\t\t\t\t\t}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(Field))]\n\t\t\t\t\t[MemberData(nameof(Property))]\n\t\t\t\t\tpublic void TestCase(int _) {}\n\t\t\t\t}\n\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1053\").WithLocation(0).WithArguments(\"Field\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1053\").WithLocation(1).WithArguments(\"Property\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/PublicMethodShouldBeMarkedAsTestTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.PublicMethodShouldBeMarkedAsTest>;\n\npublic class PublicMethodShouldBeMarkedAsTestTests\n{\n\t[Fact]\n\tpublic async Task PublicMethodInNonTestClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Fact\")]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Theory\")]\n\tpublic async Task TestMethods_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IDisposableDisposeMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass: System.IDisposable {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic void Dispose() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicAbstractMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic abstract void AbstractMethod();\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task DerivedMethodWithFactOnBaseAbstractMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic abstract void TestMethod();\n\t\t\t}\n\n\t\t\tpublic class TestClass : BaseClass {\n\t\t\t\tpublic override void TestMethod() { }\n\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicAbstractMethodMarkedWithFact_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic abstract void AbstractMethod();\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IDisposableDisposeMethodOverrideFromParentClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class BaseClass: System.IDisposable {\n\t\t\t\tpublic virtual void Dispose() { }\n\t\t\t}\n\n\t\t\tpublic class TestClass: BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic override void Dispose() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IDisposableDisposeMethodOverrideFromParentClassWithRepeatedInterfaceDeclaration_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class BaseClass: System.IDisposable {\n\t\t\t\tpublic virtual void Dispose() { }\n\t\t\t}\n\n\t\t\tpublic class TestClass: BaseClass, System.IDisposable {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic override void Dispose() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IDisposableDisposeMethodOverrideFromGrandParentClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class BaseClass: System.IDisposable {\n\t\t\t\tpublic abstract void Dispose();\n\t\t\t}\n\n\t\t\tpublic abstract class IntermediateClass: BaseClass { }\n\n\t\t\tpublic class TestClass: IntermediateClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic override void Dispose() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IAsyncLifetimeMethods_V2_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass: Xunit.IAsyncLifetime {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic System.Threading.Tasks.Task DisposeAsync()\n\t\t\t\t{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\n\t\t\t\tpublic System.Threading.Tasks.Task InitializeAsync()\n\t\t\t\t{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV2(source);\n\t}\n\n\t[Fact]\n\tpublic async Task IAsyncLifetimeMethods_V3_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass: Xunit.IAsyncLifetime {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic System.Threading.Tasks.ValueTask DisposeAsync()\n\t\t\t\t{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\n\t\t\t\tpublic System.Threading.Tasks.ValueTask InitializeAsync()\n\t\t\t\t{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicMethodMarkedWithAttributeWhichIsMarkedWithIgnoreXunitAnalyzersRule1013_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class IgnoreXunitAnalyzersRule1013Attribute: System.Attribute { }\n\n\t\t\t[IgnoreXunitAnalyzersRule1013]\n\t\t\tpublic class CustomTestTypeAttribute: System.Attribute { }\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\t[CustomTestType]\n\t\t\t\tpublic void CustomTestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task PublicMethodMarkedWithAttributeWhichInheritsFromAttributeMarkedWithIgnoreXunitAnalyzersRule1013_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class IgnoreXunitAnalyzersRule1013Attribute: System.Attribute { }\n\n\t\t\t[IgnoreXunitAnalyzersRule1013]\n\t\t\tpublic class BaseCustomTestTypeAttribute: System.Attribute { }\n\n\t\t\tpublic class DerivedCustomTestTypeAttribute: BaseCustomTestTypeAttribute { }\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\t[DerivedCustomTestType]\n\t\t\t\tpublic void {|#0:CustomTestMethod|}() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"CustomTestMethod\", \"TestClass\", \"Fact\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Fact\")]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Theory\")]\n\tpublic async Task PublicMethodWithoutParametersInTestClass_Triggers(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\n\t\t\t\tpublic void {{|#0:Method|}}() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Method\", \"TestClass\", \"Fact\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Fact\")]\n\t[InlineData(/* lang=c#-test */ \"Xunit.Theory\")]\n\tpublic async Task PublicMethodWithParametersInTestClass_Triggers(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\n\t\t\t\tpublic void {{|#0:Method|}}(int a) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Method\", \"TestClass\", \"Theory\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"Fact\")]\n\t[InlineData(/* lang=c#-test */ \"Theory\")]\n\tpublic async Task OverridenMethod_FromParentNonTestClass_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class ParentClass {{\n\t\t\t\tpublic abstract void ParentMethod();\n\t\t\t}}\n\n\t\t\tpublic class TestClass : ParentClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\n\t\t\t\tpublic override void ParentMethod() {{ }}\n\t\t\t\n\t\t\t\tpublic override void {{|CS0115:MissingMethod|}}() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestClassCannotBeNestedInGenericClassTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassCannotBeNestedInGenericClass>;\n\npublic class TestClassCannotBeNestedInGenericClassTests\n{\n\t[Fact]\n\tpublic async Task WhenTestClassIsNestedInOpenGenericType_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class OpenGenericType<T> {\n\t\t\t\tpublic class [|NestedTestClass|] {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenDerivedTestClassIsNestedInOpenGenericType_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class BaseTestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\n\t\t\tpublic abstract class OpenGenericType<T> {\n\t\t\t\tpublic class [|NestedTestClass|] : BaseTestClass { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenTestClassIsNestedInClosedGenericType_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class OpenGenericType<T> { }\n\n\t\t\tpublic abstract class ClosedGenericType : OpenGenericType<int> {\n\t\t\t\tpublic class NestedTestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenNestedClassIsNotTestClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class OpenGenericType<T> {\n\t\t\t\tpublic class NestedClass { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenTestClassIsNotNestedInOpenGenericType_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class NonGenericType {\n\t\t\t\tpublic class NestedTestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestClassMustBePublicTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassMustBePublic>;\n\npublic class TestClassMustBePublicTests\n{\n\tpublic static MatrixTheoryData<string, string> CreateFactsInNonPublicClassCases =\n\t\tnew(\n\t\t\t/* lang=c#-test */ [\"Xunit.Fact\", \"Xunit.Theory\"],\n\t\t\t/* lang=c#-test */ [\"\", \"internal\"]\n\t\t);\n\n\t[Fact]\n\tpublic async Task ForPublicClass_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(CreateFactsInNonPublicClassCases))]\n\tpublic async Task ForFriendOrInternalClass_Triggers(\n\t\tstring attribute,\n\t\tstring modifier)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t{1} class [|TestClass|] {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute, modifier);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"\")]\n\t[InlineData(/* lang=c#-test */ \"public\")]\n\tpublic async Task ForPartialClassInSameFile_WhenClassIsPublic_DoesNotTrigger(string modifier)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic partial class TestClass {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test1() {{ }}\n\t\t\t}}\n\n\t\t\t{0} partial class TestClass {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test2() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", modifier);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"\")]\n\t[InlineData(/* lang=c#-test */ \"public\")]\n\tpublic async Task ForPartialClassInOtherFiles_WhenClassIsPublic_DoesNotTrigger(string modifier)\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic partial class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar source2 = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t{0} partial class TestClass {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test2() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", modifier);\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2]);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\", \"\")]\n\t[InlineData(\"\", \"internal\")]\n\t[InlineData(\"internal\", \"internal\")]\n\tpublic async Task ForPartialClassInSameFile_WhenClassIsNonPublic_Triggers(\n\t\tstring modifier1,\n\t\tstring modifier2)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t{0} partial class {{|#0:TestClass|}} {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test1() {{ }}\n\t\t\t}}\n\n\t\t\t{1} partial class {{|#1:TestClass|}} {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test2() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", modifier1, modifier2);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithLocation(1);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\", \"\")]\n\t[InlineData(\"\", \"internal\")]\n\t[InlineData(\"internal\", \"internal\")]\n\tpublic async Task ForPartialClassInOtherFiles_WhenClassIsNonPublic_Triggers(\n\t\tstring modifier1,\n\t\tstring modifier2)\n\t{\n\t\tvar source1 = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t{0} partial class {{|#0:TestClass|}} {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test1() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", modifier1);\n\t\tvar source2 = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t{0} partial class {{|#1:TestClass|}} {{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void Test2() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", modifier2);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithLocation(1);\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2], expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestClassShouldHaveTFixtureArgumentTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassShouldHaveTFixtureArgument>;\n\npublic class TestClassShouldHaveTFixtureArgumentTests\n{\n\tpublic static MatrixTheoryData<string, string> CreateFactsInNonPublicClassCases =\n\t\tnew(\n\t\t\t/* lang=c#-test */ [\"Xunit.Fact\", \"Xunit.Theory\"],\n\t\t\t/* lang=c#-test */ [\"Xunit.IClassFixture\", \"Xunit.ICollectionFixture\"]\n\t\t);\n\n\t[Theory]\n\t[MemberData(nameof(CreateFactsInNonPublicClassCases))]\n\tpublic async Task ForClassWithIClassFixtureWithoutConstructorArg_Triggers(\n\t\tstring attribute,\n\t\tstring @interface)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData {{ }}\n\n\t\t\tpublic class {{|#0:TestClass|}}: {1}<FixtureData> {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute, @interface);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestClass\", \"FixtureData\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(CreateFactsInNonPublicClassCases))]\n\tpublic async Task ForClassWithIClassFixtureWithConstructorArg_DoesNotTrigger(\n\t\tstring attribute,\n\t\tstring @interface)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData {{ }}\n\n\t\t\tpublic class TestClass: {1}<FixtureData> {{\n\t\t\t\tpublic TestClass(FixtureData fixtureData) {{ }}\n\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute, @interface);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(CreateFactsInNonPublicClassCases))]\n\tpublic async Task ForClassWithIClassFixtureWithConstructorMultipleArg_DoesNotTrigger(\n\t\tstring attribute,\n\t\tstring @interface)\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData {{ }}\n\n\t\t\tpublic class TestClass: {1}<FixtureData> {{\n\t\t\t\tpublic TestClass(FixtureData fixtureData, {2}.ITestOutputHelper output) {{ }}\n\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV2(string.Format(source, attribute, @interface, \"Xunit.Abstractions\"));\n\t\tawait Verify.VerifyAnalyzerV3(string.Format(source, attribute, @interface, \"Xunit\"));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestMethodCannotHaveOverloadsTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodCannotHaveOverloads>;\n\npublic class TestMethodCannotHaveOverloadsTests\n{\n\t[Fact]\n\tpublic async Task ForInstanceMethodOverloads_InSameInstanceClass_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void {|#0:TestMethod|}() { }\n\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void {|#1:TestMethod|}(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"TestClass\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\", \"TestClass\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForStaticMethodOverloads_InSameStaticClass_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic static class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic static void {|#0:TestMethod|}() { }\n\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic static void {|#1:TestMethod|}(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"TestClass\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\", \"TestClass\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForInstanceMethodOverload_InDerivedClass_Triggers()\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass : BaseClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void {|#0:TestMethod|}(int a) { }\n\n\t\t\t\tprivate void {|#1:TestMethod|}(int a, byte c) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar source2 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"BaseClass\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\", \"BaseClass\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForStaticAndInstanceMethodOverload_Triggers()\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass : BaseClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void {|#0:TestMethod|}(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar source2 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic static void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"BaseClass\");\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForMethodOverrides_DoesNotTrigger()\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic virtual void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar source2 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass : BaseClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic override void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2]);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestMethodMustNotHaveMultipleFactAttributesTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodMustNotHaveMultipleFactAttributes>;\n\npublic class TestMethodMustNotHaveMultipleFactAttributesTests\n{\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\tpublic async Task MethodWithSingleAttribute_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task MethodWithFactAndTheory_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void [|TestMethod|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task MethodWithFactAndCustomFactAttribute_Triggers()\n\t{\n\t\tvar source1 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\t[CustomFact]\n\t\t\t\tpublic void [|TestMethod|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar source2 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class CustomFactAttribute : Xunit.FactAttribute { }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer([source1, source2]);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestMethodShouldNotBeSkippedTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodShouldNotBeSkipped>;\n\npublic class TestMethodShouldNotBeSkippedTests\n{\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\tpublic async Task NotSkippedTest_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Xunit.{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\tpublic async Task SkippedTest_Triggers(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\t[Xunit.{0}([|Skip=\"Lazy\"|])]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\tpublic async Task SkippedTestWhenConditionIsTrue_V3_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic static bool Condition {{ get; set; }}\n\t\t\t\t[Xunit.{0}(Skip=\"Lazy\", SkipWhen=nameof(Condition))]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"Theory\")]\n\tpublic async Task SkippedTestUnlessConditionIsTrue_V3_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic static bool Condition {{ get; set; }}\n\t\t\t\t[Xunit.{0}(Skip=\"Lazy\", SkipUnless=nameof(Condition))]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TestMethodSupportedReturnTypeTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodSupportedReturnType>;\n\npublic class TestMethodSupportedReturnTypeTests\n{\n\t[Fact]\n\tpublic async Task NonTestMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class NonTestClass {\n\t\t\t\tpublic int Add(int x, int y) {\n\t\t\t\t\treturn x + y;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"object\")]\n\t[InlineData(\"Task<int>\")]\n\t[InlineData(\"ValueTask<string>\")]\n\tpublic async Task InvalidReturnType_Triggers(string returnType)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Fact]\n\t\t\t\tpublic {0} {{|#0:TestMethod|}}() {{\n\t\t\t\t\treturn default({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", returnType);\n\t\tvar expectedV2 = Verify.Diagnostic().WithLocation(0).WithArguments(\"void, Task\");\n\t\tvar expectedV3 = Verify.Diagnostic().WithLocation(0).WithArguments(\"void, Task, ValueTask\");\n\n\t\tawait Verify.VerifyAnalyzerV2(source, expectedV2);\n\t\tawait Verify.VerifyAnalyzerV3(source, expectedV3);\n\t}\n\n\t[Fact]\n\tpublic async Task ValueTask_TriggersInV2_DoesNotTriggerInV3()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic ValueTask {|#0:TestMethod|}() {\n\t\t\t\t\treturn default(ValueTask);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expectedV2 = Verify.Diagnostic().WithLocation(0).WithArguments(\"void, Task\");\n\n\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp7, source, expectedV2);\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"MyTest\")]\n\t[InlineData(\"MyTestAttribute\")]\n\tpublic async Task CustomTestAttribute_DoesNotTrigger(string attribute)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass MyTestAttribute : FactAttribute {{ }}\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic int TestMethod() {{\n\t\t\t\t\treturn 0;\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryDataRowArgumentsShouldBeSerializableTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryDataRowArgumentsShouldBeSerializable>;\nusing Verify_v3_Pre301 = CSharpVerifier<TheoryDataRowArgumentsShouldBeSerializableTests.Analyzer_v3_Pre301>;\n\npublic sealed class TheoryDataRowArgumentsShouldBeSerializableTests\n{\n\t[Fact]\n\tpublic async Task ParamArrayArguments_NotUsingTheoryDataRow_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tpublic class Foo {\n\t\t\t\tpublic Foo(params object[] args) { }\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar foo = new Foo(new object());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\\\"String value\\\"\", \"string\")]\n\t[InlineData(\"'a'\", \"char\")]\n\t[InlineData(\"(byte)42\", \"byte\")]\n\t[InlineData(\"(sbyte)42\", \"sbyte\")]\n\t[InlineData(\"(short)42\", \"short\")]\n\t[InlineData(\"(ushort)42\", \"ushort\")]\n\t[InlineData(\"42\", \"int\")]\n\t[InlineData(\"42U\", \"uint\")]\n\t[InlineData(\"42L\", \"long\")]\n\t[InlineData(\"42UL\", \"ulong\")]\n\t[InlineData(\"21.12F\", \"float\")]\n\t[InlineData(\"21.12D\", \"double\")]\n\t[InlineData(\"21.12M\", \"decimal\")]\n\t[InlineData(\"true\", \"bool\")]\n\t[InlineData(\"DateTime.Now\", \"DateTime\")]\n\t[InlineData(\"DateTimeOffset.Now\", \"DateTimeOffset\")]\n\t[InlineData(\"TimeSpan.Zero\", \"TimeSpan\")]\n\t[InlineData(\"BigInteger.One\", \"BigInteger\")]\n\t[InlineData(\"typeof(TheoryDataRow)\", \"Type\")]\n\t[InlineData(\"ConsoleColor.Red\", \"ConsoleColor\")]\n\t[InlineData(\"new Dictionary<string, List<string>>()\", \"Dictionary<string, List<string>>\")]\n#if NET6_0_OR_GREATER\n\t[InlineData(\"DateOnly.MinValue\", \"DateOnly\")]\n\t[InlineData(\"Index.Start\", \"Index\")]\n\t[InlineData(\"Range.All\", \"Range\")]\n\t[InlineData(\"TimeOnly.MinValue\", \"TimeOnly\")]\n#endif\n\t[InlineData(\"Guid.Empty\", \"Guid\")]\n\t[InlineData(\"new Uri(\\\"https://xunit.net/\\\")\", \"Uri\")]\n\t[InlineData(\"new Version(\\\"1.2.3\\\")\", \"Version\")]\n\tpublic async Task IntrinsicallySerializableValue_DoesNotTrigger(\n\t\tstring value,\n\t\tstring type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Numerics;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar value = {0};\n\t\t\t\t\tvar defaultValue = default({1});\n\t\t\t\t\tvar nullValue = default({1}?);\n\t\t\t\t\tvar arrayValue = new {1}[0];\n\n\t\t\t\t\tyield return new TheoryDataRow(value, defaultValue, nullValue, arrayValue);\n\t\t\t\t\tyield return new TheoryDataRow<{1}, {1}?, {1}?, {1}[]>({0}, default({1}), default({1}?), new {1}[0]);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", value, type);\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"SerializableClass\")]\n\t[InlineData(\"SerializableStruct\")]\n\tpublic async Task IXunitSerializableValue_DoesNotTrigger(string type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\t\t\tusing Xunit.Sdk;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar value = new {0}();\n\t\t\t\t\tvar defaultValue = default({0});\n\t\t\t\t\tvar nullValue = default({0}?);\n\t\t\t\t\tvar arrayValue = new {0}[0];\n\n\t\t\t\t\tyield return new TheoryDataRow(value, defaultValue, nullValue, arrayValue);\n\t\t\t\t\tyield return new TheoryDataRow<{0}, {0}?, {0}?, {0}[]>(new {0}(), default({0}), default({0}?), new {0}[0]);\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic interface ISerializableInterface : IXunitSerializable {{ }}\n\n\t\t\tpublic class SerializableClass : ISerializableInterface {{\n\t\t\t\tpublic void Deserialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\tpublic void Serialize(IXunitSerializationInfo info) {{ }}\n\t\t\t}}\n\n\t\t\tpublic struct SerializableStruct : ISerializableInterface {{\n\t\t\t\tpublic void Deserialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\tpublic void Serialize(IXunitSerializationInfo info) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", type);\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"CustomSerialized\")]\n\t[InlineData(\"CustomSerializedDerived\")]\n\tpublic async Task IXunitSerializerValue_DoesNotTrigger(string type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\t\t\tusing Xunit.Sdk;\n\n\t\t\t[assembly: RegisterXunitSerializer(typeof(CustomSerializer), typeof(ICustomSerialized))]\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar value = new {0}();\n\t\t\t\t\tvar defaultValue = default({0});\n\t\t\t\t\tvar nullValue = default({0}?);\n\t\t\t\t\tvar arrayValue = new {0}[0];\n\n\t\t\t\t\tyield return new TheoryDataRow(value, defaultValue, nullValue, arrayValue);\n\t\t\t\t\tyield return new TheoryDataRow<{0}, {0}?, {0}?, {0}[]>(new {0}(), default({0}), default({0}?), new {0}[0]);\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic interface ICustomSerialized {{ }}\n\n\t\t\tpublic class CustomSerialized : ICustomSerialized {{ }}\n\n\t\t\tpublic class CustomSerializedDerived : CustomSerialized {{ }}\n\n\t\t\tpublic class CustomSerializer : IXunitSerializer {{\n\t\t\t\tpublic object Deserialize(Type type, string serializedValue) =>\n\t\t\t\t\tthrow new NotImplementedException();\n\n\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t{{\n\t\t\t\t\tfailureReason = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}}\n\n\t\t\t\tpublic string Serialize(object value) =>\n\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t}}\n\t\t\t\"\"\", type);\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Delegate\", \"Delegate?\", \"Delegate?\")]\n\t[InlineData(\"Func<int>\", \"Func<int>?\", \"Func<int>?\")]\n\t[InlineData(\"NonSerializableSealedClass\", \"NonSerializableSealedClass?\", \"NonSerializableSealedClass?\")]\n\t[InlineData(\"NonSerializableStruct\", \"NonSerializableStruct\", \"NonSerializableStruct?\")]\n\tpublic async Task KnownNonSerializableValue_Triggers1046(\n\t\tstring type,\n\t\tstring defaultValueType,\n\t\tstring nullValueType)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar defaultValue = default({0});\n\t\t\t\t\tvar nullValue = default({0}?);\n\t\t\t\t\tvar arrayValue = new {0}[0];\n\n\t\t\t\t\tyield return new TheoryDataRow({{|#0:defaultValue|}}, {{|#1:nullValue|}}, {{|#2:arrayValue|}});\n\t\t\t\t\tyield return new TheoryDataRow<{1}, {2}, {0}[]>({{|#3:default({0})|}}, {{|#4:default({0}?)|}}, {{|#5:new {0}[0]|}});\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic sealed class NonSerializableSealedClass {{ }}\n\n\t\t\tpublic struct NonSerializableStruct {{ }}\n\t\t\t\"\"\", type, defaultValueType, nullValueType);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(0).WithArguments(\"defaultValue\", defaultValueType),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(1).WithArguments(\"nullValue\", nullValueType),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(2).WithArguments(\"arrayValue\", $\"{type}[]\"),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(3).WithArguments($\"default({type})\", defaultValueType),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(4).WithArguments($\"default({type}?)\", nullValueType),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(5).WithArguments($\"new {type}[0]\", $\"{type}[]\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(\"NonSerializableSealedClass\")]\n\t[InlineData(\"NonSerializableStruct\")]\n\tpublic async Task KnownNonSerializableValue_Constructable_Triggers1046(string type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar value = new {0}();\n\n\t\t\t\t\tyield return new TheoryDataRow({{|#0:value|}});\n\t\t\t\t\tyield return new TheoryDataRow({{|#1:new {0}()|}});\n\t\t\t\t\tyield return new TheoryDataRow<{0}>({{|#2:value|}});\n\t\t\t\t\tyield return new TheoryDataRow<{0}>({{|#3:new {0}()|}});\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic sealed class NonSerializableSealedClass {{ }}\n\n\t\t\tpublic struct NonSerializableStruct {{ }}\n\t\t\t\"\"\", type);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(0).WithArguments(\"value\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(1).WithArguments($\"new {type}()\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(2).WithArguments(\"value\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(3).WithArguments($\"new {type}()\", type),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(\"object\")]\n\t[InlineData(\"Array\")]\n\t[InlineData(\"ValueType\")]\n\t[InlineData(\"IEnumerable\")]\n\t[InlineData(\"IEnumerable<int>\")]\n\t[InlineData(\"Dictionary<int, string>\")]\n\t[InlineData(\"IPossiblySerializableInterface\")]\n\t[InlineData(\"PossiblySerializableUnsealedClass\")]\n\tpublic async Task MaybeNonSerializableValue_Triggers1047(string type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar defaultValue = default({0});\n\t\t\t\t\tvar nullValue = default({0}?);\n\t\t\t\t\tvar arrayValue = new {0}[0];\n\n\t\t\t\t\tyield return new TheoryDataRow({{|#0:defaultValue|}}, {{|#1:nullValue|}}, {{|#2:arrayValue|}});\n\t\t\t\t\tyield return new TheoryDataRow<{0}, {0}, {0}[]>({{|#3:default({0})|}}, {{|#4:default({0}?)|}}, {{|#5:new {0}[0]|}});\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic interface IPossiblySerializableInterface {{ }}\n\n\t\t\tpublic class PossiblySerializableUnsealedClass {{ }}\n\t\t\t\"\"\", type);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(0).WithArguments(\"defaultValue\", $\"{type}?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(1).WithArguments(\"nullValue\", $\"{type}?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(2).WithArguments(\"arrayValue\", $\"{type}[]\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(3).WithArguments($\"default({type})\", $\"{type}?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(4).WithArguments($\"default({type}?)\", $\"{type}?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(5).WithArguments($\"new {type}[0]\", $\"{type}[]\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(\"object\")]\n\t[InlineData(\"Dictionary<int, string>\")]\n\t[InlineData(\"PossiblySerializableUnsealedClass\")]\n\tpublic async Task MaybeNonSerializableValue_Constructable_Triggers1047(string type)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {{\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {{\n\t\t\t\t\tvar value = new {0}();\n\n\t\t\t\t\tyield return new TheoryDataRow({{|#0:value|}});\n\t\t\t\t\tyield return new TheoryDataRow({{|#1:new {0}()|}});\n\t\t\t\t\tyield return new TheoryDataRow<{0}>({{|#2:value|}});\n\t\t\t\t\tyield return new TheoryDataRow<{0}>({{|#3:new {0}()|}});\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic class PossiblySerializableUnsealedClass {{ }}\n\t\t\t\"\"\", type);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(0).WithArguments(\"value\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(1).WithArguments($\"new {type}()\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(2).WithArguments(\"value\", type),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(3).WithArguments($\"new {type}()\", type),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task IFormattableAndIParseable_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Diagnostics.CodeAnalysis;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class Formattable : IFormattable\n\t\t\t{\n\t\t\t\tpublic string ToString(string? format, IFormatProvider? formatProvider) => string.Empty;\n\t\t\t}\n\n\t\t\tpublic class Parsable : IParsable<Parsable>\n\t\t\t{\n\t\t\t\tpublic static Parsable Parse(string s, IFormatProvider? provider) => new();\n\t\t\t\tpublic static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Parsable result)\n\t\t\t\t{\n\t\t\t\t\tresult = new();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class FormattableAndParsable : IFormattable, IParsable<FormattableAndParsable>\n\t\t\t{\n\t\t\t\tpublic static FormattableAndParsable Parse(string s, IFormatProvider? provider) => new();\n\t\t\t\tpublic string ToString(string? format, IFormatProvider? formatProvider) => string.Empty;\n\t\t\t\tpublic static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out FormattableAndParsable result)\n\t\t\t\t{\n\t\t\t\t\tresult = new();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class FormattableData {\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {\n\t\t\t\t\tvar defaultValue = default(Formattable);\n\t\t\t\t\tvar nullValue = default(Formattable?);\n\t\t\t\t\tvar arrayValue = new Formattable[0];\n\n\t\t\t\t\tyield return new TheoryDataRow({|#0:defaultValue|}, {|#1:nullValue|}, {|#2:arrayValue|});\n\t\t\t\t\tyield return new TheoryDataRow<Formattable, Formattable, Formattable[]>({|#3:default(Formattable)|}, {|#4:default(Formattable?)|}, {|#5:new Formattable[0]|});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class ParsableData {\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {\n\t\t\t\t\tvar defaultValue = default(Parsable);\n\t\t\t\t\tvar nullValue = default(Parsable?);\n\t\t\t\t\tvar arrayValue = new Parsable[0];\n\n\t\t\t\t\tyield return new TheoryDataRow({|#10:defaultValue|}, {|#11:nullValue|}, {|#12:arrayValue|});\n\t\t\t\t\tyield return new TheoryDataRow<Parsable, Parsable, Parsable[]>({|#13:default(Parsable)|}, {|#14:default(Parsable?)|}, {|#15:new Parsable[0]|});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class FormattableAndParsableData {\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyMethod() {\n\t\t\t\t\tvar defaultValue = default(FormattableAndParsable);\n\t\t\t\t\tvar nullValue = default(FormattableAndParsable?);\n\t\t\t\t\tvar arrayValue = new FormattableAndParsable[0];\n\n\t\t\t\t\tyield return new TheoryDataRow(defaultValue, nullValue, arrayValue);\n\t\t\t\t\tyield return new TheoryDataRow<FormattableAndParsable, FormattableAndParsable, FormattableAndParsable[]>(default(FormattableAndParsable), default(FormattableAndParsable?), new FormattableAndParsable[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n#if ROSLYN_LATEST && NET8_0_OR_GREATER\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(0).WithArguments(\"defaultValue\", \"Formattable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(1).WithArguments(\"nullValue\", \"Formattable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(2).WithArguments(\"arrayValue\", \"Formattable[]\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(3).WithArguments(\"default(Formattable)\", \"Formattable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(4).WithArguments(\"default(Formattable?)\", \"Formattable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(5).WithArguments(\"new Formattable[0]\", \"Formattable[]\"),\n\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(10).WithArguments(\"defaultValue\", \"Parsable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(11).WithArguments(\"nullValue\", \"Parsable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(12).WithArguments(\"arrayValue\", \"Parsable[]\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(13).WithArguments(\"default(Parsable)\", \"Parsable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(14).WithArguments(\"default(Parsable?)\", \"Parsable?\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(15).WithArguments(\"new Parsable[0]\", \"Parsable[]\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp11, source, expected);\n#else\n\t\t// For some reason, 'dotnet format' complains about the indenting of #nullable enable in the source code line\n\t\t// above if the #if statement surrounds the whole method, so we use this \"workaround\" to do nothing in that case.\n\t\tAssert.NotEqual(string.Empty, source);\n\t\tawait Task.Yield();\n#endif\n\t}\n\n\t[Fact]\n\tpublic async Task Tuples_OnlySupportedByV3_3_0_1()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyClass {\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyTupleMethod() {\n\t\t\t\t\tvar value = Tuple.Create(\"Hello world\", 42);\n\n\t\t\t\t\tyield return new TheoryDataRow({|#0:value|});\n\t\t\t\t\tyield return new TheoryDataRow({|#1:Tuple.Create(\"Hello world\", 42)|});\n\t\t\t\t\tyield return new TheoryDataRow<Tuple<string, int>>({|#2:value|});\n\t\t\t\t\tyield return new TheoryDataRow<Tuple<string, int>>({|#3:Tuple.Create(\"Hello world\", 42)|});\n\t\t\t\t}\n\n\t\t\t\tpublic IEnumerable<TheoryDataRowBase> MyValueTupleMethod() {\n\t\t\t\t\tvar value = ValueTuple.Create(\"Hello world\", 42);\n\n\t\t\t\t\tyield return new TheoryDataRow({|#10:value|});\n\t\t\t\t\tyield return new TheoryDataRow({|#11:ValueTuple.Create(\"Hello world\", 42)|});\n\t\t\t\t\tyield return new TheoryDataRow<ValueTuple<string, int>>({|#12:value|});\n\t\t\t\t\tyield return new TheoryDataRow<ValueTuple<string, int>>({|#13:ValueTuple.Create(\"Hello world\", 42)|});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class PossiblySerializableUnsealedClass { }\n\t\t\t\"\"\";\n\t\tvar expectedUnsupported = new[] {\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(0).WithArguments(\"value\", \"Tuple<string, int>\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(1).WithArguments(\"Tuple.Create(\\\"Hello world\\\", 42)\", \"Tuple<string, int>\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(2).WithArguments(\"value\", \"Tuple<string, int>\"),\n\t\t\tVerify.Diagnostic(\"xUnit1047\").WithLocation(3).WithArguments(\"Tuple.Create(\\\"Hello world\\\", 42)\", \"Tuple<string, int>\"),\n\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(10).WithArguments(\"value\", \"(string, int)\"),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(11).WithArguments(\"ValueTuple.Create(\\\"Hello world\\\", 42)\", \"(string, int)\"),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(12).WithArguments(\"value\", \"(string, int)\"),\n\t\t\tVerify.Diagnostic(\"xUnit1046\").WithLocation(13).WithArguments(\"ValueTuple.Create(\\\"Hello world\\\", 42)\", \"(string, int)\"),\n\t\t};\n\n\t\tawait Verify_v3_Pre301.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expectedUnsupported);\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\tinternal class Analyzer_v3_Pre301 : TheoryDataRowArgumentsShouldBeSerializable\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(3, 0, 0));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryDataShouldNotUseTheoryDataRowTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryDataShouldNotUseTheoryDataRow>;\n\npublic class TheoryDataShouldNotUseTheoryDataRowTests\n{\n\t[Fact]\n\tpublic async Task AcceptanceTest()\n\t{\n\t\tvar source = /* lang=C#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class Triggers1 {\n\t\t\t\t// Constructors\n\t\t\t\tpublic Triggers1([|TheoryData<ITheoryDataRow>|] data) { }\n\t\t\t\tpublic Triggers1([|TheoryData<TheoryDataRow<int>>|] data) { }\n\t\t\t\tpublic Triggers1([|TheoryData<MyRow>|] data) { }\n\n\t\t\t\t// Fields\n\t\t\t\tprivate [|TheoryData<ITheoryDataRow>|] field1 = new [|TheoryData<ITheoryDataRow>|]();\n\t\t\t\tprivate [|TheoryData<TheoryDataRow<int>>|] field2 = new [|TheoryData<TheoryDataRow<int>>|]();\n\t\t\t\tprivate [|TheoryData<MyRow>|] field3 = new [|TheoryData<MyRow>|]();\n\n\t\t\t\t// Array fields\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|][] field11 = null;\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|][] field12 = null;\n\t\t\t\tpublic [|TheoryData<MyRow>|][] field13 = null;\n\n\t\t\t\t// Static fields\n\t\t\t\tprivate static [|TheoryData<ITheoryDataRow>|] field21 = null;\n\t\t\t\tprivate static [|TheoryData<TheoryDataRow<int>>|] field22 = null;\n\t\t\t\tprivate static [|TheoryData<MyRow>|] field23 = null;\n\n\t\t\t\t// Properties\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|] property1 { get; set; } = new [|TheoryData<ITheoryDataRow>|]();\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|] property2 { get; set; } = new [|TheoryData<TheoryDataRow<int>>|]();\n\t\t\t\tpublic [|TheoryData<MyRow>|] property3 { get; set; } = new [|TheoryData<MyRow>|]();\n\n\t\t\t\t// Methods\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|] Method1() { return null; }\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|] Method2() { return null; }\n\t\t\t\tpublic [|TheoryData<MyRow>|] Method3() { return null; }\n\t\t\t}\n\n\t\t\t// Generic constraints\n\t\t\tclass Triggers2<T> where T : ITheoryDataRow {\n\t\t\t\t[|TheoryData<T>|] data = null;\n\t\t\t}\n\n\t\t\tclass Triggers3<T> where T : MyRow {\n\t\t\t\t[|TheoryData<T>|] data = null;\n\t\t\t}\n\n\t\t\tpublic class DoesNotTrigger {\n\t\t\t\tIEnumerable<ITheoryDataRow> field1 = new List<ITheoryDataRow>();\n\t\t\t\tIEnumerable<TheoryDataRow<int>> field2 = new List<TheoryDataRow<int>>();\n\t\t\t\tIEnumerable<MyRow> field3 = new List<MyRow>();\n\n\t\t\t\tIEnumerable<ITheoryDataRow> property1 { get; set; } = new List<ITheoryDataRow>();\n\t\t\t\tIEnumerable<TheoryDataRow<int>> property2 { get; set; } = new List<TheoryDataRow<int>>();\n\t\t\t\tIEnumerable<MyRow> property3 { get; set; } = new List<MyRow>();\n\n\t\t\t\tIEnumerable<ITheoryDataRow> method1() { return null; }\n\t\t\t\tIEnumerable<TheoryDataRow<int>> method2() { return null; }\n\t\t\t\tIEnumerable<MyRow> method3() { return null; }\n\t\t\t}\n\n\t\t\tpublic class MyRow : ITheoryDataRow {\n\t\t\t\tpublic object?[] GetData() { return null; }\n\t\t\t\tpublic bool? Explicit { get; }\n\t\t\t\tpublic string? Label { get; }\n\t\t\t\tpublic string? Skip { get; }\n\t\t\t\tpublic Type? SkipType { get; }\n\t\t\t\tpublic string? SkipUnless { get; }\n\t\t\t\tpublic string? SkipWhen { get; }\n\t\t\t\tpublic string? TestDisplayName { get; }\n\t\t\t\tpublic int? Timeout { get; }\n\t\t\t\tpublic Dictionary<string, HashSet<string>>? Traits { get; }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryDataTypeArgumentsShouldBeSerializableTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryDataTypeArgumentsShouldBeSerializable>;\nusing Verify_v3_Pre301 = CSharpVerifier<TheoryDataTypeArgumentsShouldBeSerializableTests.Analyzer_v3_Pre301>;\n\npublic class TheoryDataTypeArgumentsShouldBeSerializableTests\n{\n\tpublic static TheoryData<string, string, string, string> TheoryDataClass(\n\t\tstring type1,\n\t\tstring type2,\n\t\tstring type3) =>\n\t\t\tTheoryDataClass(theoryAttribute: \"Theory\", type1, type2, type3);\n\n\tpublic static TheoryData<string, string, string, string> TheoryDataClass(\n\t\tstring theoryAttribute,\n\t\tstring type1,\n\t\tstring type2,\n\t\tstring type3)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\t[ClassData(typeof(DerivedClass))]\n\t\t\t\tpublic void TestMethod({1} a, {2} b, {3} c) {{ }}\n\t\t\t}}\n\n\t\t\tpublic class BaseClass<T1, T2, T3, T4> : TheoryData<T1, T2, {3}> {{ }}\n\n\t\t\tpublic class DerivedClass : BaseClass<{1}, {2}, object, Delegate> {{ }}\n\t\t\t\"\"\", theoryAttribute, type1, type2, type3);\n\n\t\treturn new TheoryData<string, string, string, string>\n\t\t{\n\t\t\t{ source, type1, type2, type3 }\n\t\t};\n\t}\n\n\tpublic static TheoryData<string, string, string> TheoryDataMembers(string type)\n\t{\n\t\tvar c = string.Format(/* lang=c#-test */ \"public sealed class Class : TheoryData<{0}> {{ }}\", type);\n\t\tvar f = string.Format(/* lang=c#-test */ \"public static readonly TheoryData<{0}> Field = new TheoryData<{0}>() {{ }};\", type);\n\t\tvar m = string.Format(/* lang=c#-test */ \"public static TheoryData<{0}> Method(int a, string b) => new TheoryData<{0}>() {{ }};\", type);\n\t\tvar p = string.Format(/* lang=c#-test */ \"public static TheoryData<{0}> Property => new TheoryData<{0}>() {{ }};\", type);\n\n\t\treturn new TheoryData<string, string, string>\n\t\t{\n\t\t\t{ c, \"ClassData(typeof(Class))\", type },\n\t\t\t{ f, \"MemberData(nameof(Field))\", type },\n\t\t\t{ m, @\"MemberData(nameof(Method), 1, \"\"2\"\")\", type },\n\t\t\t{ p, \"MemberData(nameof(Property))\", type }\n\t\t};\n\t}\n\n\tpublic static TheoryData<string, string, string> TheoryDataMembersWithDiscoveryEnumerationDisabled(string type)\n\t{\n\t\tvar f = string.Format(/* lang=c#-test */ \"public static readonly TheoryData<{0}> Field = new TheoryData<{0}>() {{ }};\", type);\n\t\tvar m = string.Format(/* lang=c#-test */ \"public static TheoryData<{0}> Method(int a, string b) => new TheoryData<{0}>() {{ }};\", type);\n\t\tvar p = string.Format(/* lang=c#-test */ \"public static TheoryData<{0}> Property => new TheoryData<{0}>() {{ }};\", type);\n\n\t\treturn new TheoryData<string, string, string>\n\t\t{\n\t\t\t{ f, \"MemberData(nameof(Field), DisableDiscoveryEnumeration = true)\", type },\n\t\t\t{ m, @\"MemberData(nameof(Method), 1, \"\"2\"\", DisableDiscoveryEnumeration = true)\", type },\n\t\t\t{ p, \"MemberData(nameof(Property), DisableDiscoveryEnumeration = true)\", type }\n\t\t};\n\t}\n\n\tpublic sealed class NoDiagnostic : TheoryDataTypeArgumentsShouldBeSerializableTests\n\t{\n\t\t[Fact]\n\t\tpublic async Task GivenMethodWithoutAttributes_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task GivenFact_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task GivenTheory_WithoutTheoryDataAsDataSource_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static IEnumerable<object[]> Property1 => Array.Empty<object[]>();\n\t\t\t\t\tpublic static DataSource<IDisposable, Action> Property2 => new DataSource<IDisposable, Action>();\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[MemberData(nameof(Property1))]\n\t\t\t\t\t[MemberData(nameof(Property2))]\n\t\t\t\t\tpublic void TestMethod(object a, object b) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class DataSource<T1, T2> : IEnumerable<object[]> {\n\t\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() { yield break; }\n\t\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t// Serializable via XunitSerializationInfo (v2) or SerializationHelper (v3)\n\t\t[MemberData(nameof(TheoryDataMembers), \"Type\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Dictionary<string, List<string>>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"string\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"string[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"string[][]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"char\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"char?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"byte\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"byte?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"sbyte\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"sbyte?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"short\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"short?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ushort\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ushort?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int[][]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int?[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"int?[][]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"uint\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"uint?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"long\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"long?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ulong\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ulong?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"float\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"float?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"double\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"double?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"decimal\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"decimal?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"bool\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"bool?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateTime\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateTime?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateTimeOffset\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateTimeOffset?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeSpan\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeSpan?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"BigInteger\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"BigInteger?\")]\n#if NET6_0_OR_GREATER\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateOnly\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateOnly[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateOnly?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"DateOnly?[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeOnly\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeOnly[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeOnly?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"TimeOnly?[]\")]\n#endif\n\t\t// Serializable via XunitSerializationInfo (v2) or via built-in IXunitSerializer (v3)\n\t\t[MemberData(nameof(TheoryDataMembers), \"Enum\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableEnumeration\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableEnumeration?\")]\n\t\tpublic async Task GivenTheory_WithSerializableTheoryDataMember_DoesNotTrigger(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Numerics;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{1}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic enum SerializableEnumeration {{ Zero }}\n\t\t\t\t\"\"\", member, attribute, type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IXunitSerializable\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IXunitSerializable[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ISerializableInterface\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ISerializableInterface[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableClass\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableClass[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableStruct\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableStruct[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableStruct?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"SerializableStruct?[]\")]\n\t\tpublic async Task GivenTheory_WithIXunitSerializableTheoryDataMember_DoesNotTrigger(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar sourceV2 = GetSource(\"Xunit.Abstractions\");\n\t\t\tvar sourceV3 = GetSource(\"Xunit.Sdk\");\n\n\t\t\tawait Verify.VerifyAnalyzerV2(sourceV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(sourceV3);\n\n\t\t\tstring GetSource(string ns) =>\n\t\t\t\tstring.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing Xunit;\n\t\t\t\t\tusing {3};\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t{0}\n\n\t\t\t\t\t\t[Theory]\n\t\t\t\t\t\t[{1}]\n\t\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t\t}}\n\n\t\t\t\t\tpublic interface ISerializableInterface : IXunitSerializable {{ }}\n\n\t\t\t\t\tpublic class SerializableClass : ISerializableInterface {{\n\t\t\t\t\t\tpublic void Deserialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\t\t\tpublic void Serialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\t\t}}\n\n\t\t\t\t\tpublic struct SerializableStruct : ISerializableInterface {{\n\t\t\t\t\t\tpublic void Deserialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\t\t\tpublic void Serialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", member, attribute, type, ns);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ICustomSerialized\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"CustomSerialized\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"CustomSerializedDerived\")]\n\t\tpublic async Task GivenTheory_WithIXunitSerializerTheoryDataMember_DoesNotTrigger(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\t[assembly: RegisterXunitSerializer(typeof(CustomSerializer), typeof(ICustomSerialized))]\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{1}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic interface ICustomSerialized {{ }}\n\n\t\t\t\tpublic class CustomSerialized : ICustomSerialized {{ }}\n\n\t\t\t\tpublic class CustomSerializedDerived : CustomSerialized {{ }}\n\n\t\t\t\tpublic class CustomSerializer : IXunitSerializer {{\n\t\t\t\t\tpublic object Deserialize(Type type, string serializedValue) =>\n\t\t\t\t\t\tthrow new NotImplementedException();\n\n\t\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t\t{{\n\t\t\t\t\t\tfailureReason = null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}}\n\n\t\t\t\t\tpublic string Serialize(object value) =>\n\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}}\n\t\t\t\t\"\"\", member, attribute, type\n\t\t\t);\n\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Delegate\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Delegate[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableSealedClass\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableStruct\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"object\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"object[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IPossiblySerializableInterface\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"PossiblySerializableUnsealedClass\")]\n\t\tpublic async Task GivenTheory_WithNonSerializableTheoryDataMember_WithDiscoveryEnumerationDisabledForTheory_DoesNotTrigger(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory(DisableDiscoveryEnumeration = true)]\n\t\t\t\t\t[{1}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic sealed class NonSerializableSealedClass {{ }}\n\n\t\t\t\tpublic struct NonSerializableStruct {{ }}\n\n\t\t\t\tpublic interface IPossiblySerializableInterface {{ }}\n\n\t\t\t\tpublic class PossiblySerializableUnsealedClass {{ }}\n\t\t\t\t\"\"\", member, attribute, type);\n\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"Delegate\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"Delegate[]\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"NonSerializableSealedClass\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"NonSerializableStruct\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"object\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"object[]\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"IPossiblySerializableInterface\")]\n\t\t[MemberData(nameof(TheoryDataMembersWithDiscoveryEnumerationDisabled), \"PossiblySerializableUnsealedClass\")]\n\t\tpublic async Task GivenTheory_WithNonSerializableTheoryDataMember_WithDiscoveryEnumerationDisabledForMemberData_DoesNotTrigger(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{1}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic sealed class NonSerializableSealedClass {{ }}\n\n\t\t\t\tpublic struct NonSerializableStruct {{ }}\n\n\t\t\t\tpublic interface IPossiblySerializableInterface {{ }}\n\n\t\t\t\tpublic class PossiblySerializableUnsealedClass {{ }}\n\t\t\t\t\"\"\", member, attribute, type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataClass), \"int\", \"double\", \"string\")]\n\t\tpublic async Task GivenTheory_WithSerializableTheoryDataClass_DoesNotTrigger(\n\t\t\tstring source,\n\t\t\tstring _1,\n\t\t\tstring _2,\n\t\t\tstring _3)\n\t\t{\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataClass), \"Theory(DisableDiscoveryEnumeration = true)\", \"Action\", \"TimeZoneInfo\", \"TimeZoneInfo.TransitionTime\")]\n\t\t[MemberData(nameof(TheoryDataClass), \"Theory(DisableDiscoveryEnumeration = true)\", \"object[]\", \"Array\", \"IDisposable\")]\n\t\tpublic async Task GivenTheory_WithNonSerializableTheoryDataClass_WithDiscoveryEnumerationDisabled_DoesNotTrigger(\n\t\t\tstring source,\n\t\t\tstring _1,\n\t\t\tstring _2,\n\t\t\tstring _3)\n\t\t{\n\t\t\tawait Verify.VerifyAnalyzerV3(source);\n\t\t}\n\t}\n\n\tpublic sealed class X1044_AvoidUsingTheoryDataTypeArgumentsThatAreNotSerializable : TheoryDataTypeArgumentsShouldBeSerializableTests\n\t{\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Guid\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Guid?\")]\n#if NET6_0_OR_GREATER\n\t\t[MemberData(nameof(TheoryDataMembers), \"Index\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Range\")]\n#endif\n\t\t[MemberData(nameof(TheoryDataMembers), \"Version\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Version?\")]\n\t\tpublic async Task GivenTheory_WithTypeOnlySupportedInV3_TriggersInV2_DoesNotTriggerInV3(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expectedV2 = Verify.Diagnostic(\"xUnit1044\").WithLocation(0).WithArguments(type);\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp9, source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Delegate\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Delegate[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Func<int>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Func<int>[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableSealedClass\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableSealedClass[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableStruct\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableStruct[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableStruct?\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"NonSerializableStruct?[]\")]\n\t\tpublic async Task GivenTheory_WithNonSerializableTheoryDataMember_Triggers(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Text;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic sealed class NonSerializableSealedClass {{ }}\n\n\t\t\t\tpublic struct NonSerializableStruct {{ }}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1044\").WithLocation(0).WithArguments(type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataClass), \"Action\", \"TimeZoneInfo\", \"TimeZoneInfo.TransitionTime\")]\n\t\tpublic async Task GivenTheory_WithNonSerializableTheoryDataClass_Triggers(\n\t\t\tstring source,\n\t\t\tstring type1,\n\t\t\tstring type2,\n\t\t\tstring type3)\n\t\t{\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1044\").WithSpan(6, 3, 6, 34).WithArguments(type1),\n\t\t\t\tVerify.Diagnostic(\"xUnit1044\").WithSpan(6, 3, 6, 34).WithArguments(type2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1044\").WithSpan(6, 3, 6, 34).WithArguments(type3),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ValueTuple<string, int>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ValueTuple<string, int>?\")]\n\t\tpublic async Task GivenTheory_WithValueTuple_OnlySupportedInV3_3_0_1(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expectedUnsupported = Verify.Diagnostic(\"xUnit1044\").WithLocation(0).WithArguments(type.Replace(\"ValueTuple<string, int>\", \"(string, int)\"));\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp9, source, expectedUnsupported);\n\t\t\tawait Verify_v3_Pre301.VerifyAnalyzerV3(LanguageVersion.CSharp9, source, expectedUnsupported);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\t}\n\n\tpublic sealed class X1045_AvoidUsingTheoryDataTypeArgumentsThatMightNotBeSerializable : TheoryDataTypeArgumentsShouldBeSerializableTests\n\t{\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Uri\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Uri?\")]\n\t\tpublic async Task GivenTheory_WithTypeOnlySupportedInV3_TriggersInV2_DoesNotTriggerInV3(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expectedV2 = Verify.Diagnostic(\"xUnit1045\").WithLocation(0).WithArguments(type);\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp9, source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task IFormattableAndIParseable_TriggersInV2_DoesNotTriggerInV3()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\t#nullable enable\n\n\t\t\t\tusing System;\n\t\t\t\tusing System.Diagnostics.CodeAnalysis;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class Formattable : IFormattable\n\t\t\t\t{\n\t\t\t\t\tpublic string ToString(string? format, IFormatProvider? formatProvider) => string.Empty;\n\t\t\t\t}\n\n\t\t\t\tpublic class Parsable : IParsable<Parsable>\n\t\t\t\t{\n\t\t\t\t\tpublic static Parsable Parse(string s, IFormatProvider? provider) => new();\n\t\t\t\t\tpublic static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Parsable result)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = new();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic class FormattableAndParsable : IFormattable, IParsable<FormattableAndParsable>\n\t\t\t\t{\n\t\t\t\t\tpublic static FormattableAndParsable Parse(string s, IFormatProvider? provider) => new();\n\t\t\t\t\tpublic string ToString(string? format, IFormatProvider? formatProvider) => string.Empty;\n\t\t\t\t\tpublic static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out FormattableAndParsable result)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = new();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic static readonly TheoryData<Formattable> FormattableData = new TheoryData<Formattable>() { };\n\t\t\t\t\tpublic static readonly TheoryData<Parsable> ParsableData = new TheoryData<Parsable>() { };\n\t\t\t\t\tpublic static readonly TheoryData<FormattableAndParsable> FormattableAndParsableData = new TheoryData<FormattableAndParsable>() { };\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{|#0:MemberData(nameof(FormattableData))|}]\n\t\t\t\t\t[{|#1:MemberData(nameof(ParsableData))|}]\n\t\t\t\t\t[{|#2:MemberData(nameof(FormattableAndParsableData))|}]\n\t\t\t\t\tpublic void TestMethod(object parameter) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n#if ROSLYN_LATEST && NET8_0_OR_GREATER\n\t\t\tvar expectedV2 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithLocation(0).WithArguments(\"Formattable\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithLocation(1).WithArguments(\"Parsable\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithLocation(2).WithArguments(\"FormattableAndParsable\"),\n\t\t\t};\n\t\t\tvar expectedV3 = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithLocation(0).WithArguments(\"Formattable\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithLocation(1).WithArguments(\"Parsable\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp11, source, expectedV2);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp11, source, expectedV3);\n#else\n\t\t\t// For some reason, 'dotnet format' complains about the indenting of #nullable enable in the source code line\n\t\t\t// above if the #if statement surrounds the whole method, so we use this \"workaround\" to do nothing in that case.\n\t\t\tAssert.NotEqual(string.Empty, source);\n\t\t\tawait Task.Yield();\n#endif\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Tuple<string, int>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Tuple<string, int>?\")]\n\t\tpublic async Task GivenTheory_WithTuple_OnlySupportedInV3_3_0_1(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expectedUnsupported = Verify.Diagnostic(\"xUnit1045\").WithLocation(0).WithArguments(type);\n\n\t\t\tawait Verify.VerifyAnalyzerV2(LanguageVersion.CSharp9, source, expectedUnsupported);\n\t\t\tawait Verify_v3_Pre301.VerifyAnalyzerV3(LanguageVersion.CSharp9, source, expectedUnsupported);\n\t\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataMembers), \"object\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"object[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Array\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Array[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ValueType\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"ValueType[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IEnumerable\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IEnumerable[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IEnumerable<int>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IEnumerable<int>[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Dictionary<int, string>\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"Dictionary<int, string>[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IPossiblySerializableInterface\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"IPossiblySerializableInterface[]\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"PossiblySerializableUnsealedClass\")]\n\t\t[MemberData(nameof(TheoryDataMembers), \"PossiblySerializableUnsealedClass[]\")]\n\t\tpublic async Task GivenTheory_WithPossiblySerializableTheoryDataMember_Triggers(\n\t\t\tstring member,\n\t\t\tstring attribute,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Collections;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{0}\n\n\t\t\t\t\t[Theory]\n\t\t\t\t\t[{{|#0:{1}|}}]\n\t\t\t\t\tpublic void TestMethod({2} parameter) {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic interface IPossiblySerializableInterface {{ }}\n\n\t\t\t\tpublic class PossiblySerializableUnsealedClass {{ }}\n\t\t\t\t\"\"\", member, attribute, type);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit1045\").WithLocation(0).WithArguments(type);\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(TheoryDataClass), \"object[]\", \"Array\", \"IDisposable\")]\n\t\tpublic async Task GivenTheory_WithPossiblySerializableTheoryDataClass_Triggers(\n\t\t\tstring source,\n\t\t\tstring type1,\n\t\t\tstring type2,\n\t\t\tstring type3)\n\t\t{\n\t\t\tvar expected = new[] {\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithSpan(6, 3, 6, 34).WithArguments(type1),\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithSpan(6, 3, 6, 34).WithArguments(type2),\n\t\t\t\tVerify.Diagnostic(\"xUnit1045\").WithSpan(6, 3, 6, 34).WithArguments(type3),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tinternal class Analyzer_v3_Pre301 : TheoryDataTypeArgumentsShouldBeSerializable\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(3, 0, 0));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryMethodCannotHaveDefaultParameterTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryMethodCannotHaveDefaultParameter>;\nusing Verify_v2_Pre220 = CSharpVerifier<TheoryMethodCannotHaveDefaultParameterTests.Analyzer_v2_Pre220>;\n\npublic class TheoryMethodCannotHaveDefaultParameterTests\n{\n\t[Fact]\n\tpublic async Task TheoryWithDefaultParameter_WhenDefaultValueNotSupported_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, string c {|#0:= \"\"|}) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify_v2_Pre220.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"c\");\n\n\t\tawait Verify_v2_Pre220.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryWithDefaultParameter_WhenDefaultValueSupported_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, string c = \"\") { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tinternal class Analyzer_v2_Pre220 : TheoryMethodCannotHaveDefaultParameter\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 1, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryMethodCannotHaveParamsArrayTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryMethodCannotHaveParamsArray>;\nusing Verify_v2_Pre220 = CSharpVerifier<TheoryMethodCannotHaveParamsArrayTests.Analyzer_v2_Pre220>;\n\npublic class TheoryMethodCannotHaveParamsArrayTests\n{\n\t[Fact]\n\tpublic async Task TheoryWithParamsArrayAsync_WhenParamsArrayNotSupported_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, {|#0:params string[] c|}) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify_v2_Pre220.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"c\");\n\n\t\tawait Verify_v2_Pre220.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryWithParamsArrayAsync_WhenParamsArraySupported_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, params string[] c) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryWithNonParamsArrayAsync_WhenParamsArrayNotSupported_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, string[] c) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_v2_Pre220.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryWithNonParamsArrayAsync_WhenParamsArraySupported_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(int a, string b, string[] c) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tinternal class Analyzer_v2_Pre220 : TheoryMethodCannotHaveParamsArray\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 1, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryMethodMustHaveTestDataTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryMethodMustHaveTestData>;\n\npublic class TheoryMethodMustHaveTestDataTests\n{\n\t[Fact]\n\tpublic async Task FactMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryMethodWithDataAttributes_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(\"\")]\n\t\t\t\tpublic void TestMethod2() { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(string))]\n\t\t\t\tpublic void TestMethod3() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryMethodWithCustomDataAttribute_v3_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Reflection;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\t\t\tusing Xunit.Sdk;\n\t\t\tusing Xunit.v3;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[MyData]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\n\t\t\tpublic class MyData : Attribute, IDataAttribute {\n\t\t\t\tpublic bool? Explicit => throw new NotImplementedException();\n\t\t\t\tpublic string? Label => throw new NotImplementedException();\n\t\t\t\tpublic string? Skip => throw new NotImplementedException();\n\t\t\t\tpublic Type? SkipType => throw new NotImplementedException();\n\t\t\t\tpublic string? SkipUnless => throw new NotImplementedException();\n\t\t\t\tpublic string? SkipWhen => throw new NotImplementedException();\n\t\t\t\tpublic string? TestDisplayName => throw new NotImplementedException();\n\t\t\t\tpublic int? Timeout => throw new NotImplementedException();\n\t\t\t\tpublic string[]? Traits => throw new NotImplementedException();\n\n\t\t\t\tpublic ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(\n\t\t\t\t\tMethodInfo testMethod,\n\t\t\t\t\tDisposalTracker disposalTracker) =>\n\t\t\t\t\t\tthrow new NotImplementedException();\n\n\t\t\t\tpublic bool SupportsDiscoveryEnumeration() =>\n\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryMethodMissingData_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tpublic void [|TestMethod|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryMethodShouldHaveParametersTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryMethodShouldHaveParameters>;\n\npublic class TheoryMethodShouldHaveParametersTests\n{\n\t[Fact]\n\tpublic async Task FactMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryMethodWithParameters_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void TestMethod(string s) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task TheoryMethodWithoutParameters_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\t[Xunit.Theory]\n\t\t\t\tpublic void [|TestMethod|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/TheoryMethodShouldUseAllParametersTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryMethodShouldUseAllParameters>;\n\npublic class TheoryMethodShouldUseAllParametersTests\n{\n\t[Fact]\n\tpublic async Task ParameterNotReferenced_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int {|#0:unused|}) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"unused\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ParameterUnread_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int {|#0:unused|}) {\n\t\t\t\t\tunused = 3;\n\t\t\t\t\tint.TryParse(\"123\", out unused);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"unused\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task MultipleUnreadParameters_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int {|#0:foo|}, int {|#1:bar|}, int {|#2:baz|}) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"foo\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\", \"bar\"),\n\t\t\tVerify.Diagnostic().WithLocation(2).WithArguments(\"TestMethod\", \"TestClass\", \"baz\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task SomeUnreadParameters_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int {|#0:foo|}, int bar, int {|#1:baz|}) {\n\t\t\t\t\tConsole.WriteLine(bar);\n\t\t\t\t\tbaz = 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"foo\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"TestMethod\", \"TestClass\", \"baz\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ExpressionBodiedMethod_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int {|#0:unused|}) => Assert.Equal(5, 2 + 2);\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"unused\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ParameterRead_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int used) {\n\t\t\t\t\tConsole.WriteLine(used);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ParameterCapturedAsOutParameterInMockSetup_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(string used, int usedOut) {\n\t\t\t\t\t// mimicking mock setup use case\n\t\t\t\t\t// var mock = new Mock<IHaveOutParameter>();\n\t\t\t\t\t// mock.Setup(m => m.SomeMethod(out used));\n\t\t\t\t\tAction setup = () => int.TryParse(used, out usedOut);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ExpressionBodiedMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int used) => Assert.Equal(used, 2 + 2);\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenParameterIsDiscardNamed_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tvoid TestMethod(int used, string _, object _1, DateTime _42, double {|#0:_a|})\n\t\t\t\t{\n\t\t\t\t\tAssert.Equal(42, used);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\t// Only a single warning, for _a; everything else is either used or matches the discard pattern\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"TestMethod\", \"TestClass\", \"_a\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task DoesNotCrash_MethodWithoutBody()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Theory]\n\t\t\t\textern void TestMethod(int foo);\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X1000/UseCancellationTokenTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.UseCancellationToken>;\n\npublic class UseCancellationTokenTests\n{\n\t[Fact]\n\tpublic async Task NoCancellationToken_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tThread.Sleep(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task NonTestMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\tpublic async Task NonTestMethod() {\n\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WithAnyCancellationToken_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tFunctionWithDefaults(42, TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(42, cancellationToken: TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(cancellationToken: TestContext.Current.CancellationToken);\n\n\t\t\t\t\tvar token = new CancellationTokenSource().Token;\n\n\t\t\t\t\tFunctionWithDefaults(42, token);\n\t\t\t\t\tFunctionWithDefaults(42, cancellationToken: token);\n\t\t\t\t\tFunctionWithDefaults(cancellationToken: token);\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WithoutCancellationToken_V2_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV2(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WithoutCancellationToken_WithoutDirectUpgrade_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tFunctionWithOverload(42);\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(CancellationToken _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Fact]\n\tpublic async Task WithoutCancellationToken_V3_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t[|FunctionWithDefaults()|];\n\t\t\t\t\t[|FunctionWithDefaults(42)|];\n\t\t\t\t\t[|FunctionWithDefaults(42, default)|];\n\t\t\t\t\t[|FunctionWithDefaults(42, default(CancellationToken))|];\n\t\t\t\t\t[|FunctionWithDefaults(cancellationToken: default)|];\n\t\t\t\t\t[|FunctionWithDefaults(cancellationToken: default(CancellationToken))|];\n\n\t\t\t\t\t[|FunctionWithOverload(42)|];\n\t\t\t\t\t[|FunctionWithOverload(42, default)|];\n\t\t\t\t\t[|FunctionWithOverload(42, default(CancellationToken))|];\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default) { }\n\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7_1, source);\n\t}\n\n\t[Fact]\n\tpublic async Task InsideLambda_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tasync Task InnerMethod() {\n\t\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t\t}\n\t\t\t\t\tFunc<Task> _ = async () => await Task.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source);\n\t}\n\n\t[Fact]\n\tpublic async Task InsideAssertionLambda_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async ValueTask TestMethod() {\n\t\t\t\t\tawait Assert.CollectionAsync(Array.Empty<int>(), x => [|Task.Delay(x)|], x => [|Task.Delay(x)|]);\n\t\t\t\t\tawait Assert.ThrowsAsync<Exception>(() => [|Task.Delay(1)|]);\n\t\t\t\t\tawait Record.ExceptionAsync(() => [|Task.Delay(1)|]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp7, source);\n\t}\n\n\t[Fact]\n\tpublic async Task WhenOverloadIsObsolete_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tFunctionWithOverload(42);\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithOverload(int _) {{ }}\n\t\t\t\t[Obsolete]\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) {{ }}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertCollectionContainsShouldNotUseBoolCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertCollectionContainsShouldNotUseBoolCheck>;\n\npublic class AssertCollectionContainsShouldNotUseBoolCheckTests\n{\n\tpublic static TheoryData<string> Collections =\n\t[\n\t\t\"new System.Collections.Generic.List<int>()\",\n\t\t\"new System.Collections.Generic.HashSet<int>()\",\n\t\t\"new System.Collections.ObjectModel.Collection<int>()\",\n\t];\n\tpublic static TheoryData<string> Enumerables =\n\t[\n\t\t\"new int[0]\",\n\t\t\"System.Linq.Enumerable.Empty<int>()\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task TrueCollectionContainsCheck_Triggers(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.True({0}.Contains(1))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.Contains);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task FalseCollectionContainsCheck_Triggers(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.False({0}.Contains(1))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.False()\", Constants.Asserts.DoesNotContain);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task TrueLinqContainsCheck_Triggers(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.True({0}.Contains(1))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.Contains);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task TrueLinqContainsCheckWithEqualityComparer_Triggers(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.True({0}.Contains(1, System.Collections.Generic.EqualityComparer<int>.Default))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.Contains);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task FalseLinqContainsCheck_Triggers(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.False({0}.Contains(1))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.False()\", Constants.Asserts.DoesNotContain);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task FalseLinqContainsCheckWithEqualityComparer_Triggers(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.False({0}.Contains(1, System.Collections.Generic.EqualityComparer<int>.Default))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.False()\", Constants.Asserts.DoesNotContain);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task TrueCollectionContainsCheckWithAssertionMessage_DoesNotTrigger(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.True({0}.Contains(1), \"Custom message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task FalseCollectionContainsCheckWithAssertionMessage_DoesNotTrigger(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.False({0}.Contains(1), \"Custom message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task TrueLinqContainsCheckWithAssertionMessage_DoesNotTrigger(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.True({0}.Contains(1), \"Custom message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Enumerables))]\n\tpublic async Task FalseLinqContainsCheckWithAssertionMessage_DoesNotTrigger(string enumerable)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.False({0}.Contains(1), \"Custom message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", enumerable);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task CollectionWithDifferentTypeParametersThanICollectionImplementation_ZeroParameters_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\n\t\t\tclass IntList : List<int> { }\n\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t[|Xunit.Assert.False(new IntList().Contains(1))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task CollectionWithDifferentTypeParametersThanICollectionImplementation_TwoParameters_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.False(new Dictionary<int, int>().ContainsKey(1));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEmptyCollectionCheckShouldNotBeUsedTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEmptyCollectionCheckShouldNotBeUsed>;\n\npublic class AssertEmptyCollectionCheckShouldNotBeUsedTests\n{\n\tpublic static TheoryData<string> Collections =\n\t[\n\t\t\"new int[0]\",\n\t\t\"new System.Collections.Generic.List<int>()\",\n\t\t\"new System.Collections.Generic.HashSet<int>()\",\n\t\t\"new System.Collections.ObjectModel.Collection<int>()\",\n\t\t\"System.Linq.Enumerable.Empty<int>()\",\n#if NETCOREAPP3_0_OR_GREATER\n\t\t\"default(System.Collections.Generic.IAsyncEnumerable<int>)\",\n#endif\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task CollectionCheckWithoutAction_Triggers(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.Collection({0})|];\n\t\t\t\t\t[|Xunit.Assert.CollectionAsync({0})|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Collections))]\n\tpublic async Task CollectionCheckWithAction_DoesNotTrigger(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Collection({0}, i => Xunit.Assert.True(true));\n\t\t\t\t\tXunit.Assert.CollectionAsync({0}, async i => {{ await System.Threading.Tasks.Task.Yield(); Xunit.Assert.True(true); }});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecks>;\n\npublic class AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksTests\n{\n\tpublic static TheoryData<string, string> GetEnumerables(\n\t\tstring typeName,\n\t\tstring comparison) =>\n\t\t\tnew()\n\t\t\t{\n\t\t\t\t{ $\"new System.Collections.Generic.List<{typeName}>()\", comparison },\n\t\t\t\t{ $\"new System.Collections.Generic.HashSet<{typeName}>()\", comparison },\n\t\t\t\t{ $\"new System.Collections.ObjectModel.Collection<{typeName}>()\", comparison },\n\t\t\t\t{ $\"new {typeName}[0]\", comparison },\n\t\t\t\t{ $\"System.Linq.Enumerable.Empty<{typeName}>()\", comparison },\n\t\t\t};\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"\")]\n\tpublic async Task Containers_WithoutWhereClause_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring _)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Empty({0});\n\t\t\t\t\tXunit.Assert.NotEmpty({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task Containers_WithWhereClauseWithIndex_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Empty({0}.Where((f, i) => {1} && i > 0));\n\t\t\t\t\tXunit.Assert.NotEmpty({0}.Where((f, i) => {1} && i > 0));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task EnumurableEmptyCheck_WithChainedLinq_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Empty({0}.Where(f => {1}).Select(f => f));\n\t\t\t\t\tXunit.Assert.NotEmpty({0}.Where(f => {1}).Select(f => f));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task Containers_WithWhereClause_Triggers(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|xUnit2029:Xunit.Assert.Empty({0}.Where(f => {1}))|}};\n\t\t\t\t\t{{|xUnit2030:Xunit.Assert.NotEmpty({0}.Where(f => {1}))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\")]\n\t[InlineData(\"123\")]\n\t[InlineData(@\"abc\\n\\t\\\\\\\"\"\")]\n\tpublic async Task Strings_WithWhereClause_Triggers(string sampleString)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|xUnit2029:Xunit.Assert.Empty(\"{0}\".Where(f => f > 0))|}};\n\t\t\t\t\t{{|xUnit2030:Xunit.Assert.NotEmpty(\"{0}\".Where(f => f > 0))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", sampleString);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck>;\n\npublic class AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\tConstants.Asserts.True,\n\t\tConstants.Asserts.False,\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForLinqAnyCheck_Triggers(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.{0}(new [] {{ 1 }}.Any(i => true))|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualGenericShouldNotBeUsedForStringValueTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualGenericShouldNotBeUsedForStringValue>;\n\npublic class AssertEqualGenericShouldNotBeUsedForStringValueTests\n{\n\tpublic static TheoryData<string, string> Data = new()\n\t{\n\t\t{ \"true.ToString()\", \"\\\"True\\\"\" },\n\t\t{ \"1.ToString()\", \"\\\"1\\\"\" },\n\t\t{ \"\\\"\\\"\", \"null\" },\n\t\t{ \"null\", \"\\\"\\\"\" },\n\t\t{ \"\\\"\\\"\", \"\\\"\\\"\" },\n\t\t{ \"\\\"abc\\\"\", \"\\\"abc\\\"\" },\n\t\t{ \"\\\"TestMethod\\\"\", \"nameof(TestMethod)\" },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(Data))]\n\tpublic async Task StringEqualityCheckWithoutGenericType_DoesNotTrigger(\n\t\tstring expected,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Equal({0}, {1});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", expected, value);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Data))]\n\tpublic async Task StringEqualityCheckWithGenericType_Triggers(\n\t\tstring expected,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.Equal<string>({0}, {1})|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", expected, value);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Data))]\n\tpublic async Task StrictStringEqualityCheck_Triggers(\n\t\tstring expected,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.StrictEqual({0}, {1})|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", expected, value);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Data))]\n\tpublic async Task StrictStringEqualityCheckWithGenericType_Triggers(\n\t\tstring expected,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.StrictEqual<string>({0}, {1})|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", expected, value);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualLiteralValueShouldBeFirstTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualLiteralValueShouldBeFirst>;\n\npublic class AssertEqualLiteralValueShouldBeFirstTests\n{\n\t[Fact]\n\tpublic async Task WhenConstantOrLiteralUsedForBothArguments_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.Equal(\"TestMethod\", nameof(TestMethod));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tpublic static TheoryData<string, string> TypesAndValues = new()\n\t{\n\t\t{ \"int\", \"0\" },\n\t\t{ \"int\", \"0.0\" },\n\t\t{ \"int\", \"sizeof(int)\" },\n\t\t{ \"int\", \"default(int)\" },\n\t\t{ \"string\", \"null\" },\n\t\t{ \"string\", \"\\\"\\\"\" },\n\t\t{ \"string\", \"nameof(TestMethod)\" },\n\t\t{ \"System.Type\", \"typeof(string)\" },\n\t\t{ \"System.AttributeTargets\", \"System.AttributeTargets.Constructor\" },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(TypesAndValues))]\n\tpublic async Task ExpectedConstantOrLiteralValueAsFirstArgument_DoesNotTrigger(\n\t\tstring type,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar v = default({0});\n\t\t\t\t\tXunit.Assert.Equal({1}, v);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", type, value);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ConstantsUsedInStringConstructorAsFirstArgument_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.Equal(new string(' ', 4), \"    \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(TypesAndValues))]\n\tpublic async Task ExpectedConstantOrLiteralValueAsSecondArgument_Triggers(\n\t\tstring type,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar v = default({0});\n\t\t\t\t\t{{|#0:Xunit.Assert.Equal(v, {1})|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", type, value);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(value, \"Assert.Equal(expected, actual)\", \"TestMethod\", \"TestClass\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(true)]\n\t[InlineData(false)]\n\tpublic async Task ExpectedConstantOrLiteralValueAsNamedExpectedArgument_DoesNotTrigger(bool useAlternateForm)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar v = default(int);\n\t\t\t\t\tXunit.Assert.Equal({0}actual: v, {0}expected: 0);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", useAlternateForm ? \"@\" : \"\");\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(TypesAndValues))]\n\tpublic async Task ExpectedConstantOrLiteralValueAsNamedExpectedArgument_Triggers(\n\t\tstring type,\n\t\tstring value)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar v = default({0});\n\t\t\t\t\t{{|#0:Xunit.Assert.Equal(actual: {1}, expected: v)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", type, value);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(value, \"Assert.Equal(expected, actual)\", \"TestMethod\", \"TestClass\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(\"Equal\", \"{|CS1739:act|}\", \"exp\")]\n\t[InlineData(\"{|CS1501:Equal|}\", \"expected\", \"expected\")]\n\t[InlineData(\"{|CS1501:Equal|}\", \"actual\", \"actual\")]\n\t[InlineData(\"Equal\", \"{|CS1739:foo|}\", \"bar\")]\n\tpublic async Task DoesNotFindWarningWhenArgumentsAreNotNamedCorrectly(\n\t\tstring methodName,\n\t\tstring firstArgumentName,\n\t\tstring secondArgumentName)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar v = default(int);\n\t\t\t\t\tXunit.Assert.{0}({1}: 1, {2}: v);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", methodName, firstArgumentName, secondArgumentName);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualPrecisionShouldBeInRangeTest.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualPrecisionShouldBeInRange>;\n\npublic class AssertEqualPrecisionShouldBeInRangeTest\n{\n\tstatic readonly string Template = /* lang=c#-test */ \"\"\"\n\t\tclass TestClass {{\n\t\t\tvoid TestMethod() {{\n\t\t\t\t{0}\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(0)]\n\t[InlineData(1)]\n\t[InlineData(8)]\n\t[InlineData(14)]\n\t[InlineData(15)]\n\tpublic async Task DoesNotFindError_ForDoubleArgumentWithPrecisionProvidedInRange(int precision)\n\t{\n\t\tvar source = string.Format(\n\t\t\tTemplate,\n\t\t\t$\"double num = 0.133d; Xunit.Assert.Equal(0.13d, num, {precision});\"\n\t\t);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(int.MinValue)]\n\t[InlineData(-2000)]\n\t[InlineData(-1)]\n\t[InlineData(16)]\n\t[InlineData(17000)]\n\t[InlineData(int.MaxValue)]\n\tpublic async Task FindsError_ForDoubleArgumentWithPrecisionProvidedOutOfRange(int precision)\n\t{\n\t\tvar source = string.Format(\n\t\t\tTemplate,\n\t\t\t$\"double num = 0.133d; Xunit.Assert.Equal(0.13d, num, {{|#0:{precision}|}});\"\n\t\t);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"[0..15]\", \"double\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(0)]\n\t[InlineData(1)]\n\t[InlineData(14)]\n\t[InlineData(27)]\n\t[InlineData(28)]\n\tpublic async Task DoesNotFindError_ForDecimalArgumentWithPrecisionProvidedInRange(int precision)\n\t{\n\t\tvar source = string.Format(\n\t\t\tTemplate,\n\t\t\t$\"decimal num = 0.133m; Xunit.Assert.Equal(0.13m, num, {precision});\"\n\t\t);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(int.MinValue)]\n\t[InlineData(-2000)]\n\t[InlineData(-1)]\n\t[InlineData(29)]\n\t[InlineData(30000)]\n\t[InlineData(int.MaxValue)]\n\tpublic async Task FindsError_ForDecimalArgumentWithPrecisionProvidedOutOfRange(int precision)\n\t{\n\t\tvar source = string.Format(\n\t\t\tTemplate,\n\t\t\t$\"decimal num = 0.133m; Xunit.Assert.Equal(0.13m, num, {{|#0:{precision}|}});\"\n\t\t);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"[0..28]\", \"decimal\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualShouldNotBeUsedForBoolLiteralCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForBoolLiteralCheck>;\n\npublic class AssertEqualShouldNotBeUsedForBoolLiteralCheckTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t\tConstants.Asserts.StrictEqual,\n\t\tConstants.Asserts.NotStrictEqual,\n\t];\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.Equal, Constants.Asserts.True)]\n\t[InlineData(Constants.Asserts.StrictEqual, Constants.Asserts.True)]\n\t[InlineData(Constants.Asserts.NotEqual, Constants.Asserts.False)]\n\t[InlineData(Constants.Asserts.NotStrictEqual, Constants.Asserts.False)]\n\tpublic async Task ForFirstBoolLiteral_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tbool val = true;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(true, val)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.Equal, Constants.Asserts.False)]\n\t[InlineData(Constants.Asserts.NotEqual, Constants.Asserts.True)]\n\tpublic async Task ForFirstBoolLiteral_WithCustomComparer_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tbool val = false;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(false, val, System.Collections.Generic.EqualityComparer<bool>.Default)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForFirstBoolLiteral_ObjectOverload_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tobject val = false;\n\t\t\t\t\tXunit.Assert.{0}(true, val);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForOtherLiteral_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tint val = 1;\n\t\t\t\t\tXunit.Assert.{0}(1, val);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForSecondBoolLiteral_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tbool val = false;\n\t\t\t\t\tXunit.Assert.{0}(val, true);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualShouldNotBeUsedForCollectionSizeCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForCollectionSizeCheck>;\n\npublic class AssertEqualShouldNotBeUsedForCollectionSizeCheckTests\n{\n\tpublic static TheoryData<string> AllowedCollections =\n\t[\n\t\t\"new System.ArraySegment<int>().Count\",\n\t\t\"Microsoft.Extensions.Primitives.StringValues.Empty.Count\",\n\t];\n\tpublic static TheoryData<string> DisallowedCollections =\n\t[\n\t\t\"new int[0].Length\",\n\t\t\"new System.Collections.ArrayList().Count\",\n\t\t\"new System.Collections.Generic.List<int>().Count\",\n\t\t\"new System.Collections.Generic.HashSet<int>().Count\",\n\t\t\"System.Collections.Immutable.ImmutableArray.Create<int>().Length\",\n\t\t\"new System.Collections.ObjectModel.Collection<int>().Count\",\n\t\t\"new System.Collections.Generic.List<int>().AsReadOnly().Count\",\n\t\t\"System.Linq.Enumerable.Empty<int>().Count()\",\n\t];\n\tpublic static TheoryData<string> DisallowedCollectionInterfaces =\n\t[\n\t\t\"ICollection\",\n\t\t\"ICollection<string>\",\n\t\t\"IReadOnlyCollection<string>\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(AllowedCollections))]\n\tpublic async Task AllowedCollection_DoesNotTrigger(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Equal(0, {0});\n\t\t\t\t\tXunit.Assert.Equal(1, {0});\n\t\t\t\t\tXunit.Assert.NotEqual(0, {0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AllowedCollections))]\n\t[MemberData(nameof(DisallowedCollections))]\n\tpublic async Task AllowedCheck_DoesNotTrigger(string collection)\n\t{\n\t\t// Anything that's non-zero for Equal/NotEqual and non-one for Equal is allowed\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Equal(2, {0});\n\t\t\t\t\tXunit.Assert.NotEqual(1, {0});\n\t\t\t\t\tXunit.Assert.NotEqual(2, {0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\n\t[Theory]\n\t[MemberData(nameof(DisallowedCollections))]\n\tpublic async Task InvalidCheckWithConcreteType_Triggers(string collection)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.Equal(0, {0})|}};\n\t\t\t\t\t{{|#1:Xunit.Assert.Equal(1, {0})|}};\n\t\t\t\t\t{{|#2:Xunit.Assert.NotEqual(0, {0})|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Equal()\", Constants.Asserts.Empty),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"Assert.Equal()\", Constants.Asserts.Single),\n\t\t\tVerify.Diagnostic().WithLocation(2).WithArguments(\"Assert.NotEqual()\", Constants.Asserts.NotEmpty),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(DisallowedCollectionInterfaces))]\n\tpublic async Task InvalidCheckWithInterfaceType_Triggers(string @interface)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{0} collection = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.Equal(0, collection.Count)|}};\n\t\t\t\t\t{{|#1:Xunit.Assert.Equal(1, collection.Count)|}};\n\t\t\t\t\t{{|#2:Xunit.Assert.NotEqual(0, collection.Count)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", @interface);\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Equal()\", Constants.Asserts.Empty),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"Assert.Equal()\", Constants.Asserts.Single),\n\t\t\tVerify.Diagnostic().WithLocation(2).WithArguments(\"Assert.NotEqual()\", Constants.Asserts.NotEmpty),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task InvalidCheckWithCustomNonGenericCollection_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tclass IntCollection : ICollection<int> {\n\t\t\t\tpublic int Count { get { throw null; } }\n\t\t\t\tpublic bool IsReadOnly { get { throw null; } }\n\t\t\t\tpublic void Add(int item) { throw null; }\n\t\t\t\tpublic void Clear() { throw null; }\n\t\t\t\tpublic bool Contains(int item) { throw null; }\n\t\t\t\tpublic void CopyTo(int[] array, int arrayIndex) { throw null; }\n\t\t\t\tpublic IEnumerator<int> GetEnumerator() { throw null; }\n\t\t\t\tpublic bool Remove(int item) { throw null; }\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() { throw null; }\n\t\t\t}\n\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|#0:Assert.Equal(0, new IntCollection().Count)|};\n\t\t\t\t\t{|#1:Assert.Equal(1, new IntCollection().Count)|};\n\t\t\t\t\t{|#2:Assert.NotEqual(0, new IntCollection().Count)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Equal()\", Constants.Asserts.Empty),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"Assert.Equal()\", Constants.Asserts.Single),\n\t\t\tVerify.Diagnostic().WithLocation(2).WithArguments(\"Assert.NotEqual()\", Constants.Asserts.NotEmpty),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task OverridingCountMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\n\t\t\tinterface IIntCollection : ICollection<int> {\n\t\t\t\tnew int Count { get; }\n\t\t\t}\n\n\t\t\tinterface ICustomCollection<T> : ICollection<T> {\n\t\t\t\tnew int Count { get; }\n\t\t\t}\n\n\t\t\tinterface ICustomDictionary<K, V> : ICollection<KeyValuePair<K, V>> {\n\t\t\t\tnew int Count { get; }\n\t\t\t}\n\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.Equal(1, ((IIntCollection)null).Count);\n\t\t\t\t\tXunit.Assert.Equal(1, ((ICustomCollection<int>)null).Count);\n\t\t\t\t\tXunit.Assert.Equal(1, ((ICustomDictionary<int, int>)null).Count);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForNonIntArguments_DoesNotCrash()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.Equal('b', new int[0].Length);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualShouldNotBeUsedForNullCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForNullCheck>;\n\npublic class AssertEqualShouldNotBeUsedForNullCheckTests\n{\n\tpublic static TheoryData<string> Methods_All =\n\t[\n\t\tConstants.Asserts.Equal,\n\t\tConstants.Asserts.NotEqual,\n\t\tConstants.Asserts.StrictEqual,\n\t\tConstants.Asserts.NotStrictEqual,\n\t\tConstants.Asserts.Same,\n\t\tConstants.Asserts.NotSame,\n\t];\n\tpublic static TheoryData<string, string> Methods_Equal_WithReplacement = new()\n\t{\n\t\t{ Constants.Asserts.Equal, Constants.Asserts.Null },\n\t\t{ Constants.Asserts.NotEqual, Constants.Asserts.NotNull }\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(Methods_Equal_WithReplacement))]\n\tpublic async Task ForFirstNullLiteral_StringOverload_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tstring val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(null, val)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_Equal_WithReplacement))]\n\tpublic async Task ForFirstNullLiteral_StringOverload_WithCustomComparer_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tstring val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(null, val, System.StringComparer.Ordinal)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.Equal, Constants.Asserts.Null)]\n\t[InlineData(Constants.Asserts.StrictEqual, Constants.Asserts.Null)]\n\t[InlineData(Constants.Asserts.Same, Constants.Asserts.Null)]\n\t[InlineData(Constants.Asserts.NotEqual, Constants.Asserts.NotNull)]\n\t[InlineData(Constants.Asserts.NotStrictEqual, Constants.Asserts.NotNull)]\n\t[InlineData(Constants.Asserts.NotSame, Constants.Asserts.NotNull)]\n\tpublic async Task ForFirstNullLiteral_ObjectOverload_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tobject val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(null, val)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_Equal_WithReplacement))]\n\tpublic async Task ForFirstNullLiteral_ObjectOverload_WithCustomComparer_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tobject val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(null, val, System.Collections.Generic.EqualityComparer<object>.Default)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.Equal, Constants.Asserts.Null)]\n\t[InlineData(Constants.Asserts.NotEqual, Constants.Asserts.NotNull)]\n\t[InlineData(Constants.Asserts.StrictEqual, Constants.Asserts.Null)]\n\t[InlineData(Constants.Asserts.NotStrictEqual, Constants.Asserts.NotNull)]\n\tpublic async Task ForFirstNullLiteral_GenericOverload_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tTestClass val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}<TestClass>(null, val)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_Equal_WithReplacement))]\n\tpublic async Task ForFirstNullLiteral_GenericOverload_WithCustomComparer_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tTestClass val = null;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}<TestClass>(null, val, System.Collections.Generic.EqualityComparer<TestClass>.Default)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_All))]\n\tpublic async Task ForOtherLiteral_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tint val = 1;\n\t\t\t\t\tXunit.Assert.{0}(1, val);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_All))]\n\tpublic async Task ForSecondNullLiteral_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tstring val = null;\n\t\t\t\t\tXunit.Assert.{0}(val, null);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertEqualsShouldNotBeUsedTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualsShouldNotBeUsed>;\n\npublic class AssertEqualsShouldNotBeUsedTests\n{\n\t[Theory]\n\t[InlineData(nameof(object.Equals), Constants.Asserts.Equal)]\n\t[InlineData(nameof(object.ReferenceEquals), Constants.Asserts.Same)]\n\tpublic async Task WhenProhibitedMethodIsUsed_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = $@\"\nclass TestClass {{\n\tvoid TestMethod() {{\n\t\t{{|#0:{{|CS0619:Xunit.Assert.{method}(null, null)|}}|}};\n\t}}\n}}\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertIsTypeShouldNotBeUsedForAbstractTypeTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertIsTypeShouldNotBeUsedForAbstractType>;\nusing Verify_v2_Pre2_9_3 = CSharpVerifier<AssertIsTypeShouldNotBeUsedForAbstractTypeTests.Analyzer_v2_Pre2_9_3>;\nusing Verify_v3_Pre0_6_0 = CSharpVerifier<AssertIsTypeShouldNotBeUsedForAbstractTypeTests.Analyzer_v3_Pre0_6_0>;\n\npublic class AssertIsTypeShouldNotBeUsedForAbstractTypeTests\n{\n\tpublic static TheoryData<string> Methods = [\"IsType\", \"IsNotType\"];\n\tpublic static TheoryData<string, string, bool> MethodsWithReplacements = new()\n\t{\n\t\t{ \"IsType\", \"Assert.IsAssignableFrom\", false },\n\t\t{ \"IsType\", \"exactMatch: false\", true },\n\t\t{ \"IsNotType\", \"Assert.IsNotAssignableFrom\", false },\n\t\t{ \"IsNotType\", \"exactMatch: false\", true },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(MethodsWithReplacements))]\n\tpublic async Task Interface_Triggers(\n\t\tstring method,\n\t\tstring replacement,\n\t\tbool supportsInexactTypeAssertions)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Assert.{0}<IDisposable>(new object())|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"interface\", \"System.IDisposable\", replacement);\n\n\t\tif (supportsInexactTypeAssertions)\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\telse\n\t\t{\n\t\t\tawait Verify_v2_Pre2_9_3.VerifyAnalyzer(source, expected);\n\t\t\tawait Verify_v3_Pre0_6_0.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task Interface_WithExactMatchFlag_TriggersForTrue(string method)\n\t{\n\t\t// We can only trigger when we know the literal true is being used; anything else,\n\t\t// we let the runtime figure it out.\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar flag = true;\n\n\t\t\t\t\t{{|#0:Assert.{0}<IDisposable>(new object(), true)|}};\n\t\t\t\t\t{{|#1:Assert.{0}<IDisposable>(new object(), exactMatch: true)|}};\n\t\t\t\t\tAssert.{0}<IDisposable>(new object(), flag);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"interface\", \"System.IDisposable\", \"exactMatch: false\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"interface\", \"System.IDisposable\", \"exactMatch: false\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(MethodsWithReplacements))]\n\tpublic async Task AbstractClass_Triggers(\n\t\tstring method,\n\t\tstring replacement,\n\t\tbool supportsInexactTypeAssertions)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.IO;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Assert.{0}<Stream>(new object())|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"abstract class\", \"System.IO.Stream\", replacement);\n\n\t\tif (supportsInexactTypeAssertions)\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\telse\n\t\t{\n\t\t\tawait Verify_v2_Pre2_9_3.VerifyAnalyzer(source, expected);\n\t\t\tawait Verify_v3_Pre0_6_0.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task AbstractClass_WithExactMatchFlag_TriggersForTrue(string method)\n\t{\n\t\t// We can only trigger when we know the literal true is being used; anything else,\n\t\t// we let the runtime figure it out.\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.IO;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar flag = true;\n\n\t\t\t\t\t{{|#0:Assert.{0}<Stream>(new object(), true)|}};\n\t\t\t\t\t{{|#1:Assert.{0}<Stream>(new object(), exactMatch: true)|}};\n\t\t\t\t\tAssert.{0}<Stream>(new object(), flag);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"abstract class\", \"System.IO.Stream\", \"exactMatch: false\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"abstract class\", \"System.IO.Stream\", \"exactMatch: false\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(MethodsWithReplacements))]\n\tpublic async Task UsingStatic_Triggers(\n\t\tstring method,\n\t\tstring replacement,\n\t\tbool supportsInexactTypeAssertions)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing static Xunit.Assert;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:{0}<IDisposable>(new object())|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"interface\", \"System.IDisposable\", replacement);\n\n\t\tif (supportsInexactTypeAssertions)\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\telse\n\t\t{\n\t\t\tawait Verify_v2_Pre2_9_3.VerifyAnalyzer(source, expected);\n\t\t\tawait Verify_v3_Pre0_6_0.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task NonAbstractClass_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar flag = true;\n\n\t\t\t\t\tAssert.{0}<string>(new object());\n\t\t\t\t\tAssert.{0}<string>(new object(), flag);\n\t\t\t\t\tAssert.{0}<string>(new object(), exactMatch: flag);\n\t\t\t\t\tAssert.{0}<string>(new object(), true);\n\t\t\t\t\tAssert.{0}<string>(new object(), exactMatch: true);\n\t\t\t\t\tAssert.{0}<string>(new object(), false);\n\t\t\t\t\tAssert.{0}<string>(new object(), exactMatch: false);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tinternal class Analyzer_v2_Pre2_9_3 : AssertIsTypeShouldNotBeUsedForAbstractType\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 9, 2));\n\t}\n\n\tinternal class Analyzer_v3_Pre0_6_0 : AssertIsTypeShouldNotBeUsedForAbstractType\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(0, 5, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertIsTypeShouldUseGenericOverloadTypeTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertIsTypeShouldUseGenericOverloadType>;\n\n#if NETCOREAPP\nusing Microsoft.CodeAnalysis.CSharp;\n#endif\n\npublic class AssertIsTypeShouldUseGenericOverloadTypeTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\t\"IsType\",\n\t\t\"IsNotType\",\n\t\t\"IsAssignableFrom\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForNonGenericCall_Triggers(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(typeof(int), 1)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"int\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForGenericCall_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}<int>(1);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"IsType\")]\n\t[InlineData(\"IsNotType\")]\n\tpublic async Task ForGenericCall_WithExactMatchFlag_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}<int>(1, false);\n\t\t\t\t\tXunit.Assert.{0}<System.Type>(typeof(int), true);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n#if NETCOREAPP\n\n\tpublic class StaticAbstractInterfaceMethods\n\t{\n#if ROSLYN_LATEST  // C# 11 is required for static abstract methods\n\n\t\tconst string methodCode = /* lang=c#-test */ \"static abstract void Method();\";\n\t\tconst string codeTemplate = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic interface IParentClass  {{\n\t\t\t\t{0}\n\t\t\t}}\n\n\t\t\tpublic interface IClass : IParentClass {{\n\t\t\t\t{1}\n\t\t\t}}\n\n\t\t\tpublic class Class : IClass {{\n\t\t\t\tpublic static void Method() {{ }}\n\t\t\t}}\n\n\t\t\tpublic abstract class TestClass {{\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tvar data = new Class();\n\n\t\t\t\t\tAssert.IsAssignableFrom(typeof(IClass), data);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\";\n\n\t\t[Fact]\n\t\tpublic async Task ForStaticAbstractInterfaceMembers_DoesNotTrigger()\n\t\t{\n\t\t\tstring source = string.Format(codeTemplate, string.Empty, methodCode);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp11, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ForNestedStaticAbstractInterfaceMembers_DoesNotTrigger()\n\t\t{\n\t\t\tstring source = string.Format(codeTemplate, methodCode, string.Empty);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp11, source);\n\t\t}\n\n#endif\n\n\t\t[Theory]\n\t\t[InlineData(\"static\", \"\", \"{ }\")]\n\t\t[InlineData(\"\", \"abstract\", \";\")]\n\t\tpublic async Task ForNotStaticAbstractInterfaceMembers_Triggers(\n\t\t\tstring staticModifier,\n\t\t\tstring abstractModifier,\n\t\t\tstring methodBody)\n\t\t{\n\t\t\tstring source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic interface IClass {{\n\t\t\t\t\t{0} {1} void Method() {2}\n\t\t\t\t}}\n\n\t\t\t\tpublic class Class : IClass {{\n\t\t\t\t\tpublic {0} void Method() {{ }}\n\t\t\t\t}}\n\n\t\t\t\tpublic abstract class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar data = new Class();\n\n\t\t\t\t\t\t{{|#0:Assert.IsAssignableFrom(typeof(IClass), data)|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", staticModifier, abstractModifier, methodBody);\n\t\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"IClass\");\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\t}\n\n#endif\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertNullShouldNotBeCalledOnValueTypesTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertNullShouldNotBeCalledOnValueTypes>;\n\npublic class AssertNullShouldNotBeCalledOnValueTypesTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\t\"Null\",\n\t\t\"NotNull\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForValueType_Triggers(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tint val = 1;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(val)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\");\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForNullableValueType_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tint? val = 1;\n\t\t\t\t\tXunit.Assert.{0}(val);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForNullableReferenceType_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tstring val = null;\n\t\t\t\t\tXunit.Assert.{0}(val);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForPointerType_v3_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {\n\t\t\t\tunsafe void TestMethod() {\n\t\t\t\t\tvar value = 42;\n\t\t\t\t\tvar ptr = &value;\n\n\t\t\t\t\tAssert.Null(ptr);\n\t\t\t\t\tAssert.NotNull(ptr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForClassConstrainedGenericTypes_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass Class<T> where T : class {{\n\t\t\t\tpublic void Method(T arg) {{\n\t\t\t\t\tXunit.Assert.{0}(arg);\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForInterfaceConstrainedGenericTypes_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tinterface IDo {{ }}\n\n\t\t\tclass Class<T> where T : IDo {{\n\t\t\t\tpublic void Method(System.Collections.Generic.IEnumerable<T> collection) {{\n\t\t\t\t\tforeach (T item in collection) {{\n\t\t\t\t\t\tXunit.Assert.{0}(item);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForUnconstrainedGenericTypes_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass Class<T> {{\n\t\t\t\tpublic void Method(System.Collections.Generic.IEnumerable<T> collection) {{\n\t\t\t\t\tforeach (T item in collection) {{\n\t\t\t\t\t\tXunit.Assert.{0}(item);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\t// https://github.com/xunit/xunit/issues/2395\n\tpublic async Task ForUserDefinedImplicitConversion_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyInt)42);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyInt)(int?)42);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyIntBase)42);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyIntBase)(int?)42);\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic abstract class MyBuggyIntBase {{\n\t\t\t\tpublic static implicit operator MyBuggyIntBase(int i) => new MyBuggyInt();\n\t\t\t}}\n\n\t\t\tpublic class MyBuggyInt : MyBuggyIntBase {{\n\t\t\t\tpublic MyBuggyInt() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertRegexMatchShouldNotUseBoolLiteralCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertRegexMatchShouldNotUseBoolLiteralCheck>;\n\npublic class AssertRegexMatchShouldNotUseBoolLiteralCheckTests\n{\n\tpublic static TheoryData<string, string> Methods_WithReplacement = new()\n\t{\n\t\t{ Constants.Asserts.True, Constants.Asserts.Matches },\n\t\t{ Constants.Asserts.False, Constants.Asserts.DoesNotMatch },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task ForStaticRegexIsMatch_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(System.Text.RegularExpressions.Regex.IsMatch(\"abc\", \"\\\\w*\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task ForInstanceRegexIsMatchWithInlineConstructedRegex_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(new System.Text.RegularExpressions.Regex(\"abc\").IsMatch(\"\\\\w*\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task ForInstanceRegexIsMatchWithConstructedRegexVariable_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tvar regex = new System.Text.RegularExpressions.Regex(\"abc\");\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(regex.IsMatch(\"\\\\w*\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertSameShouldNotBeCalledOnValueTypesTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSameShouldNotBeCalledOnValueTypes>;\n\npublic class AssertSameShouldNotBeCalledOnValueTypesTests\n{\n\tpublic static TheoryData<string, string> Methods_WithReplacement = new()\n\t{\n\t\t{ Constants.Asserts.Same, Constants.Asserts.Equal },\n\t\t{ Constants.Asserts.NotSame, Constants.Asserts.NotEqual },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task TwoValueParameters_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tint a = 0;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(0, a)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task FirstValueParameters_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tobject a = 0;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(0, a)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task SecondValueParameters_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tobject a = 0;\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(a, 0)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\t// https://github.com/xunit/xunit/issues/2395\n\tpublic async Task UserDefinedImplicitConversion_DoesNotTrigger(\n\t\tstring method,\n\t\tstring _)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tvar o = new object();\n\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyInt)42, o);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyInt)(int?)42, o);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyIntBase)42, o);\n\t\t\t\t\tXunit.Assert.{0}((MyBuggyIntBase)(int?)42, o);\n\n\t\t\t\t\tXunit.Assert.{0}(o, (MyBuggyInt)42);\n\t\t\t\t\tXunit.Assert.{0}(o, (MyBuggyInt)(int?)42);\n\t\t\t\t\tXunit.Assert.{0}(o, (MyBuggyIntBase)42);\n\t\t\t\t\tXunit.Assert.{0}(o, (MyBuggyIntBase)(int?)42);\n\t\t\t\t}}\n\t\t\t}}\n\n\t\t\tpublic abstract class MyBuggyIntBase {{\n\t\t\t\tpublic static implicit operator MyBuggyIntBase(int i) => new MyBuggyInt();\n\t\t\t}}\n\n\t\t\tpublic class MyBuggyInt : MyBuggyIntBase {{\n\t\t\t\tpublic MyBuggyInt() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task FirstValueParametersIfSecondIsNull_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(0, null)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task SecondValueParametersIfFirstIsNull_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(null, 0)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", \"int\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertSingleShouldBeUsedForSingleParameterTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSingleShouldBeUsedForSingleParameter>;\n\npublic class AssertSingleShouldBeUsedForSingleParameterTests\n{\n\t[Fact]\n\tpublic async ValueTask EnumerableAcceptanceTest()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t{|#0:Assert.Collection(\n\t\t\t\t\t\tdefault(IEnumerable<object>),\n\t\t\t\t\t\titem => Assert.NotNull(item)\n\t\t\t\t\t)|};\n\t\t\t\t\tAssert.Collection(\n\t\t\t\t\t\tdefault(IEnumerable<object>),\n\t\t\t\t\t\titem => Assert.NotNull(item),\n\t\t\t\t\t\titem => Assert.NotNull(item)\n\t\t\t\t\t);\n\n\t\t\t\t\tawait {|#1:Assert.CollectionAsync(\n\t\t\t\t\t\tdefault(IEnumerable<Task<int>>),\n\t\t\t\t\t\tasync item => Assert.NotNull(item)\n\t\t\t\t\t)|};\n\t\t\t\t\tawait Assert.CollectionAsync(\n\t\t\t\t\t\tdefault(IEnumerable<Task<int>>),\n\t\t\t\t\t\tasync item => Assert.Equal(42, await item),\n\t\t\t\t\t\tasync item => Assert.Equal(2112, await item)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new DiagnosticResult[] {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Collection\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"CollectionAsync\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(code, expected);\n\t}\n\n#if NETCOREAPP3_0_OR_GREATER\n\n\t[Fact]\n\tpublic async ValueTask AsyncEnumerableAcceptanceTest()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t{|#0:Assert.Collection(\n\t\t\t\t\t\tdefault(IAsyncEnumerable<object>),\n\t\t\t\t\t\titem => Assert.NotNull(item)\n\t\t\t\t\t)|};\n\t\t\t\t\tAssert.Collection(\n\t\t\t\t\t\tdefault(IAsyncEnumerable<object>),\n\t\t\t\t\t\titem => Assert.NotNull(item),\n\t\t\t\t\t\titem => Assert.NotNull(item)\n\t\t\t\t\t);\n\n\t\t\t\t\tawait {|#1:Assert.CollectionAsync(\n\t\t\t\t\t\tdefault(IAsyncEnumerable<Task<int>>),\n\t\t\t\t\t\tasync item => Assert.NotNull(item)\n\t\t\t\t\t)|};\n\t\t\t\t\tawait Assert.CollectionAsync(\n\t\t\t\t\t\tdefault(IAsyncEnumerable<Task<int>>),\n\t\t\t\t\t\tasync item => Assert.Equal(42, await item),\n\t\t\t\t\t\tasync item => Assert.Equal(2112, await item)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new DiagnosticResult[] {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Collection\"),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"CollectionAsync\"),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(code, expected);\n\t}\n\n#endif  // NETCOREAPP3_0_OR_GREATER\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertSingleShouldUseTwoArgumentCallTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSingleShouldUseTwoArgumentCall>;\n\npublic class AssertSingleShouldUseTwoArgumentCallTests\n{\n\tpublic static TheoryData<string, string> GetEnumerables(\n\t\tstring typeName,\n\t\tstring comparison) =>\n\t\t\tAssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksTests.GetEnumerables(typeName, comparison);\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"\")]\n\tpublic async Task Containers_WithoutWhereClause_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring _)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Single({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task Containers_WithWhereClauseWithIndex_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Single({0}.Where((f, i) => {1} && i > 0));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task EnumurableEmptyCheck_WithChainedLinq_DoesNotTrigger(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Single({0}.Where(f => {1}).Select(f => f));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(GetEnumerables), \"int\", \"f > 0\")]\n\t[MemberData(nameof(GetEnumerables), \"string\", \"f.Length > 0\")]\n\tpublic async Task Containers_WithWhereClause_Triggers(\n\t\tstring collection,\n\t\tstring comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.Single({0}.Where(f => {1}))|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", collection, comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\")]\n\t[InlineData(\"123\")]\n\t[InlineData(@\"abc\\n\\t\\\\\\\"\"\")]\n\tpublic async Task Strings_WithWhereClause_Triggers(string sampleString)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t[|Xunit.Assert.Single(\"{0}\".Where(f => f > 0))|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", sampleString);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertStringEqualityCheckShouldNotUseBoolCheckTest.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertStringEqualityCheckShouldNotUseBoolCheck>;\n\npublic class AssertStringEqualityCheckShouldNotUseBoolCheckTest\n{\n\tpublic static TheoryData<string, string> Methods_WithReplacement = new()\n\t{\n\t\t{ Constants.Asserts.True, Constants.Asserts.Equal },\n\t\t{ Constants.Asserts.False, Constants.Asserts.NotEqual },\n\t};\n\tpublic static TheoryData<StringComparison> SupportedStringComparisons =\n\t[\n\t\tStringComparison.Ordinal,\n\t\tStringComparison.OrdinalIgnoreCase,\n\t];\n\tpublic static TheoryData<StringComparison> UnsupportedStringComparisons =\n\t[\n\t\tStringComparison.CurrentCulture,\n\t\tStringComparison.CurrentCultureIgnoreCase,\n\t\tStringComparison.InvariantCulture,\n\t\tStringComparison.InvariantCultureIgnoreCase,\n\t];\n\tpublic static TheoryData<StringComparison> AllStringComparisons =\n\t[\n\t\tStringComparison.Ordinal,\n\t\tStringComparison.OrdinalIgnoreCase,\n\t\tStringComparison.CurrentCulture,\n\t\tStringComparison.CurrentCultureIgnoreCase,\n\t\tStringComparison.InvariantCulture,\n\t\tStringComparison.InvariantCultureIgnoreCase,\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task ForInstanceEqualsCheck_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(\"abc\".Equals(\"a\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(SupportedStringComparisons))]\n\tpublic async Task ForTrueInstanceEqualsCheck_WithSupportedStringComparison_Triggers(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.True(\"abc\".Equals(\"a\", System.StringComparison.{0}))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.Equal);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(UnsupportedStringComparisons))]\n\tpublic async Task ForTrueInstanceEqualsCheck_WithUnsupportedStringComparison_DoesNotTrigger(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.True(\"abc\".Equals(\"a\", System.StringComparison.{0}));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AllStringComparisons))]\n\tpublic async Task ForFalseInstanceEqualsCheck_WithStringComparison_DoesNotTrigger(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.False(\"abc\".Equals(\"a\", System.StringComparison.{0}));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods_WithReplacement))]\n\tpublic async Task ForStaticEqualsCheck_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(System.String.Equals(\"abc\", \"a\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(SupportedStringComparisons))]\n\tpublic async Task ForTrueStaticEqualsCheck_WithSupportedStringComparison_Triggers(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.True(System.String.Equals(\"abc\", \"a\", System.StringComparison.{0}))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.Equal);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(UnsupportedStringComparisons))]\n\tpublic async Task ForTrueStaticEqualsCheck_WithUnsupportedStringComparison_DoesNotTrigger(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.True(System.String.Equals(\"abc\", \"a\", System.StringComparison.{0}));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AllStringComparisons))]\n\tpublic async Task ForFalseStaticEqualsCheck_WithStringComparison_DoesNotTrigger(StringComparison comparison)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.False(System.String.Equals(\"abc\", \"a\", System.StringComparison.{0}));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", comparison);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertSubstringCheckShouldNotUseBoolCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSubstringCheckShouldNotUseBoolCheck>;\n\npublic class AssertSubstringCheckShouldNotUseBoolCheckTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\tConstants.Asserts.True,\n\t\tConstants.Asserts.False,\n\t];\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.True, Constants.Asserts.Contains)]\n\t[InlineData(Constants.Asserts.False, Constants.Asserts.DoesNotContain)]\n\tpublic async Task ForBooleanContainsCheck_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(\"abc\".Contains(\"a\"))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments($\"Assert.{method}()\", replacement);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanContainsCheck_WithUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".Contains(\"a\"), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanTrueStartsWithCheck_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|#0:Xunit.Assert.True(\"abc\".StartsWith(\"a\"))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.StartsWith);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanTrueStartsWithCheck_WithStringComparison_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|#0:Xunit.Assert.True(\"abc\".StartsWith(\"a\", System.StringComparison.CurrentCulture))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.StartsWith);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanFalseStartsWithCheck_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.False(\"abc\".StartsWith(\"a\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanFalseStartsWithCheck_WithStringComparison_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.False(\"abc\".StartsWith(\"a\", System.StringComparison.CurrentCulture));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanStartsWithCheck_WithUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".StartsWith(\"a\"), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanStartsWithCheck_WithStringComparison_AndUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".StartsWith(\"a\", System.StringComparison.CurrentCulture), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanStartsWithCheck_WithBoolAndCulture_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".StartsWith(\"a\", true, System.Globalization.CultureInfo.CurrentCulture));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanStartsWithCheck_WithBoolAndCulture_AndUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".StartsWith(\"a\", true, System.Globalization.CultureInfo.CurrentCulture), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanTrueEndsWithCheck_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|#0:Xunit.Assert.True(\"abc\".EndsWith(\"a\"))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.EndsWith);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanTrueEndsWithCheck_WithStringComparison_Triggers()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|#0:Xunit.Assert.True(\"abc\".EndsWith(\"a\", System.StringComparison.CurrentCulture))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.True()\", Constants.Asserts.EndsWith);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanFalseEndsWithCheck_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.False(\"abc\".EndsWith(\"a\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForBooleanFalseEndsWithCheck_WithStringComparison_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\tXunit.Assert.False(\"abc\".EndsWith(\"a\", System.StringComparison.CurrentCulture));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanEndsWithCheck_WithUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".EndsWith(\"a\"), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanEndsWithCheck_WithStringComparison_AndUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".EndsWith(\"a\", System.StringComparison.CurrentCulture), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanEndsWithCheck_WithBoolAndCulture_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".EndsWith(\"a\", true, System.Globalization.CultureInfo.CurrentCulture));\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForBooleanEndsWithCheck_WithBoolAndCulture_AndUserMessage_DoesNotTrigger(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.{0}(\"abc\".EndsWith(\"a\", true, System.Globalization.CultureInfo.CurrentCulture), \"message\");\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertThrowsShouldNotBeUsedForAsyncThrowsCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertThrowsShouldNotBeUsedForAsyncThrowsCheck>;\n\npublic class AssertThrowsShouldNotBeUsedForAsyncThrowsCheckTests\n{\n\tpublic static TheoryData<string> NonAsyncLambdas =\n\t[\n\t\t\"ThrowingMethod\",\n\t\t\"() => 1\",\n\t];\n\n\tpublic static TheoryData<string> AsyncLambdas =\n\t[\n\t\t\"(System.Func<System.Threading.Tasks.Task>)ThrowingMethod\",\n\t\t\"() => System.Threading.Tasks.Task.Delay(0)\",\n\t\t\"(System.Func<System.Threading.Tasks.Task>)(async () => await System.Threading.Tasks.Task.Delay(0))\",\n\t\t\"(System.Func<System.Threading.Tasks.Task>)(async () => await System.Threading.Tasks.Task.Delay(0).ConfigureAwait(false))\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(NonAsyncLambdas))]\n\tpublic async Task Throws_NonGeneric_WithNonAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Action ThrowingMethod = () => {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}};\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Throws(typeof(System.NotImplementedException), {0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(NonAsyncLambdas))]\n\tpublic async Task Throws_Generic_WithNonAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Action ThrowingMethod = () => {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}};\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Throws<System.NotImplementedException>({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(NonAsyncLambdas))]\n\tpublic async Task Throws_Generic_WithNamedArgumentException_WithNonAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Action ThrowingMethod = () => {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}};\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.Throws<System.ArgumentException>(\"param1\", {0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task Throws_NonGeneric_WithAsyncLambda_Triggers(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:{{|CS0619:Xunit.Assert.Throws(typeof(System.NotImplementedException), {0})|}}|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Throws()\", Constants.Asserts.ThrowsAsync);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task Throws_Generic_WithAsyncLambda_Triggers(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:{{|CS0619:Xunit.Assert.Throws<System.NotImplementedException>({0})|}}|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Throws()\", Constants.Asserts.ThrowsAsync);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task Throws_Generic_WithNamedArgumentException_WithAsyncLambda_Triggers(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:{{|CS0619:Xunit.Assert.Throws<System.ArgumentException>(\"param1\", {0})|}}|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.Throws()\", Constants.Asserts.ThrowsAsync);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task ThrowsAsync_NonGeneric_WithAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tasync System.Threading.Tasks.Task TestMethod() {{\n\t\t\t\t\tawait Xunit.Assert.ThrowsAsync(typeof(System.NotImplementedException), {0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task ThrowsAsync_Generic_WithAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tasync void TestMethod() {{\n\t\t\t\t\tawait Xunit.Assert.ThrowsAsync<System.NotImplementedException>({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(NonAsyncLambdas))]\n\tpublic async Task ThrowsAny_WithNonAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Action ThrowingMethod = () => {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}};\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tXunit.Assert.ThrowsAny<System.NotImplementedException>({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task ThrowsAny_WithAsyncLambda_Triggers(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:{{|CS0619:Xunit.Assert.ThrowsAny<System.NotImplementedException>({0})|}}|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(\"Assert.ThrowsAny()\", Constants.Asserts.ThrowsAnyAsync);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncLambdas))]\n\tpublic async Task ThrowsAnyAsync_WithAsyncLambda_DoesNotTrigger(string lambda)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tasync void TestMethod() {{\n\t\t\t\t\tawait Xunit.Assert.ThrowsAnyAsync<System.NotImplementedException>({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", lambda);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssertThrowsShouldUseGenericOverloadCheckTests.cs",
    "content": "using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertThrowsShouldUseGenericOverloadCheck>;\n\npublic class AssertThrowsShouldUseGenericOverloadCheckTests\n{\n\tpublic static TheoryData<string> Methods =\n\t[\n\t\tConstants.Asserts.Throws,\n\t\tConstants.Asserts.ThrowsAsync,\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForThrowsCheck_WithExceptionParameter_OnThrowingMethod_Triggers(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {{\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}}\n\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(typeof(System.NotImplementedException), (System.Func<System.Threading.Tasks.Task>)ThrowingMethod)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = new List<DiagnosticResult> {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(method, \"System.NotImplementedException\"),\n\t\t};\n\t\tif (method == Constants.Asserts.Throws)\n\t\t\texpected.Add(DiagnosticResult.CompilerError(\"CS0619\").WithLocation(0).WithArguments(\"Xunit.Assert.Throws(System.Type, System.Func<System.Threading.Tasks.Task>)\", \"You must call Assert.ThrowsAsync (and await the result) when testing async code.\"));\n\n\t\tawait Verify.VerifyAnalyzer(source, [.. expected]);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task ForThrowsCheck_WithExceptionParameter_OnThrowingLambda_Triggers(string method)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Xunit.Assert.{0}(typeof(System.NotImplementedException), () => System.Threading.Tasks.Task.Delay(0))|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = new List<DiagnosticResult> {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(method, \"System.NotImplementedException\"),\n\t\t};\n\t\tif (method == Constants.Asserts.Throws)\n\t\t\texpected.Add(DiagnosticResult.CompilerError(\"CS0619\").WithLocation(0).WithArguments(\"Xunit.Assert.Throws(System.Type, System.Func<System.Threading.Tasks.Task>)\", \"You must call Assert.ThrowsAsync (and await the result) when testing async code.\"));\n\n\t\tawait Verify.VerifyAnalyzer(source, expected.ToArray());\n\t}\n\n\t[Fact]\n\tpublic async Task ForThrowsCheck_WithExceptionTypeArgument_OnThrowingMethod_TriggersCompilerError()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|CS0619:Xunit.Assert.Throws<System.NotImplementedException>((System.Func<System.Threading.Tasks.Task>)ThrowingMethod)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForThrowsAsyncCheck_WithExceptionTypeArgument_OnThrowingMethod_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tSystem.Threading.Tasks.Task ThrowingMethod() {\n\t\t\t\t\tthrow new System.NotImplementedException();\n\t\t\t\t}\n\n\t\t\t\tasync System.Threading.Tasks.Task TestMethod() {\n\t\t\t\t\tawait Xunit.Assert.ThrowsAsync<System.NotImplementedException>((System.Func<System.Threading.Tasks.Task>)ThrowingMethod);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForThrowsCheck_WithExceptionTypeArgument_OnThrowingLambda_TriggersCompilerError()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tvoid TestMethod() {\n\t\t\t\t\t{|CS0619:Xunit.Assert.Throws<System.NotImplementedException>(() => System.Threading.Tasks.Task.Delay(0))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task ForThrowsAsyncCheck_WithExceptionTypeArgument_OnThrowingLambda_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tclass TestClass {\n\t\t\t\tasync System.Threading.Tasks.Task TestMethod() {\n\t\t\t\t\tawait Xunit.Assert.ThrowsAsync<System.NotImplementedException>(() => System.Threading.Tasks.Task.Delay(0));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AssignableFromAssertionIsConfusinglyNamedTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssignableFromAssertionIsConfusinglyNamed>;\nusing Verify_v2_Pre2_9_3 = CSharpVerifier<AssignableFromAssertionIsConfusinglyNamedTests.Analyzer_v2_Pre2_9_3>;\nusing Verify_v3_Pre0_6_0 = CSharpVerifier<AssignableFromAssertionIsConfusinglyNamedTests.Analyzer_v3_Pre0_6_0>;\n\npublic class AssignableFromAssertionIsConfusinglyNamedTests\n{\n\tpublic static TheoryData<string, string> Methods = new()\n\t{\n\t\t{ \"IsAssignableFrom\", \"IsType\" },\n\t\t{ \"IsNotAssignableFrom\", \"IsNotType\"},\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task WhenReplacementAvailable_Triggers(\n\t\tstring method,\n\t\tstring replacement)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t{{|#0:Assert.{0}<object>(new object())|}};\n\t\t\t\t\t{{|#1:Assert.{0}(typeof(object), new object())|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\t\tvar expected = new[] {\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(method, replacement),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(method, replacement),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Methods))]\n\tpublic async Task WhenReplacementNotAvailable_DoesNotTriggers(\n\t\tstring method,\n\t\tstring _)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tclass TestClass {{\n\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\tAssert.{0}<object>(new object());\n\t\t\t\t\tAssert.{0}(typeof(object), new object());\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", method);\n\n\t\tawait Verify_v2_Pre2_9_3.VerifyAnalyzer(source);\n\t\tawait Verify_v3_Pre0_6_0.VerifyAnalyzer(source);\n\t}\n\n\tinternal class Analyzer_v2_Pre2_9_3 : AssignableFromAssertionIsConfusinglyNamed\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 9, 2));\n\t}\n\n\tinternal class Analyzer_v3_Pre0_6_0 : AssignableFromAssertionIsConfusinglyNamed\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(0, 5, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/AsyncAssertsShouldBeAwaitedTests.cs",
    "content": "using System.Globalization;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AsyncAssertsShouldBeAwaited>;\n\npublic class AsyncAssertsShouldBeAwaitedTests\n{\n\t[Fact]\n\tpublic async Task UnawaitedNonAssertion_DoesNotTrigger()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tTask.Delay(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(code);\n\t}\n\n\treadonly string codeTemplate = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing System.Collections.Generic;\n\t\tusing System.ComponentModel;\n\t\tusing System.Threading.Tasks;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass : INotifyPropertyChanged {{\n\t\t\tpublic int Property {{ get; set; }}\n\n\t\t\tpublic event PropertyChangedEventHandler? PropertyChanged;\n\t\t\tpublic event EventHandler? SimpleEvent;\n\t\t\tpublic event EventHandler<int>? SimpleIntEvent;\n\n\t\t\t[Fact]\n\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t{0}\n\t\t\t}}\n\t\t}}\n\n\t\tpublic static class MyTaskExtensions {{\n\t\t\tpublic static void ConsumeTask(this Task t) {{ }}\n\t\t}}\n\t\t\"\"\";\n\n\tpublic static TheoryData<string, string> AsyncAssertions = new()\n\t{\n\t\t/* lang=c#-test */ { \"AllAsync\", \"Assert.AllAsync(default(IEnumerable<int>), i => Task.FromResult(true))\" },\n#if NETCOREAPP3_0_OR_GREATER\n\t\t/* lang=c#-test */ { \"AllAsync\", \"Assert.AllAsync(default(IAsyncEnumerable<int>), i => Task.FromResult(true))\" },\n#endif\n\t\t/* lang=c#-test */ { \"CollectionAsync\", \"Assert.CollectionAsync(default(IEnumerable<int>))\" },\n#if NETCOREAPP3_0_OR_GREATER\n\t\t/* lang=c#-test */ { \"CollectionAsync\", \"Assert.CollectionAsync(default(IAsyncEnumerable<int>))\" },\n#endif\n\t\t/* lang=c#-test */ { \"PropertyChangedAsync\", \"Assert.PropertyChangedAsync(this, nameof(Property), async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"RaisesAnyAsync\", \"Assert.RaisesAnyAsync(eh => SimpleEvent += eh, eh => SimpleEvent -= eh, async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"RaisesAnyAsync\", \"Assert.RaisesAnyAsync<int>(eh => SimpleIntEvent += eh, eh => SimpleIntEvent -= eh, async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"RaisesAsync\", \"Assert.RaisesAsync<int>(eh => SimpleIntEvent += eh, eh => SimpleIntEvent -= eh, async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"ThrowsAnyAsync\", \"Assert.ThrowsAnyAsync<Exception>(async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"ThrowsAsync\", \"Assert.ThrowsAsync(typeof(DivideByZeroException), async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"ThrowsAsync\", \"Assert.ThrowsAsync<DivideByZeroException>(async () => throw new DivideByZeroException())\" },\n\t\t/* lang=c#-test */ { \"ThrowsAsync\", \"Assert.ThrowsAsync<ArgumentException>(\\\"argName\\\", async () => throw new DivideByZeroException())\" },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AwaitedAssert_DoesNotTrigger(\n\t\tstring _,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"await {assertion};\");\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AssertionWithConsumption_DoesNotTrigger(\n\t\tstring _,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"MyTaskExtensions.ConsumeTask({assertion});\");\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AssertionWithConsumptionViaExtension_DoesNotTrigger(\n\t\tstring _,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"{assertion}.ConsumeTask();\");\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AssertionWithStoredTask_DoesNotTrigger(\n\t\tstring _,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"var task = {assertion};\");\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AssertionWithoutAwait_Triggers(\n\t\tstring assertionName,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"{{|#0:{assertion}|}};\");\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(assertionName);\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code, expected);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AssertionWithUnawaitedContinuation_Triggers(\n\t\tstring assertionName,\n\t\tstring assertion)\n\t{\n\t\tvar code = string.Format(CultureInfo.InvariantCulture, codeTemplate, $\"{{|#0:{assertion}|}}.ContinueWith(t => {{ }});\");\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(assertionName);\n\n\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, code, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/BooleanAssertsShouldNotBeNegatedTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.BooleanAssertsShouldNotBeNegated>;\n\npublic class BooleanAssertsShouldNotBeNegatedTests\n{\n\t[Theory]\n\t[InlineData(\"False\", \"True\")]\n\t[InlineData(\"True\", \"False\")]\n\tpublic async Task NegatedBooleanAssertion_Triggers(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\t{{|#0:Assert.{0}(!condition)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(assertion, replacement);\n\n\t\tawait Verify.VerifyAnalyzer(code, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck>;\nusing Verify_v3_Pre_301 = CSharpVerifier<BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckTests.Analyzer_v3_Pre301>;\n\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckTests\n{\n\tpublic class X2024_BooleanAssertionsShouldNotBeUsedForSimpleEqualityCheck\n\t{\n\t\tpublic static MatrixTheoryData<string, string> MethodOperator =\n\t\t\tnew(\n\t\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t\t[\"==\", \"!=\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperator))]\n\t\tpublic async Task ComparingAgainstNonLiteral_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring @operator)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar value1 = 42;\n\t\t\t\t\t\tvar value2 = 2112;\n\t\t\t\t\t\tvar value3 = new {{ innerValue = 2600 }};\n\n\t\t\t\t\t\tAssert.{0}(value1 {1} value2);\n\t\t\t\t\t\tAssert.{0}(value1 {1} value3.innerValue);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\tpublic static MatrixTheoryData<string, string, string> MethodOperatorValue =\n\t\t\tnew(\n\t\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t\t[\"==\", \"!=\"],\n\t\t\t\t[\"\\\"bacon\\\"\", \"'5'\", \"5\", \"5l\", \"5.0d\", \"5.0f\", \"5.0m\", \"MyEnum.Bacon\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperatorValue))]\n\t\tpublic async Task ComparingAgainstLiteral_WithMessage_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring @operator,\n\t\t\tstring value)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic enum MyEnum {{ None, Bacon, Veggie }}\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar value = {2};\n\n\t\t\t\t\t\tAssert.{0}(value {1} {2}, \"message\");\n\t\t\t\t\t\tAssert.{0}({2} {1} value, \"message\");\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator, value);\n\n\t\t\tawait Verify.VerifyAnalyzer(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperatorValue))]\n\t\tpublic async Task ComparingAgainstLiteral_WithoutMessage_Triggers(\n\t\t\tstring method,\n\t\t\tstring @operator,\n\t\t\tstring value)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic enum MyEnum {{ None, Bacon, Veggie }}\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar value = {2};\n\n\t\t\t\t\t\t{{|#0:Assert.{0}(value {1} {2})|}};\n\t\t\t\t\t\t{{|#1:Assert.{0}({2} {1} value)|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator, value);\n\t\t\tvar suggestedAssert =\n\t\t\t\t(method, @operator) switch\n\t\t\t\t{\n\t\t\t\t\t(Constants.Asserts.True, \"==\") or (Constants.Asserts.False, \"!=\") => Constants.Asserts.Equal,\n\t\t\t\t\t(_, _) => Constants.Asserts.NotEqual,\n\t\t\t\t};\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(0).WithArguments(method, suggestedAssert),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(1).WithArguments(method, suggestedAssert),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\n\t\tpublic static MatrixTheoryData<string, string, string> MethodOperatorType =\n\t\t\tnew(\n\t\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t\t[\"==\", \"!=\"],\n\t\t\t\t[\"string\", \"int\", \"object\", \"MyEnum\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperatorType))]\n\t\tpublic async Task ComparingAgainstNull_WithMessage_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring @operator,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic enum MyEnum {{ None, Bacon, Veggie }}\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{2}? field = default;\n\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tAssert.{0}(field {1} null, \"Message\");\n\t\t\t\t\t\tAssert.{0}(null {1} field, \"Message\");\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator, type);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperatorType))]\n\t\tpublic async Task ComparingAgainstNull_WithoutMessage_Triggers(\n\t\t\tstring method,\n\t\t\tstring @operator,\n\t\t\tstring type)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic enum MyEnum {{ None, Bacon, Veggie }}\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t{2}? field = default;\n\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\t{{|#0:Assert.{0}(field {1} null)|}};\n\t\t\t\t\t\t{{|#1:Assert.{0}(null {1} field)|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator, type);\n\t\t\tvar suggestedAssert =\n\t\t\t\t(method, @operator) switch\n\t\t\t\t{\n\t\t\t\t\t(Constants.Asserts.True, \"==\") or (Constants.Asserts.False, \"!=\") => Constants.Asserts.Null,\n\t\t\t\t\t(_, _) => Constants.Asserts.NotNull,\n\t\t\t\t};\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(0).WithArguments(method, suggestedAssert),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(1).WithArguments(method, suggestedAssert),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ComparingAgainstNullPointer_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic unsafe void TestMethod() {\n\t\t\t\t\t\tvar value = 42;\n\t\t\t\t\t\tvar ptr = &value;\n\n\t\t\t\t\t\tAssert.True(ptr == null);\n\t\t\t\t\t\tAssert.True(null == ptr);\n\t\t\t\t\t\tAssert.True(ptr != null);\n\t\t\t\t\t\tAssert.True(null != ptr);\n\n\t\t\t\t\t\tAssert.False(ptr == null);\n\t\t\t\t\t\tAssert.False(null == ptr);\n\t\t\t\t\t\tAssert.False(ptr != null);\n\t\t\t\t\t\tAssert.False(null != ptr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzerV2(source);\n\t\t\tawait Verify_v3_Pre_301.VerifyAnalyzerV3(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task ComparingAgainstNullPointer_v3_301_Triggers()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\tpublic unsafe void TestMethod() {\n\t\t\t\t\t\tvar value = 42;\n\t\t\t\t\t\tvar ptr = &value;\n\n\t\t\t\t\t\t{|#0:Assert.True(ptr == null)|};\n\t\t\t\t\t\t{|#1:Assert.True(null == ptr)|};\n\t\t\t\t\t\t{|#2:Assert.True(ptr != null)|};\n\t\t\t\t\t\t{|#3:Assert.True(null != ptr)|};\n\n\t\t\t\t\t\t{|#10:Assert.False(ptr == null)|};\n\t\t\t\t\t\t{|#11:Assert.False(null == ptr)|};\n\t\t\t\t\t\t{|#12:Assert.False(ptr != null)|};\n\t\t\t\t\t\t{|#13:Assert.False(null != ptr)|};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(0).WithArguments(\"True\", \"Null\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(1).WithArguments(\"True\", \"Null\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(2).WithArguments(\"True\", \"NotNull\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(3).WithArguments(\"True\", \"NotNull\"),\n\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(10).WithArguments(\"False\", \"NotNull\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(11).WithArguments(\"False\", \"NotNull\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(12).WithArguments(\"False\", \"Null\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2024\").WithLocation(13).WithArguments(\"False\", \"Null\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzerV3(source, expected);\n\t\t}\n\t}\n\n\tpublic class X2025_BooleanAssertionCanBeSimplified\n\t{\n\t\tpublic static MatrixTheoryData<string, string, string> MethodOperatorValue =\n\t\t\tnew(\n\t\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t\t[\"==\", \"!=\"],\n\t\t\t\t[\"true\", \"false\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodOperatorValue))]\n\t\tpublic async Task ComparingAgainstBooleanLiteral_Triggers(\n\t\t\tstring method,\n\t\t\tstring @operator,\n\t\t\tstring value)\n\t\t{\n\t\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tbool field = {2};\n\n\t\t\t\t\tvoid TestMethod() {{\n\t\t\t\t\t\t{{|#0:Assert.{0}(field {1} {2})|}};\n\t\t\t\t\t\t{{|#1:Assert.{0}(field {1} {2}, \"Message\")|}};\n\t\t\t\t\t\t{{|#2:Assert.{0}({2} {1} field)|}};\n\t\t\t\t\t\t{{|#3:Assert.{0}({2} {1} field, \"Message\")|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, @operator, value);\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit2025\").WithLocation(0).WithArguments(method),\n\t\t\t\tVerify.Diagnostic(\"xUnit2025\").WithLocation(1).WithArguments(method),\n\t\t\t\tVerify.Diagnostic(\"xUnit2025\").WithLocation(2).WithArguments(method),\n\t\t\t\tVerify.Diagnostic(\"xUnit2025\").WithLocation(3).WithArguments(method),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t\t}\n\t}\n\n\tpublic class Analyzer_v3_Pre301 : BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new(3, 0, 0));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/DoNotUseAssertEmptyWithProblematicTypesTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseAssertEmptyWithProblematicTypes>;\n\npublic class DoNotUseAssertEmptyWithProblematicTypesTests\n{\n\tpublic static TheoryData<string, string, string> ProblematicTypes = new()\n\t{\n\t\t/* lang=c#-test */ { \"StringValues.Empty\", \"Microsoft.Extensions.Primitives.StringValues\", \"it is implicitly cast to a string, not a collection\" },\n\t\t/* lang=c#-test */ { \"new ArraySegment<int>()\", \"System.ArraySegment<int>\", \"its implementation of GetEnumerator() can throw\" },\n\t};\n\n\t[Theory]\n\t[InlineData(/* lang=c#-test */ \"new int[0]\")]\n\t[InlineData(/* lang=c#-test */ \"new List<int>()\")]\n\t[InlineData(/* lang=c#-test */ \"new Dictionary<string, int>()\")]\n\tpublic async Task NonProblematicCollection_DoesNotTrigger(string invocation)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAssert.Empty({0});\n\t\t\t\t\tAssert.NotEmpty({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", invocation);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(ProblematicTypes))]\n\tpublic async Task ConvertingToCollection_DoesNotTrigger(\n\t\tstring invocation,\n\t\tstring _1,\n\t\tstring _2)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Linq;\n\t\t\tusing Microsoft.Extensions.Primitives;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAssert.Empty({0}.ToArray());\n\t\t\t\t\tAssert.NotEmpty({0}.ToArray());\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", invocation);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(ProblematicTypes))]\n\tpublic async Task UsingProblematicType_Triggers(\n\t\tstring invocation,\n\t\tstring typeName,\n\t\tstring problem)\n\t{\n\t\tvar source = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Microsoft.Extensions.Primitives;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t{{|#0:Assert.Empty({0})|}};\n\t\t\t\t\t{{|#1:Assert.NotEmpty({0})|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", invocation);\n\t\tvar expected = new[]\n\t\t{\n\t\t\tVerify.Diagnostic().WithLocation(0).WithArguments(\"Empty\", typeName, problem),\n\t\t\tVerify.Diagnostic().WithLocation(1).WithArguments(\"NotEmpty\", typeName, problem),\n\t\t};\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/SetEqualityAnalyzerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Analyzers.SetEqualityAnalyzer>;\n\npublic class SetEqualityAnalyzerTests\n{\n\tconst string customSetAndComparer = /* lang=c#-test */ \"\"\"\n\t\tusing System.Collections;\n\t\tusing System.Collections.Generic;\n\n\t\tpublic class MySet : ISet<int> {\n\t\t\tpublic int Count => throw new System.NotImplementedException();\n\t\t\tpublic bool IsReadOnly => throw new System.NotImplementedException();\n\n\t\t\tpublic bool Add(int item) => throw new System.NotImplementedException();\n\t\t\tpublic void Clear() => throw new System.NotImplementedException();\n\t\t\tpublic bool Contains(int item) => throw new System.NotImplementedException();\n\t\t\tpublic void CopyTo(int[] array, int arrayIndex) => throw new System.NotImplementedException();\n\t\t\tpublic void ExceptWith(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic IEnumerator<int> GetEnumerator() => throw new System.NotImplementedException();\n\t\t\tpublic void IntersectWith(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool IsProperSubsetOf(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool IsProperSupersetOf(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool IsSubsetOf(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool IsSupersetOf(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool Overlaps(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic bool Remove(int item) => throw new System.NotImplementedException();\n\t\t\tpublic bool SetEquals(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic void SymmetricExceptWith(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tpublic void UnionWith(IEnumerable<int> other) => throw new System.NotImplementedException();\n\t\t\tvoid ICollection<int>.Add(int item) => throw new System.NotImplementedException();\n\t\t\tIEnumerator IEnumerable.GetEnumerator() => throw new System.NotImplementedException();\n\t\t}\n\n\t\tpublic class MyComparer : IEqualityComparer<int> {\n\t\t\tpublic bool Equals(int x, int y) => throw new System.NotImplementedException();\n\t\t\tpublic int GetHashCode(int obj) => throw new System.NotImplementedException();\n\t\t}\n\t\t\"\"\";\n\n\tpublic class X2026_SetsMustBeComparedWithEqualityComparer\n\t{\n\t\tpublic static MatrixTheoryData<string, string, string> MethodWithCollectionCreationData =>\n\t\t\tnew(\n\t\t\t\t/* lang=c#-test */ [\"Equal\", \"NotEqual\"],\n\t\t\t\t/* lang=c#-test */ [\"new HashSet<int>()\", \"new HashSet<int>().ToImmutableHashSet()\", \"new MySet()\"],\n\t\t\t\t/* lang=c#-test */ [\"new HashSet<int>()\", \"new HashSet<int>().ToImmutableHashSet()\", \"new MySet()\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodWithCollectionCreationData))]\n\t\tpublic async Task WithCollectionComparer_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring collection1,\n\t\t\tstring collection2)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Collections.Immutable;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = {1};\n\t\t\t\t\t\tvar collection2 = {2};\n\n\t\t\t\t\t\tAssert.{0}(collection1, collection2, (IEnumerable<int> e1, IEnumerable<int> e2) => true);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, collection1, collection2);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, [code, customSetAndComparer]);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodWithCollectionCreationData))]\n\t\tpublic async Task WithEqualityComparer_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring collection1,\n\t\t\tstring collection2)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Collections.Immutable;\n\n\t\t\t\tpublic class TestEqualityComparer : IEqualityComparer<int> {{\n\t\t\t\t\tpublic bool Equals(int x, int y) {{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}}\n\n\t\t\t\t\tpublic int GetHashCode(int obj) {{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = {1};\n\t\t\t\t\t\tvar collection2 = {2};\n\n\t\t\t\t\t\tAssert.{0}(collection1, collection2, new TestEqualityComparer());\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, collection1, collection2);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, [code, customSetAndComparer]);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodWithCollectionCreationData))]\n\t\tpublic async Task WithComparerLambda_Triggers(\n\t\t\tstring method,\n\t\t\tstring collection1,\n\t\t\tstring collection2)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Collections.Immutable;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = {1};\n\t\t\t\t\t\tvar collection2 = {2};\n\n\t\t\t\t\t\t{{|#0:Assert.{0}(collection1, collection2, (int e1, int e2) => true)|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, collection1, collection2);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit2026\").WithLocation(0).WithArguments(method);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, [code, customSetAndComparer], expected);\n\t\t}\n\n#if ROSLYN_LATEST  // C# 10 is required for local functions\n\n\t\tpublic static MatrixTheoryData<string, string, string, string> ComparerFunctionData() =>\n\t\t\tnew(\n\t\t\t\t/* lang=c#-test */ [\"Equal\", \"NotEqual\"],\n\t\t\t\t/* lang=c#-test */ [\"(int e1, int e2) => true\", \"FuncComparer\", \"LocalFunc\", \"funcDelegate\"],\n\t\t\t\t/* lang=c#-test */ [\"new HashSet<int>()\", \"new HashSet<int>().ToImmutableHashSet()\", \"new MySet()\"],\n\t\t\t\t/* lang=c#-test */ [\"new HashSet<int>()\", \"new HashSet<int>().ToImmutableHashSet()\", \"new MySet()\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(ComparerFunctionData))]\n\t\tpublic async Task WithComparerFunction_Triggers(\n\t\t\tstring method,\n\t\t\tstring comparerFuncSyntax,\n\t\t\tstring collection1,\n\t\t\tstring collection2)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Collections.Immutable;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\tprivate bool FuncComparer(int obj1, int obj2) {{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}}\n\n\t\t\t\t\tprivate delegate bool FuncDelegate(int obj1, int obj2);\n\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = {2};\n\t\t\t\t\t\tvar collection2 = {3};\n\n\t\t\t\t\t\tbool LocalFunc(int obj1, int obj2) {{\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}}\n\n\t\t\t\t\t\tvar funcDelegate = FuncComparer;\n\n\t\t\t\t\t\t{{|#0:Assert.{0}(collection1, collection2, {1})|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, comparerFuncSyntax, collection1, collection2);\n\t\t\tvar expected = Verify.Diagnostic(\"xUnit2026\").WithLocation(0).WithArguments(method);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp10, new[] { code, customSetAndComparer }, expected);\n\t\t}\n\n#endif\n\t}\n\n\tpublic class X2027_SetsShouldNotBeComparedToLinearContainers\n\t{\n\t\tpublic static MatrixTheoryData<string, string> MethodAndLinearContainers =>\n\t\t\tnew(\n\t\t\t\t/* lang=c#-test */ [\"Equal\", \"NotEqual\"],\n\t\t\t\t/* lang=c#-test */ [\"new List<int>()\", \"new SortedSet<int>()\", \"new HashSet<int>().OrderBy(x => x)\", \"new MySet().OrderBy(x => x)\"]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodAndLinearContainers))]\n\t\tpublic async Task LinearContainers_DoesNotTrigger(\n\t\t\tstring method,\n\t\t\tstring collection)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Linq;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = new List<int>();\n\t\t\t\t\t\tvar collection2 = {1};\n\n\t\t\t\t\t\tAssert.{0}(collection1, collection2);\n\t\t\t\t\t\tAssert.{0}(collection1, collection2, (int e1, int e2) => true);\n\t\t\t\t\t\tAssert.{0}(collection1, collection2, new MyComparer());\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, collection);\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, [code, customSetAndComparer]);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task CastedSet_DoesNotTrigger()\n\t\t{\n\t\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\n\t\t\t\tpublic class TestClass {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\tvar expected = new HashSet<string> { \"bar\", \"foo\" };\n\t\t\t\t\t\tvar actual = new HashSet<string> { \"foo\", \"bar\" };\n\n\t\t\t\t\t\t\tAssert.Equal(expected, actual);\n\t\t\t\t\t\t\tAssert.Equal(expected, (ISet<string>)actual);\n\t\t\t\t\t\t\tAssert.Equal((ISet<string>)expected, actual);\n\t\t\t\t\t\t\tAssert.Equal((ISet<string>)expected, (ISet<string>)actual);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyAnalyzer(code);\n\t\t}\n\n\t\tpublic static MatrixTheoryData<string, (string type, string initializer)> MethodAndTypeAndInitializer =>\n\t\t\tnew(\n\t\t\t\t/* lang=c#-test */ [\"Equal\", \"NotEqual\"],\n\t\t\t\t/* lang=c#-test */\n\t\t\t\t[\n\t\t\t\t\t(\"System.Collections.Generic.HashSet<int>\", \"new HashSet<int>()\"),\n\t\t\t\t\t(\"System.Collections.Immutable.ImmutableHashSet<int>\", \"new HashSet<int>().ToImmutableHashSet()\"),\n\t\t\t\t\t(\"MySet\", \"new MySet()\")\n\t\t\t\t]\n\t\t\t);\n\n\t\t[Theory]\n\t\t[MemberData(nameof(MethodAndTypeAndInitializer), DisableDiscoveryEnumeration = true)]\n\t\tpublic async Task SetWithLinearContainer_Triggers(\n\t\t\tstring method,\n\t\t\t(string type, string initializer) collection)\n\t\t{\n\t\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing System.Collections.Generic;\n\t\t\t\tusing System.Collections.Immutable;\n\t\t\t\tusing System.Linq;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar collection1 = new List<int>();\n\t\t\t\t\t\tvar collection2 = {1};\n\n\t\t\t\t\t\t{{|#0:Assert.{0}(collection1, collection2)|}};\n\t\t\t\t\t\t{{|#1:Assert.{0}(collection1, collection2, (int e1, int e2) => true)|}};\n\t\t\t\t\t\t{{|#2:Assert.{0}(collection1, collection2, new MyComparer())|}};\n\n\t\t\t\t\t\t{{|#3:Assert.{0}(collection2, collection1)|}};\n\t\t\t\t\t\t{{|#4:Assert.{0}(collection2, collection1, (int e1, int e2) => true)|}};\n\t\t\t\t\t\t{{|#5:Assert.{0}(collection2, collection1, new MyComparer())|}};\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", method, collection.initializer);\n\t\t\tvar expected = new[]\n\t\t\t{\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(0).WithArguments(\"System.Collections.Generic.List<int>\", collection.type),\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(1).WithArguments(\"System.Collections.Generic.List<int>\", collection.type),\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(2).WithArguments(\"System.Collections.Generic.List<int>\", collection.type),\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(3).WithArguments(collection.type, \"System.Collections.Generic.List<int>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(4).WithArguments(collection.type, \"System.Collections.Generic.List<int>\"),\n\t\t\t\tVerify.Diagnostic(\"xUnit2027\").WithLocation(5).WithArguments(collection.type, \"System.Collections.Generic.List<int>\"),\n\t\t\t};\n\n\t\t\tawait Verify.VerifyAnalyzer(LanguageVersion.CSharp7, [code, customSetAndComparer], expected);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X2000/UseAssertFailInsteadOfBooleanAssertTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.UseAssertFailInsteadOfBooleanAssert>;\nusing Verify_Unsupported = CSharpVerifier<UseAssertFailInsteadOfBooleanAssertTests.Analyzer_Pre25>;\n\npublic class UseAssertFailInsteadOfBooleanAssertTests\n{\n\tconst string codeTemplate = /* lang=c#-test */ \"\"\"\n\t\tpublic class TestClass {{\n\t\t\t[Xunit.Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\t{{|#0:Xunit.Assert.{0}({1}, \"failure message\")|}};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.True, \"false\")]\n\t[InlineData(Constants.Asserts.False, \"true\")]\n\tpublic async Task OppositeTestWithMessage_Prev25_DoesNotTrigger(\n\t\tstring assertion,\n\t\tstring targetValue)\n\t{\n\t\tvar source = string.Format(codeTemplate, assertion, targetValue);\n\n\t\tawait Verify_Unsupported.VerifyAnalyzer(source);\n\t}\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.True, \"false\")]\n\t[InlineData(Constants.Asserts.False, \"true\")]\n\tpublic async Task OppositeTestWithMessage_v25_Triggers(\n\t\tstring assertion,\n\t\tstring targetValue)\n\t{\n\t\tvar source = string.Format(codeTemplate, assertion, targetValue);\n\t\tvar expected = Verify.Diagnostic().WithLocation(0).WithArguments(assertion, targetValue);\n\n\t\tawait Verify.VerifyAnalyzer(source, expected);\n\t}\n\n\t[Theory]\n\t[InlineData(Constants.Asserts.True, \"true\")]\n\t[InlineData(Constants.Asserts.False, \"false\")]\n\tpublic async Task SameTestWithMessage_DoesNotTrigger(\n\t\tstring assertion,\n\t\tstring targetValue)\n\t{\n\t\tvar source = string.Format(codeTemplate, assertion, targetValue);\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\t[Fact]\n\tpublic async Task NonConstantInvocation_DoesNotTrigger()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar value = (1 != 2);\n\t\t\t\t\tXunit.Assert.False(value, \"failure message\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzer(source);\n\t}\n\n\tinternal class Analyzer_Pre25 : UseAssertFailInsteadOfBooleanAssert\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2Assert(compilation, new Version(2, 4, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X3000/CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify_WithAbstractions = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithAbstractions.Analyzer>;\nusing Verify_WithExecution = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution.Analyzer>;\nusing Verify_WithRunnerUtility = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility.Analyzer>;\n\npublic class CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests\n{\n\tpublic class WithAbstractions\n\t{\n\t\treadonly static string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class {{|#0:MyClass|}}: {0} {{ }}\n\t\t\t\"\"\";\n\n\t\tpublic static TheoryData<string> Interfaces =\n\t\t[\n\t\t\t// Discovery and execution messages\n\t\t\tMemberCount(\"IMessageSink\", 1),\n\t\t\tMemberCount(\"IMessageSinkMessage\", 0),\n\n\t\t\t// Reflection\n\t\t\tMemberCount(\"IAssemblyInfo\", 5),\n\t\t\tMemberCount(\"IAttributeInfo\", 3),\n\t\t\tMemberCount(\"IMethodInfo\", 11),\n\t\t\tMemberCount(\"IParameterInfo\", 2),\n\t\t\tMemberCount(\"ITypeInfo\", 13),\n\n\t\t\t// Test cases\n\t\t\tMemberCount(\"ITest\", 2),\n\t\t\tMemberCount(\"ITestAssembly\", 4),\n\t\t\tMemberCount(\"ITestCase\", 9),\n\t\t\tMemberCount(\"ITestClass\", 4),\n\t\t\tMemberCount(\"ITestCollection\", 6),\n\t\t\tMemberCount(\"ITestMethod\", 4),\n\n\t\t\t// Test frameworks\n\t\t\tMemberCount(\"ISourceInformation\", 4),\n\t\t\tMemberCount(\"ISourceInformationProvider\", 2),\n\t\t\tMemberCount(\"ITestFramework\", 4),\n\t\t\tMemberCount(\"ITestFrameworkDiscoverer\", 6),\n\t\t\tMemberCount(\"ITestFrameworkExecutor\", 4),\n\t\t];\n\n\t\t[Fact]\n\t\tpublic async Task NoInterfaces_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = \"public class Foo { }\";\n\n\t\t\tawait Verify_WithAbstractions.VerifyAnalyzerV2(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task InterfaceWithoutBaseClass_Triggers(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, @interface);\n\t\t\tvar expected = Verify_WithAbstractions.Diagnostic().WithLocation(0).WithArguments(\"MyClass\");\n\n\t\t\tawait Verify_WithAbstractions.VerifyAnalyzerV2(source, expected);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2Abstractions(compilation);\n\t\t}\n\t}\n\n\tpublic class WithExecution\n\t{\n\t\treadonly static string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class MyLLMBRO: Xunit.LongLivedMarshalByRefObject {{ }}\n\t\t\tpublic class {{|#0:MyClass|}}: {0} {{ }}\n\t\t\t\"\"\";\n\n\t\tpublic static TheoryData<string> Interfaces = new(WithAbstractions.Interfaces) { MemberCount(\"Xunit.Sdk.IXunitTestCase\", 13) };\n\n\t\tpublic static TheoryData<string, string> InterfacesWithBaseClasses\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar result = new TheoryData<string, string>();\n\n\t\t\t\tforeach (var @interface in Interfaces)\n\t\t\t\t{\n\t\t\t\t\tresult.Add(@interface.Data, \"MyLLMBRO\");\n\t\t\t\t\tresult.Add(@interface.Data, \"Xunit.LongLivedMarshalByRefObject\");\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NoInterfaces_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"public class Foo { }\";\n\n\t\t\tawait Verify_WithExecution.VerifyAnalyzerV2(source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithXunitTestCase_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = string.Format(Template, \"Xunit.Sdk.XunitTestCase\");\n\n\t\t\tawait Verify_WithExecution.VerifyAnalyzerV2(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InterfacesWithBaseClasses))]\n\t\tpublic async Task CompatibleBaseClass_DoesNotTrigger(\n\t\t\tstring @interface,\n\t\t\tstring baseClass)\n\t\t{\n\t\t\tvar source = string.Format(Template, $\"{baseClass}, {@interface}\");\n\n\t\t\tawait Verify_WithExecution.VerifyAnalyzerV2(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task InterfaceWithoutBaseClass_Triggers(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, @interface);\n\t\t\tvar expected = Verify_WithExecution.Diagnostic().WithLocation(0).WithArguments(\"MyClass\");\n\n\t\t\tawait Verify_WithExecution.VerifyAnalyzerV2(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task IncompatibleBaseClass_Triggers(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, $\"Foo, {@interface}\");\n\t\t\tvar expected = Verify_WithExecution.Diagnostic().WithLocation(0).WithArguments(\"MyClass\");\n\n\t\t\tawait Verify_WithExecution.VerifyAnalyzerV2(source, expected);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2Execution(compilation);\n\t\t}\n\t}\n\n\tpublic class WithRunnerUtility\n\t{\n\t\treadonly static string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class MyLLMBRO: Xunit.Sdk.LongLivedMarshalByRefObject {{ }}\n\t\t\tpublic class {{|#0:MyClass|}}: {0} {{ }}\n\t\t\t\"\"\";\n\n\t\tpublic static TheoryData<string> Interfaces =\n\t\t\tWithAbstractions.Interfaces;\n\n\t\tpublic static TheoryData<string, string> InterfacesWithBaseClasses\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar result = new TheoryData<string, string>();\n\n\t\t\t\tforeach (var @interface in Interfaces)\n\t\t\t\t{\n\t\t\t\t\tresult.Add(@interface.Data, \"MyLLMBRO\");\n\t\t\t\t\tresult.Add(@interface.Data, \"Xunit.Sdk.LongLivedMarshalByRefObject\");\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NoInterfaces_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"public class Foo { }\";\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyAnalyzerV2RunnerUtility(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InterfacesWithBaseClasses))]\n\t\tpublic async Task CompatibleBaseClass_DoesNotTrigger(\n\t\t\tstring @interface,\n\t\t\tstring baseClass)\n\t\t{\n\t\t\tvar source = string.Format(Template, $\"{baseClass}, {@interface}\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyAnalyzerV2RunnerUtility(source);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task InterfaceWithoutBaseClass_Triggers(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, @interface);\n\t\t\tvar expected = Verify_WithRunnerUtility.Diagnostic().WithLocation(0).WithArguments(\"MyClass\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyAnalyzerV2RunnerUtility(source, expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task IncompatibleBaseClass_Triggers(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, $\"Foo, {@interface}\");\n\t\t\tvar expected = Verify_WithRunnerUtility.Diagnostic().WithLocation(0).WithArguments(\"MyClass\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyAnalyzerV2RunnerUtility(source, expected);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2RunnerUtility(compilation);\n\t\t}\n\t}\n\n\tpublic static string MemberCount(\n\t\tstring memberName,\n\t\tint memberCount)\n\t{\n\t\tvar result = memberName;\n\n\t\twhile (memberCount-- > 0)\n\t\t\tresult = $\"{{|CS0535:{result}|}}\";\n\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X3000/DoNotTestForConcreteTypeOfJsonSerializableTypesTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotTestForConcreteTypeOfJsonSerializableTypes>;\n\nnamespace Xunit.Analyzers;\n\npublic class DoNotTestForConcreteTypeOfJsonSerializableTypesTests\n{\n\t[Fact]\n\tpublic async Task AcceptanceTest()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Linq;\n\t\t\t\n\t\t\tpublic class GenericClass<T1,T2> { }\n\n\t\t\tpublic class TheClass {\n\t\t\t\t/// <summary>\n\t\t\t\t/// Testing XMLDOC references <see cref=\"MyMessage\"/>.\n\t\t\t\t/// </summary>\n\t\t\t\tpublic void TheMethod() {\n\t\t\t\t\tvar message = new object();\n\t\t\t\t\tvar collection = new List<object>();\n\n\t\t\t\t\t// Direct construction\n\t\t\t\t\t_ = new MyMessage { PropertyValue = 2112 };\n\t\t\t\t\tstatic MyMessage Create(int propertyValue) =>\n\t\t\t\t\t\tnew() { PropertyValue = propertyValue };\n\n\t\t\t\t\t// Non-serialized type\n\t\t\t\t\t_ = message is IMyMessage;\n\t\t\t\t\t_ = message is not IMyMessage;\n\t\t\t\t\t_ = message as IMyMessage;\n\t\t\t\t\t_ = (IMyMessage)message;\n\t\t\t\t\t_ = typeof(IMyMessage);\n\t\t\t\t\t_ = collection.OfType<IMyMessage>();\n\t\t\t\t\t_ = default(IEnumerable<IMyMessage>);\n\t\t\t\t\t_ = new GenericClass<IMyMessage, int>();\n\t\t\t\t\t_ = new GenericClass<int, IMyMessage>();\n\n\t\t\t\t\t// Serialized type\n\t\t\t\t\t_ = [|message is MyMessage|];\n\t\t\t\t\t_ = [|message is not MyMessage|];\n\t\t\t\t\t_ = [|message as MyMessage|];\n\t\t\t\t\t_ = [|(MyMessage)message|];\n\t\t\t\t\t_ = [|typeof(MyMessage)|];\n\t\t\t\t\t_ = collection.[|OfType<MyMessage>|]();\n\t\t\t\t\t_ = default([|IEnumerable<MyMessage>|]);\n\t\t\t\t\t_ = new [|GenericClass<MyMessage, int>|]();\n\t\t\t\t\t_ = new [|GenericClass<int, MyMessage>|]();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar messagePartial1 = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Sdk;\n\n\t\t\tpublic interface IMyMessage { }\n\n\t\t\t[JsonTypeID(\"MyMessage\")]\n\t\t\tsealed partial class MyMessage : IMyMessage { }\n\t\t\t\"\"\";\n\t\tvar messagePartial2 = /* lang=c#-test */ \"\"\"\n\t\t\tpublic partial class MyMessage {\n\t\t\t\tpublic int PropertyValue { get; set; }\n\t\t\t};\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp9, [messagePartial1, messagePartial2, code]);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X3000/FactAttributeDerivedClassesShouldProvideSourceInformationConstructorTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Analyzers.FactAttributeDerivedClassesShouldProvideSourceInformationConstructor>;\nusing Verify_v3_Pre300 = CSharpVerifier<FactAttributeDerivedClassesShouldProvideSourceInformationConstructorTests.Analyzer_v3_Pre300>;\n\npublic class FactAttributeDerivedClassesShouldProvideSourceInformationConstructorTests\n{\n\t[Fact]\n\tpublic async Task v2_OlderV3_DoesNotTrigger()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class MyFactAttribute : FactAttribute { }\n\n\t\t\tpublic class MyTheoryAttribute : TheoryAttribute { }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV2(code);\n\t\tawait Verify_v3_Pre300.VerifyAnalyzerV3(code);\n\t}\n\n\n\t[Fact]\n\tpublic async Task v3_Triggers()\n\t{\n#if ROSLYN_LATEST\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Runtime.CompilerServices;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class {|xUnit3003:MyFactAttribute|} : FactAttribute { }\n\n\t\t\tpublic class MyFactWithCtorArgs([CallerFilePath] string? foo = null, [CallerLineNumber] int bar = -1)\n\t\t\t\t: FactAttribute(foo, bar)\n\t\t\t{ }\n\n\t\t\tpublic class {|xUnit3003:MyTheoryAttribute|} : TheoryAttribute { }\n\n\t\t\tpublic class MyTheoryWithCtorArgs(\n\t\t\t\tint x,\n\t\t\t\tstring y,\n\t\t\t\t[CallerFilePath] string? sourceFilePath = null,\n\t\t\t\t[CallerLineNumber] int sourceLineNumber = -1)\n\t\t\t\t\t: TheoryAttribute(sourceFilePath, sourceLineNumber)\n\t\t\t{ }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp12, code);\n#else\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Runtime.CompilerServices;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class {|xUnit3003:MyFactAttribute|} : FactAttribute { }\n\n\t\t\tpublic class MyFactWithCtorArgs : FactAttribute\n\t\t\t{\n\t\t\t\tpublic MyFactWithCtorArgs([CallerFilePath] string? foo = null, [CallerLineNumber] int bar = -1)\n\t\t\t\t\t: base(foo, bar)\n\t\t\t\t{ }\n\t\t\t}\n\n\t\t\tpublic class {|xUnit3003:MyTheoryAttribute|} : TheoryAttribute { }\n\n\t\t\tpublic class MyTheoryWithCtorArgs : TheoryAttribute\n\t\t\t{\n\t\t\t\tpublic MyTheoryWithCtorArgs(int x, string y, [CallerFilePath] string? foo = null, [CallerLineNumber] int bar = -1)\n\t\t\t\t\t: base(foo, bar)\n\t\t\t\t{ }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyAnalyzerV3(LanguageVersion.CSharp8, code);\n#endif\n\t}\n\n\tinternal class Analyzer_v3_Pre300 : FactAttributeDerivedClassesShouldProvideSourceInformationConstructor\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(2, 999, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Analyzers/X3000/SerializableClassMustHaveParameterlessConstructorTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing VerifyV2 = CSharpVerifier<SerializableClassMustHaveParameterlessConstructorTests.V2Analyzer>;\nusing VerifyV3 = CSharpVerifier<SerializableClassMustHaveParameterlessConstructorTests.V3Analyzer>;\n\npublic class SerializableClassMustHaveParameterlessConstructorTests\n{\n\tpublic class JsonTypeID\n\t{\n\t\t[Fact]\n\t\tpublic async Task JsonTypeIDAcceptanceTest()\n\t\t{\n\t\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\tpublic class NonSerializedClass { }\n\n\t\t\t\t[JsonTypeID(\"1\")]\n\t\t\t\tpublic class SerializedWithImplicitCtor { }\n\n\t\t\t\t[JsonTypeID(\"2\")]\n\t\t\t\tpublic class SerializedWithExplicitCtor {\n\t\t\t\t\tpublic SerializedWithExplicitCtor() { }\n\t\t\t\t}\n\n\t\t\t\t[JsonTypeID(\"3\")]\n\t\t\t\tpublic class {|#0:SerializedWithNoMatchingCtor|} {\n\t\t\t\t\tpublic SerializedWithNoMatchingCtor(int _) { }\n\t\t\t\t}\n\n\t\t\t\t[JsonTypeID(\"4\")]\n\t\t\t\tpublic class {|#1:SerializedWithNonPublicCtor|} {\n\t\t\t\t\tprotected SerializedWithNonPublicCtor() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar expected = new[] {\n\t\t\t\tVerifyV3.Diagnostic().WithLocation(0).WithArguments(\"SerializedWithNoMatchingCtor\", \"Xunit.Sdk.JsonTypeIDAttribute\"),\n\t\t\t\tVerifyV3.Diagnostic().WithLocation(1).WithArguments(\"SerializedWithNonPublicCtor\", \"Xunit.Sdk.JsonTypeIDAttribute\"),\n\t\t\t};\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(source, expected);\n\t\t}\n\t}\n\n\tpublic class RunnerReporter\n\t{\n\t\tstatic readonly string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit.Runner.Common;\n\t\t\tusing Xunit.Sdk;\n\n\t\t\tpublic {1} {{|#0:MyRunnerReporter|}} : IRunnerReporter\n\t\t\t{{\n\t\t\t\t{0}\n\n\t\t\t\tpublic bool CanBeEnvironmentallyEnabled => false;\n\t\t\t\tpublic string Description => string.Empty;\n\t\t\t\tpublic bool ForceNoLogo => false;\n\t\t\t\tpublic bool IsEnvironmentallyEnabled => false;\n\t\t\t\tpublic string? RunnerSwitch => \"unused\";\n\n\t\t\t\tpublic ValueTask<IRunnerReporterMessageHandler> CreateMessageHandler(\n\t\t\t\t\tIRunnerLogger logger,\n\t\t\t\t\tIMessageSink? diagnosticMessageSink) =>\n\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t}}\n\t\t\t\"\"\";\n\n\t\t[Fact]\n\t\tpublic async Task ImplicitConstructor_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = string.Format(Template, string.Empty, \"class\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WrongConstructor_Triggers()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"public MyRunnerReporter(int x) { }\", \"class\");\n\t\t\tvar expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"MyRunnerReporter\", \"Xunit.Runner.Common.IRunnerReporter\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WrongConstructorOnAbstractClass_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"public MyRunnerReporter(int x) { }\", \"abstract class\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NonPublicConstructor_Triggers()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"protected MyRunnerReporter() { }\", \"class\");\n\t\t\tvar expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"MyRunnerReporter\", \"Xunit.Runner.Common.IRunnerReporter\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NonPublicConstructorOnAbstractClass_DoesNotTrigger()\n\t\t{\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, string.Format(Template, /* lang=c#-test */ \"protected MyRunnerReporter() { }\", \"abstract class\"));\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task PublicParameterlessConstructor_DoesNotTrigger()\n\t\t{\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, string.Format(Template, /* lang=c#-test */ \"public MyRunnerReporter() { }\", \"class\"));\n\t\t}\n\t}\n\n\tpublic class XunitSerializable\n\t{\n\t\tstatic readonly string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing {2};\n\n\t\t\tpublic interface IMySerializer : IXunitSerializable {{ }}\n\t\t\tpublic {3} {{|#0:Foo|}} : {0}\n\t\t\t{{\n\t\t\t\t{1}\n\t\t\t\tpublic void Deserialize(IXunitSerializationInfo info) {{ }}\n\t\t\t\tpublic void Serialize(IXunitSerializationInfo info) {{ }}\n\t\t\t}}\n\t\t\t\"\"\";\n\t\tpublic static TheoryData<string> Interfaces =\n\t\t[\n\t\t\t\"IXunitSerializable\",\n\t\t\t\"IMySerializer\"\n\t\t];\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task ImplicitConstructors_DoesNotTrigger(string @interface)\n\t\t{\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(string.Format(Template, @interface, \"\", \"Xunit.Abstractions\", \"class\"));\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(string.Format(Template, @interface, \"\", \"Xunit.Sdk\", \"class\"));\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task WrongConstructor_Triggers(string @interface)\n\t\t{\n\t\t\tvar v2Source = string.Format(Template, @interface, /* lang=c#-test */ \"public Foo(int x) { }\", \"Xunit.Abstractions\", \"class\");\n\t\t\tvar v2Expected = VerifyV2.Diagnostic().WithLocation(0).WithArguments(\"Foo\", \"Xunit.Abstractions.IXunitSerializable\");\n\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(v2Source, v2Expected);\n\n\t\t\tvar v3Source = string.Format(Template, @interface, /* lang=c#-test */ \"public Foo(int x) { }\", \"Xunit.Sdk\", \"class\");\n\t\t\tvar v3Expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"Foo\", \"Xunit.Sdk.IXunitSerializable\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(v3Source, v3Expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task WrongConstructorOnAbstractClass_DoesNotTrigger(string @interface)\n\t\t{\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(string.Format(Template, @interface, /* lang=c#-test */ \"public Foo(int x) { }\", \"Xunit.Abstractions\", \"abstract class\"));\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(string.Format(Template, @interface, /* lang=c#-test */ \"public Foo(int x) { }\", \"Xunit.Sdk\", \"abstract class\"));\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task NonPublicConstructor_Triggers(string @interface)\n\t\t{\n\t\t\tvar v2Source = string.Format(Template, @interface, /* lang=c#-test */ \"protected Foo() { }\", \"Xunit.Abstractions\", \"class\");\n\t\t\tvar v2Expected = VerifyV2.Diagnostic().WithLocation(0).WithArguments(\"Foo\", \"Xunit.Abstractions.IXunitSerializable\");\n\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(v2Source, v2Expected);\n\n\t\t\tvar v3Source = string.Format(Template, @interface, /* lang=c#-test */ \"protected Foo() { }\", \"Xunit.Sdk\", \"class\");\n\t\t\tvar v3Expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"Foo\", \"Xunit.Sdk.IXunitSerializable\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(v3Source, v3Expected);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task NonPublicConstructorOnAbstractClass_DoesNotTrigger(string @interface)\n\t\t{\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(string.Format(Template, @interface, /* lang=c#-test */ \"protected Foo() { }\", \"Xunit.Abstractions\", \"abstract class\"));\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(string.Format(Template, @interface, /* lang=c#-test */ \"protected Foo() { }\", \"Xunit.Sdk\", \"abstract class\"));\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(Interfaces))]\n\t\tpublic async Task PublicParameterlessConstructor_DoesNotTrigger(string @interface)\n\t\t{\n\t\t\tawait VerifyV2.VerifyAnalyzerV2(string.Format(Template, @interface, /* lang=c#-test */ \"public Foo() { }\", \"Xunit.Abstractions\", \"class\"));\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(string.Format(Template, @interface, /* lang=c#-test */ \"public Foo() { }\", \"Xunit.Sdk\", \"class\"));\n\t\t}\n\t}\n\n\tpublic class XunitSerializer\n\t{\n\t\tstatic readonly string Template = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit.Sdk;\n\n\t\t\tpublic {1} {{|#0:MySerializer|}} : IXunitSerializer\n\t\t\t{{\n\t\t\t\t{0}\n\n\t\t\t\tpublic object Deserialize(Type type, string serializedValue) => null!;\n\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t{{\n\t\t\t\t\tfailureReason = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}}\n\t\t\t\tpublic string Serialize(object value) => string.Empty;\n\t\t\t}}\n\t\t\t\"\"\";\n\n\t\t[Fact]\n\t\tpublic async Task ImplicitConstructor_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = string.Format(Template, string.Empty, \"class\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WrongConstructor_Triggers()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"public MySerializer(int x) { }\", \"class\");\n\t\t\tvar expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"MySerializer\", \"Xunit.Sdk.IXunitSerializer\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WrongConstructorOnAbstractClass_DoesNotTrigger()\n\t\t{\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, string.Format(Template, /* lang=c#-test */ \"public MySerializer(int x) { }\", \"abstract class\"));\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NonPublicConstructor_Triggers()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"protected MySerializer() { }\", \"class\");\n\t\t\tvar expected = VerifyV3.Diagnostic().WithLocation(0).WithArguments(\"MySerializer\", \"Xunit.Sdk.IXunitSerializer\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source, expected);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task NonPublicConstructorOnAbstractClass_DoesNotTrigger()\n\t\t{\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, string.Format(Template, /* lang=c#-test */ \"protected MySerializer() { }\", \"abstract class\"));\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task PublicParameterlessConstructor_DoesNotTrigger()\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"public MySerializer() { }\", \"class\");\n\n\t\t\tawait VerifyV3.VerifyAnalyzerV3(LanguageVersion.CSharp8, source);\n\t\t}\n\t}\n\n\tpublic class V2Analyzer : SerializableClassMustHaveParameterlessConstructor\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2Abstractions(compilation);\n\t}\n\n\tpublic class V3Analyzer : SerializableClassMustHaveParameterlessConstructor\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/ClassDataAttributeMustPointAtValidClassFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.ClassDataAttributeMustPointAtValidClass>;\n\npublic class ClassDataAttributeMustPointAtValidClassFixerTests\n{\n\t[Fact]\n\tpublic async Task AddsIEnumerable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData {\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1007:ClassData(typeof(TestData))|}]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV2 = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : {|CS0535:{|CS0535:IEnumerable<object[]>|}|}\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(TestData))]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV3 = afterV2.Replace(\"ClassData(typeof(TestData))\", \"{|xUnit1050:ClassData(typeof(TestData))|}\");\n\n\t\tawait Verify.VerifyCodeFixV2(before, afterV2, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t\tawait Verify.VerifyCodeFixV3(before, afterV3, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t}\n\n\t[Fact]\n\tpublic async Task ConvertsParameterlessConstructorToPublic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tTestData() { }\n\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1007:ClassData(typeof(TestData))|}]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV2 = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tpublic TestData() { }\n\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(TestData))]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV3 = afterV2.Replace(\"ClassData(typeof(TestData))\", \"{|xUnit1050:ClassData(typeof(TestData))|}\");\n\n\t\tawait Verify.VerifyCodeFixV2(before, afterV2, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t\tawait Verify.VerifyCodeFixV3(before, afterV3, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t}\n\n\t[Fact]\n\tpublic async Task AddsPublicParameterlessConstructor()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tTestData(int _) { }\n\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1007:ClassData(typeof(TestData))|}]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n#if ROSLYN_LATEST  // They seem to have removed the extra blank line somewhere between 4.11 and 4.14\n\t\tvar afterV2 = \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tTestData(int _) { }\n\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t\tpublic TestData()\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(TestData))]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n#else\n\t\tvar afterV2 = \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tTestData(int _) { }\n\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\n\t\t\t\tpublic TestData()\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(TestData))]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n#endif\n\t\tvar afterV3 = afterV2.Replace(\"ClassData(typeof(TestData))\", \"{|xUnit1050:ClassData(typeof(TestData))|}\");\n\n\t\tawait Verify.VerifyCodeFixV2(before, afterV2, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t\tawait Verify.VerifyCodeFixV3(before, afterV3, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t}\n\n\t[Fact]\n\tpublic async Task RemovesAbstractModifierFromDataClass()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestData : IEnumerable<object[]> {\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1007:ClassData(typeof(TestData))|}]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV2 = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestData : IEnumerable<object[]> {\n\t\t\t\tpublic IEnumerator<object[]> GetEnumerator() => null;\n\t\t\t\tIEnumerator IEnumerable.GetEnumerator() => null;\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[ClassData(typeof(TestData))]\n\t\t\t\tpublic void TestMethod(int _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar afterV3 = afterV2.Replace(\"ClassData(typeof(TestData))\", \"{|xUnit1050:ClassData(typeof(TestData))|}\");\n\n\t\tawait Verify.VerifyCodeFixV2(before, afterV2, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t\tawait Verify.VerifyCodeFixV3(before, afterV3, ClassDataAttributeMustPointAtValidClassFixer.Key_FixDataClass);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/CollectionDefinitionClassesMustBePublicFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.CollectionDefinitionClassesMustBePublic>;\n\npublic class CollectionDefinitionClassesMustBePublicFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MakesAllClassesPublic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection1\")]\n\t\t\tclass [|CollectionDefinitionClass1|] { }\n\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection2\")]\n\t\t\tinternal class [|CollectionDefinitionClass2|] { }\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection1\")]\n\t\t\tpublic class CollectionDefinitionClass1 { }\n\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection2\")]\n\t\t\tpublic class CollectionDefinitionClass2 { }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, CollectionDefinitionClassesMustBePublicFixer.Key_MakeCollectionDefinitionClassPublic);\n\t}\n\n\t[Fact]\n\tpublic async Task ForPartialClassDeclarations_MakesSingleDeclarationPublic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\tpartial class [|CollectionDefinitionClass|] { }\n\n\t\t\tpartial class CollectionDefinitionClass { }\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t[Xunit.CollectionDefinition(\"MyCollection\")]\n\t\t\tpublic partial class CollectionDefinitionClass { }\n\n\t\t\tpartial class CollectionDefinitionClass { }\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, CollectionDefinitionClassesMustBePublicFixer.Key_MakeCollectionDefinitionClassPublic);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/ConvertToFactFixTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify_X1003 = CSharpVerifier<Xunit.Analyzers.TheoryMethodMustHaveTestData>;\nusing Verify_X1006 = CSharpVerifier<Xunit.Analyzers.TheoryMethodShouldHaveParameters>;\n\npublic class ConvertToFactFixTests\n{\n\t[Fact]\n\tpublic async Task FixAll_From_X1003()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tpublic void [|TestMethod1|](int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\tpublic void [|TestMethod2|](string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2(string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1003.VerifyCodeFixFixAll(before, after, ConvertToFactFix.Key_ConvertToFact);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_From_X1006()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tpublic void [|TestMethod1|]() { }\n\n\t\t\t\t[Theory]\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1006.VerifyCodeFixFixAll(before, after, ConvertToFactFix.Key_ConvertToFact);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/ConvertToTheoryFixTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify_X1001 = CSharpVerifier<Xunit.Analyzers.FactMethodMustNotHaveParameters>;\nusing Verify_X1005 = CSharpVerifier<Xunit.Analyzers.FactMethodShouldNotHaveTestData>;\n\npublic class ConvertToTheoryFixTests\n{\n\t[Fact]\n\tpublic async Task FixAll_From_X1001()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void [|TestMethod1|](int a) { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void [|TestMethod2|](string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\tpublic void TestMethod2(string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1001.VerifyCodeFixFixAll(before, after, ConvertToTheoryFix.Key_ConvertToTheory);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_From_X1005()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void [|TestMethod1|]() { }\n\n\t\t\t\t[Fact]\n\t\t\t\t[InlineData(\"hello\")]\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(\"hello\")]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1005.VerifyCodeFixFixAll(before, after, ConvertToTheoryFix.Key_ConvertToTheory);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/DataAttributeShouldBeUsedOnATheoryFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DataAttributeShouldBeUsedOnATheory>;\n\npublic class DataAttributeShouldBeUsedOnATheoryFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MarkAsTheory()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void [|TestMethod1|]() { }\n\n\t\t\t\t[InlineData(\"hello\")]\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(\"hello\")]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, DataAttributeShouldBeUsedOnATheoryFixer.Key_MarkAsTheory);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_RemoveDataAttributes()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void [|TestMethod1|]() { }\n\n\t\t\t\t[InlineData(\"hello\")]\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, DataAttributeShouldBeUsedOnATheoryFixer.Key_RemoveDataAttributes);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/DoNotUseAsyncVoidForTestMethodsFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseAsyncVoidForTestMethods>;\n\nnamespace Xunit.Analyzers;\n\npublic class DoNotUseAsyncVoidForTestMethodsFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ConvertsMultipleMethodsToTask()\n\t{\n\t\tvar beforeV2 = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async void {|xUnit1048:TestMethod1|}() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async void {|xUnit1048:TestMethod2|}() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar beforeV3 = beforeV2.Replace(\"xUnit1048\", \"xUnit1049\");\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV2FixAll(beforeV2, after, DoNotUseAsyncVoidForTestMethodsFixer.Key_ConvertToTask);\n\t\tawait Verify.VerifyCodeFixV3FixAll(beforeV3, after, DoNotUseAsyncVoidForTestMethodsFixer.Key_ConvertToTask);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ConvertsMultipleMethodsToValueTask()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async void {|xUnit1049:TestMethod1|}() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async void {|xUnit1049:TestMethod2|}() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async ValueTask TestMethod1() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async ValueTask TestMethod2() {\n\t\t\t\t\tawait Task.Yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3FixAll(before, after, DoNotUseAsyncVoidForTestMethodsFixer.Key_ConvertToValueTask);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/DoNotUseConfigureAwaitFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.DoNotUseConfigureAwait>;\n\npublic class DoNotUseConfigureAwaitFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesAllConfigureAwaitCalls()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1() {\n\t\t\t\t\tawait Task.Delay(1).[|ConfigureAwait(false)|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2() {\n\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\tawait task.[|ConfigureAwait(false)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1() {\n\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2() {\n\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\tawait task;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllConfigureAwaitArguments()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1() {\n\t\t\t\t\tawait Task.Delay(1).[|ConfigureAwait(false)|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2() {\n\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\tawait task.[|ConfigureAwait(false)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1() {\n\t\t\t\t\tawait Task.Delay(1).ConfigureAwait(true);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2() {\n\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\tawait task.ConfigureAwait(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t}\n\n\tpublic class ConfigureAwait_Boolean\n\t{\n\t\tpublic static TheoryData<string> InvalidValues =\n\t\t[\n\t\t\t\"false\",       // Literal false\n\t\t\t\"1 == 2\",      // Logical false (we don't compute)\n\t\t\t\"1 == 1\",      // Logical true (we don't compute)\n\t\t\t\"booleanVar\",  // Reference value (we don't do lookup)\n\t\t];\n\n\t\tpublic class RemoveConfigureAwait\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task Task_Async(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tawait Task.Delay(1).[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tawait Task.Delay(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task Task_NonAsync(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tTask.Delay(1).[|ConfigureAwait({0})|].GetAwaiter().GetResult();\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tTask.Delay(1).GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task TaskOfT(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\t\tawait task.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\t\tawait task;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task ValueTask(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask);\n\t\t\t\t\t\t\tawait valueTask.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask);\n\t\t\t\t\t\t\tawait valueTask;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task ValueTaskOfT(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask<object>);\n\t\t\t\t\t\t\tawait valueTask.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask<object>);\n\t\t\t\t\t\t\tawait valueTask;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_RemoveConfigureAwait);\n\t\t\t}\n\t\t}\n\n\t\tpublic class ReplaceConfigureAwait\n\t\t{\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task Task_Async(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tawait Task.Delay(1).[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task Task_NonAsync(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tTask.Delay(1).[|ConfigureAwait({0})|].GetAwaiter().GetResult();\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tTask.Delay(1).ConfigureAwait(true).GetAwaiter().GetResult();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task TaskOfT(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\t\tawait task.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\t\tawait task.ConfigureAwait(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task ValueTask(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask);\n\t\t\t\t\t\t\tawait valueTask.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask);\n\t\t\t\t\t\t\tawait valueTask.ConfigureAwait(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t\t}\n\n\t\t\t[Theory]\n\t\t\t[MemberData(nameof(InvalidValues), MemberType = typeof(ConfigureAwait_Boolean))]\n\t\t\tpublic async Task ValueTaskOfT(string argumentValue)\n\t\t\t{\n\t\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask<object>);\n\t\t\t\t\t\t\tawait valueTask.[|ConfigureAwait({0})|];\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t\t\"\"\", argumentValue);\n\t\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\t\tusing Xunit;\n\n\t\t\t\t\tpublic class TestClass {\n\t\t\t\t\t\t[Fact]\n\t\t\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\t\t\tvar booleanVar = true;\n\t\t\t\t\t\t\tvar valueTask = default(ValueTask<object>);\n\t\t\t\t\t\t\tawait valueTask.ConfigureAwait(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\"\"\";\n\n\t\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t\t}\n\t\t}\n\t}\n\n#if NETCOREAPP\n\n\tpublic class ConfigureAwait_ConfigureAwaitOptions\n\t{\n\t\tpublic static TheoryData<string> InvalidValues =\n\t\t[\n\t\t\t// Literal values\n\t\t\t/* lang=c#-test */ \"ConfigureAwaitOptions.None\",\n\t\t\t/* lang=c#-test */ \"ConfigureAwaitOptions.SuppressThrowing\",\n\t\t\t/* lang=c#-test */ \"ConfigureAwaitOptions.ForceYielding | ConfigureAwaitOptions.SuppressThrowing\",\n\n\t\t\t// Reference values (we don't do lookup)\n\t\t\t/* lang=c#-test */ \"enumVar\",\n\t\t];\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task Task_Async(string argumentValue)\n\t\t{\n\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tawait Task.Delay(1).[|ConfigureAwait({0})|];\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tawait Task.Delay(1).ConfigureAwait({0} | ConfigureAwaitOptions.ContinueOnCapturedContext);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task Task_NonAsync(string argumentValue)\n\t\t{\n\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tTask.Delay(1).[|ConfigureAwait({0})|].GetAwaiter().GetResult();\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tTask.Delay(1).ConfigureAwait({0} | ConfigureAwaitOptions.ContinueOnCapturedContext).GetAwaiter().GetResult();\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(InvalidValues))]\n\t\tpublic async Task TaskOfT(string argumentValue)\n\t\t{\n\t\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\tawait task.[|ConfigureAwait({0})|];\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\t\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit;\n\n\t\t\t\tpublic class TestClass {{\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\t\tvar enumVar = ConfigureAwaitOptions.ContinueOnCapturedContext;\n\t\t\t\t\t\tvar task = Task.FromResult(42);\n\t\t\t\t\t\tawait task.ConfigureAwait({0} | ConfigureAwaitOptions.ContinueOnCapturedContext);\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\t\"\"\", argumentValue);\n\n\t\t\tawait Verify.VerifyCodeFix(before, after, DoNotUseConfigureAwaitFixer.Key_ReplaceArgumentValue);\n\t\t}\n\t}\n\n#endif\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/FactMethodMustNotHaveParametersFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.FactMethodMustNotHaveParameters>;\n\npublic class FactMethodMustNotHaveParametersFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesParametersFromAllMethods()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void [|TestMethod1|](int x) { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void [|TestMethod2|](string a, int b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, FactMethodMustNotHaveParametersFixer.Key_RemoveParameters);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/FactMethodShouldNotHaveTestDataFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.FactMethodShouldNotHaveTestData>;\n\npublic class FactMethodShouldNotHaveTestDataFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesDataAttributesFromAllMethods()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void [|TestMethod1|](int x) { }\n\n\t\t\t\t[Fact]\n\t\t\t\t[InlineData(\"a\")]\n\t\t\t\tpublic void [|TestMethod2|](string s) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2(string s) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, FactMethodShouldNotHaveTestDataFixer.Key_RemoveDataAttributes);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/InlineDataMustMatchTheoryParameters_ExtraValueFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataMustMatchTheoryParameters>;\n\npublic class InlineDataMustMatchTheoryParameters_ExtraValueFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesMultipleUnusedDataValues()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {|xUnit1011:21.12|})]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, {|xUnit1011:\"extra\"|})]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42)]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, InlineDataMustMatchTheoryParameters_ExtraValueFixer.Key_RemoveExtraDataValue);\n\t}\n\n\t[Fact]\n\tpublic async Task RemovesUnusedData()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {|xUnit1011:21.12|})]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42)]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, InlineDataMustMatchTheoryParameters_ExtraValueFixer.Key_RemoveExtraDataValue);\n\t}\n\n\t[Theory]\n\t[InlineData(\"21.12\", \"double\")]\n\t[InlineData(@\"\"\"Hello world\"\"\", \"string\")]\n\tpublic async Task AddsParameterWithCorrectType(\n\t\tstring value,\n\t\tstring valueType)\n\t{\n\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {{|xUnit1011:{0}|}})]\n\t\t\t\tpublic void TestMethod(int a) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", value);\n\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {0})]\n\t\t\t\tpublic void TestMethod(int a, {1} p) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", value, valueType);\n\n\t\tawait Verify.VerifyCodeFix(before, after, InlineDataMustMatchTheoryParameters_ExtraValueFixer.Key_AddTheoryParameter);\n\t}\n\n\t[Fact]\n\tpublic async Task AddsParameterWithNonConflictingName()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {|xUnit1011:21.12|})]\n\t\t\t\tpublic void TestMethod(int p) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, 21.12)]\n\t\t\t\tpublic void TestMethod(int p, double p_2) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, InlineDataMustMatchTheoryParameters_ExtraValueFixer.Key_AddTheoryParameter);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataMustMatchTheoryParameters>;\n\npublic class InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MakesMultipleParametersNullable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData({|xUnit1012:null|}, {|xUnit1012:null|})]\n\t\t\t\tpublic void TestMethod1(int a, int b) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, {|xUnit1012:null|})]\n\t\t\t\tpublic void TestMethod2(int a, object b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(null, null)]\n\t\t\t\tpublic void TestMethod1(int? a, int? b) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(42, null)]\n\t\t\t\tpublic void TestMethod2(int a, object? b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(LanguageVersion.CSharp8, before, after, InlineDataMustMatchTheoryParameters_NullShouldNotBeUsedForIncompatibleParameterFixer.Key_MakeParameterNullable);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/InlineDataMustMatchTheoryParameters_TooFewValuesFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataMustMatchTheoryParameters>;\n\npublic class InlineDataMustMatchTheoryParameters_TooFewValuesFixerTests\n{\n\t[Theory]\n\t[InlineData(\"bool\", \"false\")]\n\t[InlineData(\"char\", \"'\\\\0'\")]\n\t[InlineData(\"double\", \"0D\")]\n\t[InlineData(\"float\", \"0F\")]\n\t[InlineData(\"int\", \"0\")]\n\t[InlineData(\"string\", \"\\\"\\\"\")]\n\t[InlineData(\"object\", \"null\")]\n\t[InlineData(\"Color\", \"default(Color)\")]\n\tpublic async Task MakesParameterNullable(\n\t\tstring valueType,\n\t\tstring defaultValue)\n\t{\n\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic enum Color {{ Red, Green, Blue }}\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Theory]\n\t\t\t\t[{{|xUnit1009:InlineData|}}]\n\t\t\t\tpublic void TestMethod({0} p) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", valueType);\n\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic enum Color {{ Red, Green, Blue }}\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData({1})]\n\t\t\t\tpublic void TestMethod({0} p) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", valueType, defaultValue);\n\n\t\tawait Verify.VerifyCodeFix(before, after, InlineDataMustMatchTheoryParameters_TooFewValuesFixer.Key_AddDefaultValues);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_AddsDefaultValuesToMultipleAttributes()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1009:InlineData|}]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1009:InlineData|}]\n\t\t\t\tpublic void TestMethod2(string a, bool b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(0)]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(\"\", false)]\n\t\t\t\tpublic void TestMethod2(string a, bool b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, InlineDataMustMatchTheoryParameters_TooFewValuesFixer.Key_AddDefaultValues);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/InlineDataShouldBeUniqueWithinTheoryFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.InlineDataShouldBeUniqueWithinTheory>;\n\npublic class InlineDataShouldBeUniqueWithinTheoryFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesDuplicateData()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\t[[|InlineData(1)|]]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(\"a\")]\n\t\t\t\t[[|InlineData(\"a\")|]]\n\t\t\t\tpublic void TestMethod2(string s) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(\"a\")]\n\t\t\t\tpublic void TestMethod2(string s) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, InlineDataShouldBeUniqueWithinTheoryFixer.Key_RemoveDuplicateInlineData);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/LocalFunctionsCannotBeTestFunctionsFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.LocalFunctionsCannotBeTestFunctions>;\n\npublic class LocalFunctionsCannotBeTestFunctionsFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesAttributesFromAllLocalFunctions()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void Method() {\n\t\t\t\t\t[[|Fact|]]\n\t\t\t\t\tvoid LocalFunction1() {\n\t\t\t\t\t}\n\n\t\t\t\t\t[[|Theory|]]\n\t\t\t\t\tvoid LocalFunction2() {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic void Method() {\n\t\t\t\t\tvoid LocalFunction1() {\n\t\t\t\t\t}\n\n\t\t\t\t\tvoid LocalFunction2() {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(LanguageVersion.CSharp9, before, after, LocalFunctionsCannotBeTestFunctionsFixer.Key_RemoveAttribute);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_ExtraValueFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_ExtraValueFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesMultipleUnusedDataValues()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1(int n) => new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> TestData2(int n) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1), 42, {|xUnit1036:21.12|})]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2), 42, {|xUnit1036:99.9|})]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1(int n) => new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> TestData2(int n) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1), 42)]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2), 42)]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_ExtraValueFixer.Key_RemoveExtraDataValue);\n\t}\n\n\t[Fact]\n\tpublic async Task RemovesUnusedData()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {|xUnit1036:21.12|})]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42)]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_ExtraValueFixer.Key_RemoveExtraDataValue);\n\t}\n\n\t[Theory]\n\t[InlineData(\"21.12\", \"double\")]\n\t[InlineData(@\"\"\"Hello world\"\"\", \"string\")]\n\tpublic async Task AddsParameterWithCorrectType(\n\t\tstring value,\n\t\tstring valueType)\n\t{\n\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic static TheoryData<int> TestData(int n) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {{|xUnit1036:{0}|}})]\n\t\t\t\tpublic void TestMethod(int a) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", value);\n\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\tpublic static TheoryData<int> TestData(int n, {1} p) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {0})]\n\t\t\t\tpublic void TestMethod(int a) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", value, valueType);\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_ExtraValueFixer.Key_AddMethodParameter);\n\t}\n\n\t[Fact]\n\tpublic async Task AddsParameterWithNonConflictingName()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int p) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {|xUnit1036:21.12|})]\n\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int p, double p_2) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, 21.12)]\n\t\t\t\tpublic void TestMethod(int n) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_ExtraValueFixer.Key_AddMethodParameter);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_NameOfFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_NameOfFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ConvertsAllStringsToNameOf()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> DataSource1 = new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> DataSource2 = new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData({|xUnit1014:\"DataSource1\"|})]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData({|xUnit1014:\"DataSource2\"|})]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> DataSource1 = new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> DataSource2 = new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource1))]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource2))]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_NameOfFixer.Key_UseNameof);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MakesMultipleParametersNullable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1(int n, int k) => new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> TestData2(int n, int k) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1), 42, {|xUnit1034:null|})]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2), 42, {|xUnit1034:null|})]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1(int n, int? k) => new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<int> TestData2(int n, int? k) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1), 42, null)]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2), 42, null)]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer.Key_MakeParameterNullable);\n\t}\n\n\t[Fact]\n\tpublic async Task MakesParameterNullable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n, int k) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {|xUnit1034:null|})]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n, int? k) => new TheoryData<int>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, null)]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer.Key_MakeParameterNullable);\n\t}\n\n\t[Fact]\n\tpublic async Task MakesReferenceParameterNullable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n, string k) => new TheoryData<int> { n };\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, {|xUnit1034:null|})]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData(int n, string? k) => new TheoryData<int> { n };\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData), 42, null)]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(LanguageVersion.CSharp8, before, after, MemberDataShouldReferenceValidMember_NullShouldNotBeUsedForIncompatibleParameterFixer.Key_MakeParameterNullable);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_ParamsForNonMethodFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_ParamsForNonMethodFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesParametersFromNonMethodMemberData()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass\n\t\t\t{\n\t\t\t\tpublic static TheoryData<int> DataSource1 = new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<string> DataSource2 = new TheoryData<string>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource1), {|xUnit1021:\"abc\", 123|})]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource2), {|xUnit1021:\"xyz\"|})]\n\t\t\t\tpublic void TestMethod2(string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass\n\t\t\t{\n\t\t\t\tpublic static TheoryData<int> DataSource1 = new TheoryData<int>();\n\t\t\t\tpublic static TheoryData<string> DataSource2 = new TheoryData<string>();\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource1))]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(DataSource2))]\n\t\t\t\tpublic void TestMethod2(string b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_ParamsForNonMethodFixer.Key_RemoveArgumentsFromMemberData);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_ReturnTypeFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_ReturnTypeFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ChangesReturnTypeOnMultipleMembers()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<object> Data1 => null;\n\t\t\t\tpublic static IEnumerable<object> Data2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1019:MemberData(nameof(Data1))|}]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1019:MemberData(nameof(Data2))|}]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<object[]> Data1 => null;\n\t\t\t\tpublic static IEnumerable<object[]> Data2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1042:MemberData(nameof(Data1))|}]\n\t\t\t\tpublic void TestMethod1(int a) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1042:MemberData(nameof(Data2))|}]\n\t\t\t\tpublic void TestMethod2(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_ReturnTypeFixer.Key_ChangeMemberReturnType_ObjectArray);\n\t}\n\n\t[Fact]\n\tpublic async Task ChangesReturnType_ObjectArray()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<object> Data => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1019:MemberData(nameof(Data))|}]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<object[]> Data => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1042:MemberData(nameof(Data))|}]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_ReturnTypeFixer.Key_ChangeMemberReturnType_ObjectArray);\n\t}\n\n\t[Fact]\n\tpublic async Task ChangesReturnType_TheoryDataRow()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<object> Data => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1019:MemberData(nameof(Data))|}]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static IEnumerable<ITheoryDataRow> Data => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1042:MemberData(nameof(Data))|}]\n\t\t\t\tpublic void TestMethod(int a) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, MemberDataShouldReferenceValidMember_ReturnTypeFixer.Key_ChangeMemberReturnType_ITheoryDataRow);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_StaticFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_StaticFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MarksMultipleDataMembersAsStatic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic TheoryData<int> TestData1 => null;\n\t\t\t\tpublic TheoryData<string> TestData2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1017:MemberData(nameof(TestData1))|}]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1017:MemberData(nameof(TestData2))|}]\n\t\t\t\tpublic void TestMethod2(string x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1 => null;\n\t\t\t\tpublic static TheoryData<string> TestData2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1))]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2))]\n\t\t\t\tpublic void TestMethod2(string x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_StaticFixer.Key_MakeMemberStatic);\n\t}\n\n\t[Fact]\n\tpublic async Task MarksDataMemberAsStatic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic TheoryData<int> TestData => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1017:MemberData(nameof(TestData))|}]\n\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData))]\n\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_StaticFixer.Key_MakeMemberStatic);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/MemberDataShouldReferenceValidMember_VisibilityFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.MemberDataShouldReferenceValidMember>;\n\npublic class MemberDataShouldReferenceValidMember_VisibilityFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_SetsPublicModifierOnMultipleMembers()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tstatic TheoryData<int> TestData1 => null;\n\t\t\t\tinternal static TheoryData<string> TestData2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1016:MemberData(nameof(TestData1))|}]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[{|xUnit1016:MemberData(nameof(TestData2))|}]\n\t\t\t\tpublic void TestMethod2(string x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\t// Roslyn 3.11 inserts a blank line after a member whose accessibility modifiers are changed\n#if ROSLYN_LATEST\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1 => null;\n\t\t\t\tpublic static TheoryData<string> TestData2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1))]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2))]\n\t\t\t\tpublic void TestMethod2(string x) { }\n\t\t\t}\n\t\t\t\"\"\";\n#else\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData1 => null;\n\n\t\t\t\tpublic static TheoryData<string> TestData2 => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData1))]\n\t\t\t\tpublic void TestMethod1(int x) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData2))]\n\t\t\t\tpublic void TestMethod2(string x) { }\n\t\t\t}\n\t\t\t\"\"\";\n#endif\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, MemberDataShouldReferenceValidMember_VisibilityFixer.Key_MakeMemberPublic);\n\t}\n\n\t[Theory]\n\t[InlineData(\"\")]\n\t[InlineData(\"protected \")]\n\t[InlineData(\"internal \")]\n\tpublic async Task SetsPublicModifier(string badModifier)\n\t{\n\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t{0}static TheoryData<int> TestData => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[{{|xUnit1016:MemberData(nameof(TestData))|}}]\n\t\t\t\tpublic void TestMethod(int x) {{ }}\n\t\t\t}}\n\t\t\t\"\"\", badModifier);\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tpublic static TheoryData<int> TestData => null;\n\n\t\t\t\t[Theory]\n\t\t\t\t[MemberData(nameof(TestData))]\n\t\t\t\tpublic void TestMethod(int x) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, MemberDataShouldReferenceValidMember_VisibilityFixer.Key_MakeMemberPublic);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/PublicMethodShouldBeMarkedAsTestFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.PublicMethodShouldBeMarkedAsTest>;\n\npublic class PublicMethodShouldBeMarkedAsTestFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_AddsFactToAllPublicMethodsWithoutParameters()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\n\t\t\t\tpublic void [|TestMethod3|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod3() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, PublicMethodShouldBeMarkedAsTestFixer.Key_ConvertToFact);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_AddsTheoryToAllPublicMethodsWithParameters()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic void [|TestMethod2|](int _) { }\n\n\t\t\t\tpublic void [|TestMethod3|](string _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\t[Theory]\n\t\t\t\tpublic void TestMethod2(int _) { }\n\n\t\t\t\t[Theory]\n\t\t\t\tpublic void TestMethod3(string _) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, PublicMethodShouldBeMarkedAsTestFixer.Key_ConvertToTheory);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_MakesAllMethodsInternal()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\n\t\t\t\tpublic void [|TestMethod3|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() { }\n\n\t\t\t\tinternal void TestMethod2() { }\n\n\t\t\t\tinternal void TestMethod3() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, PublicMethodShouldBeMarkedAsTestFixer.Key_MakeMethodInternal);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/RemoveMethodParameterFixTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Xunit.Analyzers.Fixes;\nusing Verify_X1022 = CSharpVerifier<RemoveMethodParameterFixTests.Analyzer_X1022>;\nusing Verify_X1026 = CSharpVerifier<Xunit.Analyzers.TheoryMethodShouldUseAllParameters>;\n\npublic class RemoveMethodParameterFixTests\n{\n\t[Fact]\n\tpublic async Task X1022_RemoveParamsArray()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, 2, 3)]\n\t\t\t\tpublic void TestMethod([|params int[] values|]) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, 2, 3)]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1022.VerifyCodeFix(before, after, RemoveMethodParameterFix.Key_RemoveParameter);\n\t}\n\n\t[Fact]\n\tpublic async Task X1026_RemovesUnusedParameter()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod(int [|arg|]) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1)]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1026.VerifyCodeFix(before, after, RemoveMethodParameterFix.Key_RemoveParameter);\n\t}\n\n\t[Fact]\n\tpublic async Task X1026_DoesNotCrashWhenParameterDeclarationIsMissing()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, 1)]\n\t\t\t\tpublic void Test1(int x, {|CS1001:{|CS1031:{|xUnit1026:|})|}|}\n\t\t\t\t{\n\t\t\t\t\tvar x1 = x;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, 1)]\n\t\t\t\tpublic void Test1(int x, {|CS1001:{|CS1031:{|xUnit1026:|})|}|}\n\t\t\t\t{\n\t\t\t\t\tvar x1 = x;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X1026.VerifyCodeFix(before, after, RemoveMethodParameterFix.Key_RemoveParameter);\n\t}\n\n\tinternal class Analyzer_X1022 : TheoryMethodCannotHaveParamsArray\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 1, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TestClassCannotBeNestedInGenericClassFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassCannotBeNestedInGenericClass>;\n\npublic class TestClassCannotBeNestedInGenericClassFixerTests\n{\n\t[Fact]\n\tpublic async Task MovesTestClassOutOfGenericParent()\n\t{\n\t\tconst string before = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class OpenGenericType<T>\n\t\t\t{\n\t\t\t\tpublic class [|NestedTestClass|]\n\t\t\t\t{\n\t\t\t\t\t[Xunit.Fact]\n\t\t\t\t\tpublic void TestMethod() { }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tconst string after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic abstract class OpenGenericType<T>\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic class NestedTestClass\n\t\t\t{\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, TestClassCannotBeNestedInGenericClassFixer.Key_ExtractTestClass);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TestClassMustBePublicFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassMustBePublic>;\n\npublic class TestClassMustBePublicFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_MakesAllClassesPublic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tclass [|TestClass1|] {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\n\t\t\tinternal class [|TestClass2|] {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass1 {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\n\t\t\tpublic class TestClass2 {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, TestClassMustBePublicFixer.Key_MakeTestClassPublic);\n\t}\n\n\t[Fact]\n\tpublic async Task ForPartialClassDeclarations_MakesSingleDeclarationPublic()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tpartial class [|TestClass|] {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod1() {}\n\t\t\t}\n\n\t\t\tpartial class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod2() {}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic partial class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod1() {}\n\t\t\t}\n\n\t\t\tpartial class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod2() {}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, TestClassMustBePublicFixer.Key_MakeTestClassPublic);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TestClassShouldHaveTFixtureArgumentFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestClassShouldHaveTFixtureArgument>;\n\npublic class TestClassShouldHaveTFixtureArgumentFixerTests\n{\n\t[Fact]\n\tpublic async Task ForClassWithoutField_GenerateFieldAndConstructor()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData { }\n\n\t\t\tpublic class [|TestClass|]: Xunit.IClassFixture<FixtureData> {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData { }\n\n\t\t\tpublic class TestClass: Xunit.IClassFixture<FixtureData> {\n\t\t\t\tprivate readonly FixtureData _fixtureData;\n\n\t\t\t\tpublic TestClass(FixtureData fixtureData)\n\t\t\t\t{\n\t\t\t\t\t_fixtureData = fixtureData;\n\t\t\t\t}\n\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, TestClassShouldHaveTFixtureArgumentFixer.Key_GenerateConstructor);\n\t}\n\n\t[Fact]\n\tpublic async Task ForGenericTFixture_GenerateFieldAndConstructor()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData<T> { }\n\n\t\t\tpublic class [|TestClass|]: Xunit.IClassFixture<FixtureData<object>> {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class FixtureData<T> { }\n\n\t\t\tpublic class TestClass: Xunit.IClassFixture<FixtureData<object>> {\n\t\t\t\tprivate readonly FixtureData<object> _fixtureData;\n\n\t\t\t\tpublic TestClass(FixtureData<object> fixtureData)\n\t\t\t\t{\n\t\t\t\t\t_fixtureData = fixtureData;\n\t\t\t\t}\n\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, TestClassShouldHaveTFixtureArgumentFixer.Key_GenerateConstructor);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TestMethodMustNotHaveMultipleFactAttributesFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodMustNotHaveMultipleFactAttributes>;\n\npublic class TestMethodMustNotHaveMultipleFactAttributesFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesDuplicateAttributes()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class FactDerivedAttribute : FactAttribute { }\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\t[{|CS0579:Fact|}]\n\t\t\t\tpublic void [|TestMethod1|]() { }\n\n\t\t\t\t[Fact]\n\t\t\t\t[{|CS0579:Fact|}]\n\t\t\t\tpublic void [|TestMethod2|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class FactDerivedAttribute : FactAttribute { }\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, TestMethodMustNotHaveMultipleFactAttributesFixer.Key_KeepAttribute(\"Fact\"));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TestMethodShouldNotBeSkippedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TestMethodShouldNotBeSkipped>;\n\npublic class TestMethodShouldNotBeSkippedFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesSkipFromAllMethods()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact([|Skip = \"Don't run this\"|])]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Fact([|Skip = \"Also skipped\"|])]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod1() { }\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod2() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, TestMethodShouldNotBeSkippedFixer.Key_RemoveSkipArgument);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TheoryDataShouldNotUseTheoryDataRowFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.TheoryDataShouldNotUseTheoryDataRow>;\n\npublic class TheoryDataShouldNotUseTheoryDataRowFixerTests\n{\n\tconst string myRowSource = /* lang=c#-test */ \"\"\"\n\t\tpublic class MyRow : ITheoryDataRow {\n\t\t\tpublic object?[] GetData() { return null; }\n\t\t\tpublic bool? Explicit { get; }\n\t\t\tpublic string? Label { get; }\n\t\t\tpublic string? Skip { get; }\n\t\t\tpublic Type? SkipType { get; }\n\t\t\tpublic string? SkipUnless { get; }\n\t\t\tpublic string? SkipWhen { get; }\n\t\t\tpublic string? TestDisplayName { get; }\n\t\t\tpublic int? Timeout { get; }\n\t\t\tpublic Dictionary<string, HashSet<string>>? Traits { get; }\n\t\t}\n\t\t\"\"\";\n\n\t[Fact]\n\tpublic async Task FixAll_ConvertsFixableTheoryDataToIEnumerable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tprivate [|TheoryData<ITheoryDataRow>|] field1;\n\t\t\t\tprivate [|TheoryData<TheoryDataRow<int>>|] field2;\n\t\t\t\tprivate [|TheoryData<MyRow>|] field3;\n\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|] property1 { get; set; }\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|] property2 { get; set; }\n\t\t\t\tpublic [|TheoryData<MyRow>|] property3 { get; set; }\n\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|] method1() {  [|TheoryData<ITheoryDataRow>|] data; return null; }\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|] method2() { [|TheoryData<TheoryDataRow<int>>|] data; return null; }\n\t\t\t\tpublic [|TheoryData<MyRow>|] method3() { [|TheoryData<MyRow>|] data; return null; }\n\t\t\t}\n\t\t\t\"\"\" + myRowSource;\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tprivate IEnumerable<ITheoryDataRow> field1;\n\t\t\t\tprivate IEnumerable<TheoryDataRow<int>> field2;\n\t\t\t\tprivate IEnumerable<MyRow> field3;\n\n\t\t\t\tpublic IEnumerable<ITheoryDataRow> property1 { get; set; }\n\t\t\t\tpublic IEnumerable<TheoryDataRow<int>> property2 { get; set; }\n\t\t\t\tpublic IEnumerable<MyRow> property3 { get; set; }\n\n\t\t\t\tpublic IEnumerable<ITheoryDataRow> method1() { IEnumerable<ITheoryDataRow> data; return null; }\n\t\t\t\tpublic IEnumerable<TheoryDataRow<int>> method2() { IEnumerable<TheoryDataRow<int>> data; return null; }\n\t\t\t\tpublic IEnumerable<MyRow> method3() { IEnumerable<MyRow> data; return null; }\n\t\t\t}\n\t\t\t\"\"\" + myRowSource;\n\n\t\tawait Verify.VerifyCodeFixV3FixAll(LanguageVersion.CSharp9, before, after, TheoryDataShouldNotUseTheoryDataRowFixer.Key_UseIEnumerable);\n\t}\n\n\t[Fact]\n\tpublic async Task AcceptanceTest_Unfixable()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\tprivate [|TheoryData<ITheoryDataRow>|] field11 = new();\n\t\t\t\tprivate [|TheoryData<TheoryDataRow<int>>|] field12 = new();\n\t\t\t\tprivate [|TheoryData<MyRow>|] field13 = new();\n\n\t\t\t\tprivate [|TheoryData<ITheoryDataRow, int>|] field21;\n\t\t\t\tprivate [|TheoryData<TheoryDataRow<int>, int>|] field22;\n\t\t\t\tprivate [|TheoryData<MyRow, int>|] field23;\n\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow>|] property11 { get; set; } = new();\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>>|] property12 { get; set; } = new();\n\t\t\t\tpublic [|TheoryData<MyRow>|] property13 { get; set; } = new();\n\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow, int>|] property21 { get; set; }\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>, int>|] property22 { get; set; }\n\t\t\t\tpublic [|TheoryData<MyRow, int>|] property23 { get; set; }\n\n\t\t\t\tpublic [|TheoryData<ITheoryDataRow, int>|] method11() { [|TheoryData<ITheoryDataRow, int>|] data; return null; }\n\t\t\t\tpublic [|TheoryData<TheoryDataRow<int>, int>|] method12() { [|TheoryData<TheoryDataRow<int>, int>|] data; return null; }\n\t\t\t\tpublic [|TheoryData<MyRow, int>|] method13() { [|TheoryData<MyRow, int>|] data; return null; }\n\t\t\t}\n\t\t\t\"\"\" + myRowSource;\n\n\t\tawait Verify.VerifyCodeFixV3(LanguageVersion.CSharp9, before, after: before, TheoryDataShouldNotUseTheoryDataRowFixer.Key_UseIEnumerable);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/TheoryMethodCannotHaveDefaultParameterFixerTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Xunit.Analyzers.Fixes;\nusing Verify_v2_Pre220 = CSharpVerifier<TheoryMethodCannotHaveDefaultParameterFixerTests.Analyzer>;\n\npublic class TheoryMethodCannotHaveDefaultParameterFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesDefaultParameterValues()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, \"a\")]\n\t\t\t\tpublic void TestMethod1(int x [|= 0|], string y [|= \"default\"|]) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(true)]\n\t\t\t\tpublic void TestMethod2(bool b [|= false|]) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(1, \"a\")]\n\t\t\t\tpublic void TestMethod1(int x, string y) { }\n\n\t\t\t\t[Theory]\n\t\t\t\t[InlineData(true)]\n\t\t\t\tpublic void TestMethod2(bool b) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_v2_Pre220.VerifyCodeFixV2FixAll(before, after, TheoryMethodCannotHaveDefaultParameterFixer.Key_RemoveParameterDefault);\n\t}\n\n\tinternal class Analyzer : TheoryMethodCannotHaveDefaultParameter\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 1, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X1000/UseCancellationTokenFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.UseCancellationToken>;\n\npublic class UseCancellationTokenFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_AppliesAllFixesInDocument()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1()\n\t\t\t\t{\n\t\t\t\t\tawait [|Task.Delay(1)|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2()\n\t\t\t\t{\n\t\t\t\t\tawait [|Task.Delay(1)|];\n\t\t\t\t\tawait [|Task.Delay(2)|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod3()\n\t\t\t\t{\n\t\t\t\t\t[|FunctionWithOverload(42)|];\n\t\t\t\t\t[|FunctionWithDefaults()|];\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) { }\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod1()\n\t\t\t\t{\n\t\t\t\t\tawait Task.Delay(1, TestContext.Current.CancellationToken);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task TestMethod2()\n\t\t\t\t{\n\t\t\t\t\tawait Task.Delay(1, TestContext.Current.CancellationToken);\n\t\t\t\t\tawait Task.Delay(2, TestContext.Current.CancellationToken);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod3()\n\t\t\t\t{\n\t\t\t\t\tFunctionWithOverload(42, TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(cancellationToken: TestContext.Current.CancellationToken);\n\t\t\t\t}\n\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) { }\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3FixAll(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n\n\t[Fact]\n\tpublic async Task UseCancellationTokenArgument()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\t[|FunctionWithOverload(42)|];\n\t\t\t\t\t[|FunctionWithOverload(42, default(CancellationToken))|];\n\t\t\t\n\t\t\t\t\t[|FunctionWithDefaults()|];\n\t\t\t\t\t[|FunctionWithDefaults(42)|];\n\t\t\t\t\t[|FunctionWithDefaults(cancellationToken: default(CancellationToken))|];\n\t\t\t\t\t[|FunctionWithDefaults(42, cancellationToken: default(CancellationToken))|];\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) { }\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tFunctionWithOverload(42, TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithOverload(42, TestContext.Current.CancellationToken);\n\t\t\t\n\t\t\t\t\tFunctionWithDefaults(cancellationToken: TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(42, TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(cancellationToken: TestContext.Current.CancellationToken);\n\t\t\t\t\tFunctionWithDefaults(42, cancellationToken: TestContext.Current.CancellationToken);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid FunctionWithOverload(int _) { }\n\t\t\t\tvoid FunctionWithOverload(int _1, CancellationToken _2) { }\n\n\t\t\t\tvoid FunctionWithDefaults(int _1 = 2112, CancellationToken cancellationToken = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n\n\t[Fact]\n\tpublic async Task UseCancellationTokenArgument_AliasTestContext()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\t[|Function()|];\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tFunction(MyContext.Current.CancellationToken);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n\n\t[Fact]\n\tpublic async Task UseCancellationTokenArgument_ParamsArgument()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\t[|Function(1, 2, 3)|];\n\t\t\t\t}\n\n\t\t\t\tvoid Function(params int[] integers) { }\n\n\t\t\t\tvoid Function(int[] integers, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tFunction(new int[] { 1, 2, 3 }, MyContext.Current.CancellationToken);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(params int[] integers) { }\n\n\t\t\t\tvoid Function(int[] integers, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n\n\t[Fact]\n\tpublic async Task UseCancellationTokenArgument_ParamsArgumentAfterRegularArguments()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\t[|Function(\"hello\", System.Guid.NewGuid(), System.Guid.NewGuid())|];\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(string str, params System.Guid[] guids) { }\n\t\t\t\n\t\t\t\tvoid Function(string str, System.Guid[] guids, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tFunction(\"hello\", new System.Guid[] { System.Guid.NewGuid(), System.Guid.NewGuid() }, MyContext.Current.CancellationToken);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(string str, params System.Guid[] guids) { }\n\t\t\t\n\t\t\t\tvoid Function(string str, System.Guid[] guids, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n\n\t[Fact]\n\tpublic async Task UseCancellationTokenArgument_ParamsArgumentWithNoValues()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\t[|Function()|];\n\t\t\t\t}\n\n\t\t\t\tvoid Function(params int[] integers) { }\n\n\t\t\t\tvoid Function(int[] integers, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing MyContext = Xunit.TestContext;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tFunction(new int[] { }, MyContext.Current.CancellationToken);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvoid Function(params int[] integers) { }\n\n\t\t\t\tvoid Function(int[] integers, CancellationToken token = default(CancellationToken)) { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixV3(before, after, UseCancellationTokenFixer.Key_UseCancellationTokenArgument);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertCollectionContainsShouldNotUseBoolCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertCollectionContainsShouldNotUseBoolCheck>;\n\npublic class AssertCollectionContainsShouldNotUseBoolCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing System.Linq;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar items = new[] {{ \"a\", \"b\", \"c\" }};\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(items.Contains(\"\"b\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Contains(\"\"b\"\", items)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(items.Contains(\"\"b\"\", StringComparer.Ordinal))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Contains(\"\"b\"\", items, StringComparer.Ordinal)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(items.Contains(\"\"b\"\", null))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Contains(\"\"b\"\", items)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(items.Contains(\"\"b\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.DoesNotContain(\"\"b\"\", items)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(items.Contains(\"\"b\"\", StringComparer.Ordinal))|]\",\n\t\t/* lang=c#-test */ @\"Assert.DoesNotContain(\"\"b\"\", items, StringComparer.Ordinal)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(items.Contains(\"\"b\"\", null))|]\",\n\t\t/* lang=c#-test */ @\"Assert.DoesNotContain(\"\"b\"\", items)\")]\n\tpublic async Task ReplacesBooleanAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertCollectionContainsShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllBooleanAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar items = new[] { \"a\", \"b\", \"c\" };\n\n\t\t\t\t\t[|Assert.True(items.Contains(\"b\"))|];\n\t\t\t\t\t[|Assert.False(items.Contains(\"b\"))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar items = new[] { \"a\", \"b\", \"c\" };\n\n\t\t\t\t\tAssert.Contains(\"b\", items);\n\t\t\t\t\tAssert.DoesNotContain(\"b\", items);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertCollectionContainsShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEmptyCollectionCheckShouldNotBeUsedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEmptyCollectionCheckShouldNotBeUsed>;\n\npublic class AssertEmptyCollectionCheckShouldNotBeUsedFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_UsesEmptyCheck()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection1 = new[] { 1, 2, 3 };\n\t\t\t\t\tvar collection2 = new[] { 4, 5, 6 };\n\n\t\t\t\t\t[|Assert.Collection(collection1)|];\n\t\t\t\t\t[|Assert.Collection(collection2)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection1 = new[] { 1, 2, 3 };\n\t\t\t\t\tvar collection2 = new[] { 4, 5, 6 };\n\n\t\t\t\t\tAssert.Empty(collection1);\n\t\t\t\t\tAssert.Empty(collection2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEmptyCollectionCheckShouldNotBeUsedFixer.Key_UseAssertEmpty);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_AddsElementInspector()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection1 = new[] { 1, 2, 3 };\n\t\t\t\t\tvar collection2 = new[] { 4, 5, 6 };\n\n\t\t\t\t\t[|Assert.Collection(collection1)|];\n\t\t\t\t\t[|Assert.Collection(collection2)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection1 = new[] { 1, 2, 3 };\n\t\t\t\t\tvar collection2 = new[] { 4, 5, 6 };\n\n\t\t\t\t\tAssert.Collection(collection1, x => { });\n\t\t\t\t\tAssert.Collection(collection2, x => { });\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEmptyCollectionCheckShouldNotBeUsedFixer.Key_AddElementInspector);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecks>;\n\npublic class AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System.Linq;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar list = new[] {{ -1, 0, 1, 2 }};\n\n\t\t\t\t{0};\n\t\t\t}}\n\n\t\t\tpublic bool IsEven(int num) => num % 2 == 0;\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2029:Assert.Empty(list.Where(f => f > 0))|}\",\n\t\t/* lang=c#-test */ \"Assert.DoesNotContain(list, f => f > 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2029:Assert.Empty(list.Where(n => n == 1))|}\",\n\t\t/* lang=c#-test */ \"Assert.DoesNotContain(list, n => n == 1)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2029:Assert.Empty(list.Where(IsEven))|}\",\n\t\t/* lang=c#-test */ \"Assert.DoesNotContain(list, IsEven)\")]\n\tpublic async Task FixerReplacesAssertEmptyWithAssertDoesNotContain(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer.Key_UseDoesNotContain);\n\t}\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2030:Assert.NotEmpty(list.Where(f => f > 0))|}\",\n\t\t/* lang=c#-test */ \"Assert.Contains(list, f => f > 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2030:Assert.NotEmpty(list.Where(n => n == 1))|}\",\n\t\t/* lang=c#-test */ \"Assert.Contains(list, n => n == 1)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"{|xUnit2030:Assert.NotEmpty(list.Where(IsEven))|}\",\n\t\t/* lang=c#-test */ \"Assert.Contains(list, IsEven)\")]\n\tpublic async Task FixerReplacesAssertNotEmptyWithAssertContains(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer.Key_UseContains);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAssertEmptyWithDoesNotContain()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\t{|xUnit2029:Assert.Empty(list.Where(f => f > 0))|};\n\t\t\t\t\t{|xUnit2029:Assert.Empty(list.Where(n => n == 1))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\tAssert.DoesNotContain(list, f => f > 0);\n\t\t\t\t\tAssert.DoesNotContain(list, n => n == 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer.Key_UseDoesNotContain);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAssertNotEmptyWithContains()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\t{|xUnit2030:Assert.NotEmpty(list.Where(f => f > 0))|};\n\t\t\t\t\t{|xUnit2030:Assert.NotEmpty(list.Where(n => n == 1))|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\tAssert.Contains(list, f => f > 0);\n\t\t\t\t\tAssert.Contains(list, n => n == 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEmptyOrNotEmptyShouldNotBeUsedForContainsChecksFixer.Key_UseContains);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheck>;\n\npublic class AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection = new[] { 1, 2, 3 };\n\n\t\t\t\t\t[|Assert.True(collection.Any(x => x == 2))|];\n\t\t\t\t\t[|Assert.False(collection.Any(x => x == 2))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar collection = new[] { 1, 2, 3 };\n\n\t\t\t\t\tAssert.Contains(collection, x => x == 2);\n\t\t\t\t\tAssert.DoesNotContain(collection, x => x == 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEnumerableAnyCheckShouldNotBeUsedForCollectionContainsCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualGenericShouldNotBeUsedForStringValueFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualGenericShouldNotBeUsedForStringValue>;\n\npublic class AssertEqualGenericShouldNotBeUsedForStringValueFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_RemovesGenericFromAllAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tstring result1 = \"foo\";\n\t\t\t\t\tstring result2 = \"bar\";\n\n\t\t\t\t\t[|Assert.Equal<string>(\"foo\", result1)|];\n\t\t\t\t\t[|Assert.StrictEqual<string>(\"bar\", result2)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tstring result1 = \"foo\";\n\t\t\t\t\tstring result2 = \"bar\";\n\n\t\t\t\t\tAssert.Equal(\"foo\", result1);\n\t\t\t\t\tAssert.Equal(\"bar\", result2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualGenericShouldNotBeUsedForStringValueFixer.Key_UseStringAssertEqual);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualLiteralValueShouldBeFirstFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualLiteralValueShouldBeFirst>;\n\npublic class AssertEqualLiteralValueShouldBeFirstFixerTests\n{\n\tconst string Template = /* lang=c#-test */ \"\"\"\n\t\tusing System.Collections.Generic;\n\n\t\tpublic class TestClass {{\n\t\t\t[Xunit.Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar i = 0;\n\t\t\t\t[|Xunit.{0}|];\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(i, 0)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(0, i)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(actual: 0, expected: i)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(actual: i, expected: 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(expected: i, actual: 0)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(expected: 0, actual: i)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(comparer: default(IEqualityComparer<int>), actual: 0, expected: i)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(comparer: default(IEqualityComparer<int>), actual: i, expected: 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(comparer: (x, y) => true, actual: 0, expected: i)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(comparer: (x, y) => true, actual: i, expected: 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"Assert.Equal(expected: i, 0)\",\n\t\t/* lang=c#-test */ \"Assert.Equal(expected: 0, i)\",\n\t\tLanguageVersion.CSharp7_2)]\n\tpublic async Task SwapArguments(\n\t\tstring beforeAssert,\n\t\tstring afterAssert,\n\t\tLanguageVersion? languageVersion = null)\n\t{\n\t\tvar before = string.Format(Template, beforeAssert);\n\t\tvar after = string.Format(Template, afterAssert);\n\n\t\tif (languageVersion.HasValue)\n\t\t\tawait Verify.VerifyCodeFix(languageVersion.Value, before, after, AssertEqualLiteralValueShouldBeFirstFixer.Key_SwapArguments);\n\t\telse\n\t\t\tawait Verify.VerifyCodeFix(before, after, AssertEqualLiteralValueShouldBeFirstFixer.Key_SwapArguments);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_SwapsAllArguments()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tvar j = 1;\n\n\t\t\t\t\t[|Xunit.Assert.Equal(i, 0)|];\n\t\t\t\t\t[|Xunit.Assert.Equal(j, 1)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class TestClass {\n\t\t\t\t[Xunit.Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tvar j = 1;\n\n\t\t\t\t\tXunit.Assert.Equal(0, i);\n\t\t\t\t\tXunit.Assert.Equal(1, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualLiteralValueShouldBeFirstFixer.Key_SwapArguments);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualPrecisionShouldBeInRangeFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualPrecisionShouldBeInRange>;\n\npublic class AssertEqualPrecisionShouldBeInRangeFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ChangesPrecisionToValidRange()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tAssert.Equal(10.1d, 10.2d, [|-1|]);\n\t\t\t\t\tAssert.Equal(10.1m, 10.2m, [|29|]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tAssert.Equal(10.1d, 10.2d, 0);\n\t\t\t\t\tAssert.Equal(10.1m, 10.2m, 28);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualPrecisionShouldBeInRangeFixer.Key_UsePrecision);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualShouldNotBeUsedForBoolLiteralCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForBoolLiteralCheck>;\n\npublic class AssertEqualShouldNotBeUsedForBoolLiteralCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar actual = true;\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Equal(false, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.False(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Equal(true, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.True(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.StrictEqual(false, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.False(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.StrictEqual(true, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.True(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotEqual(false, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.True(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotEqual(true, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.False(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotStrictEqual(false, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.True(actual)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotStrictEqual(true, actual)|]\",\n\t\t/* lang=c#-test */ \"Assert.False(actual)\")]\n\tpublic async Task ConvertsToBooleanAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertEqualShouldNotBeUsedForBoolLiteralCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ConvertsAllToBooleanAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar actual = true;\n\n\t\t\t\t\t[|Assert.Equal(false, actual)|];\n\t\t\t\t\t[|Assert.Equal(true, actual)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar actual = true;\n\n\t\t\t\t\tAssert.False(actual);\n\t\t\t\t\tAssert.True(actual);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualShouldNotBeUsedForBoolLiteralCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualShouldNotBeUsedForCollectionSizeCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForCollectionSizeCheck>;\n\npublic class AssertEqualShouldNotBeUsedForCollectionSizeCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System.Linq;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar data = new[] {{ 1, 2, 3 }};\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Equal(1, data.Count())|]\",\n\t\t/* lang=c#-test */ \"Assert.Single(data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Equal(0, data.Count())|]\",\n\t\t/* lang=c#-test */ \"Assert.Empty(data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotEqual(0, data.Count())|]\",\n\t\t/* lang=c#-test */ \"Assert.NotEmpty(data)\")]\n\tpublic async Task ReplacesCollectionCountWithAppropriateAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertEqualShouldNotBeUsedForCollectionSizeCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllCollectionSizeChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new[] { 1, 2, 3 };\n\n\t\t\t\t\t[|Assert.Equal(1, data.Count())|];\n\t\t\t\t\t[|Assert.Equal(0, data.Count())|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new[] { 1, 2, 3 };\n\n\t\t\t\t\tAssert.Single(data);\n\t\t\t\t\tAssert.Empty(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualShouldNotBeUsedForCollectionSizeCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualShouldNotBeUsedForNullCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualShouldNotBeUsedForNullCheck>;\n\npublic class AssertEqualShouldNotBeUsedForNullCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tint? data = 1;\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Equal(null, data)|]\",\n\t\t/* lang=c#-test */ \"Assert.Null(data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.StrictEqual(null, data)|]\",\n\t\t/* lang=c#-test */ \"Assert.Null(data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotEqual(null, data)|]\",\n\t\t/* lang=c#-test */ \"Assert.NotNull(data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.NotStrictEqual(null, data)|]\",\n\t\t/* lang=c#-test */ \"Assert.NotNull(data)\")]\n\tpublic async Task ConvertsToAppropriateNullAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertEqualShouldNotBeUsedForNullCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllNullChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint? data = 1;\n\n\t\t\t\t\t[|Assert.Equal(null, data)|];\n\t\t\t\t\t[|Assert.NotEqual(null, data)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint? data = 1;\n\n\t\t\t\t\tAssert.Null(data);\n\t\t\t\t\tAssert.NotNull(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualShouldNotBeUsedForNullCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertEqualsShouldNotBeUsedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertEqualsShouldNotBeUsed>;\n\npublic class AssertEqualsShouldNotBeUsedFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllEqualsAndReferenceEqualsCalls()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = 1;\n\n\t\t\t\t\t{|CS0619:[|Assert.Equals(1, data)|]|};\n\t\t\t\t\t{|CS0619:[|Assert.ReferenceEquals(1, data)|]|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = 1;\n\n\t\t\t\t\tAssert.Equal(1, data);\n\t\t\t\t\tAssert.Same(1, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertEqualsShouldNotBeUsedFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertIsTypeShouldNotBeUsedForAbstractTypeFixerTests.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertIsTypeShouldNotBeUsedForAbstractType>;\nusing Verify_v2_Pre2_9_3 = CSharpVerifier<AssertIsTypeShouldNotBeUsedForAbstractTypeFixerTests.Analyzer_v2_Pre2_9_3>;\nusing Verify_v3_Pre0_6_0 = CSharpVerifier<AssertIsTypeShouldNotBeUsedForAbstractTypeFixerTests.Analyzer_v3_Pre0_6_0>;\n\npublic class AssertIsTypeShouldNotBeUsedForAbstractTypeFixerTests\n{\n\t[Fact]\n\tpublic async Task Conversions_WithoutExactMatch()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\t[|Assert.IsType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsType<TestClass>(data)|];\n\t\t\t\t\t[|Assert.IsNotType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsNotType<TestClass>(data)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\tAssert.IsAssignableFrom<IDisposable>(data);\n\t\t\t\t\tAssert.IsAssignableFrom<TestClass>(data);\n\t\t\t\t\tAssert.IsNotAssignableFrom<IDisposable>(data);\n\t\t\t\t\tAssert.IsNotAssignableFrom<TestClass>(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_v2_Pre2_9_3.VerifyCodeFix(before, after, AssertIsTypeShouldNotBeUsedForAbstractTypeFixer.Key_UseAlternateAssert);\n\t\tawait Verify_v3_Pre0_6_0.VerifyCodeFix(before, after, AssertIsTypeShouldNotBeUsedForAbstractTypeFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task Conversions_WithExactMatch()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\t[|Assert.IsType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsType<IDisposable>(data, true)|];\n\t\t\t\t\t[|Assert.IsType<IDisposable>(data, exactMatch: true)|];\n\t\t\t\t\t[|Assert.IsType<TestClass>(data)|];\n\t\t\t\t\t[|Assert.IsType<TestClass>(data, true)|];\n\t\t\t\t\t[|Assert.IsType<TestClass>(data, exactMatch: true)|];\n\t\t\t\t\t[|Assert.IsNotType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsNotType<IDisposable>(data, true)|];\n\t\t\t\t\t[|Assert.IsNotType<IDisposable>(data, exactMatch: true)|];\n\t\t\t\t\t[|Assert.IsNotType<TestClass>(data)|];\n\t\t\t\t\t[|Assert.IsNotType<TestClass>(data, true)|];\n\t\t\t\t\t[|Assert.IsNotType<TestClass>(data, exactMatch: true)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\tAssert.IsType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<TestClass>(data, exactMatch: false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertIsTypeShouldNotBeUsedForAbstractTypeFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllAbstractTypeChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\t[|Assert.IsType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsType<TestClass>(data, true)|];\n\t\t\t\t\t[|Assert.IsNotType<IDisposable>(data)|];\n\t\t\t\t\t[|Assert.IsNotType<TestClass>(data, exactMatch: true)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic abstract class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = new object();\n\n\t\t\t\t\tAssert.IsType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<TestClass>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<IDisposable>(data, exactMatch: false);\n\t\t\t\t\tAssert.IsNotType<TestClass>(data, exactMatch: false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertIsTypeShouldNotBeUsedForAbstractTypeFixer.Key_UseAlternateAssert);\n\t}\n\n\tinternal class Analyzer_v2_Pre2_9_3 : AssertIsTypeShouldNotBeUsedForAbstractType\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV2(compilation, new Version(2, 9, 2));\n\t}\n\n\tinternal class Analyzer_v3_Pre0_6_0 : AssertIsTypeShouldNotBeUsedForAbstractType\n\t{\n\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\tXunitContext.ForV3(compilation, new Version(0, 5, 999));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertNullShouldNotBeCalledOnValueTypesFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertNullShouldNotBeCalledOnValueTypes>;\n\npublic class AssertNullShouldNotBeCalledOnValueTypesFixerTests\n{\n\t[Fact]\n\tpublic async Task ForValueTypeNullAssert_RemovesAssertion()\n\t{\n\t\tconst string before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class Tests {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint i = 1;\n\n\t\t\t\t\t[|Assert.NotNull(i)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tconst string after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class Tests {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint i = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertNullShouldNotBeCalledOnValueTypesFixer.Key_RemoveAssert);\n\t}\n\n\t// https://github.com/xunit/xunit/issues/1753\n\t[Fact]\n\tpublic async Task ForAssertionWithTrivia_RemovesAssertionAndLeavesLeadingTriviaInPlace()\n\t{\n\t\tconst string before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tnamespace XUnitTestProject1 {\n\t\t\t\tpublic class UnitTest1 {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void Test1() {\n\t\t\t\t\t\tint i = 1;\n\n\t\t\t\t\t\t// I am a comment which gets deleted by the quick fix\n\t\t\t\t\t\t// Assert\n\t\t\t\t\t\t[|Assert.NotNull(i)|];\n\t\t\t\t\t\tAssert.Null(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tconst string after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tnamespace XUnitTestProject1 {\n\t\t\t\tpublic class UnitTest1 {\n\t\t\t\t\t[Fact]\n\t\t\t\t\tpublic void Test1() {\n\t\t\t\t\t\tint i = 1;\n\n\t\t\t\t\t\t// I am a comment which gets deleted by the quick fix\n\t\t\t\t\t\t// Assert\n\t\t\t\t\t\tAssert.Null(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertNullShouldNotBeCalledOnValueTypesFixer.Key_RemoveAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_RemovesAllValueTypeNullAssertions()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint i = 1;\n\t\t\t\t\tbool b = true;\n\n\t\t\t\t\t[|Assert.NotNull(i)|];\n\t\t\t\t\t[|Assert.NotNull(b)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tint i = 1;\n\t\t\t\t\tbool b = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertNullShouldNotBeCalledOnValueTypesFixer.Key_RemoveAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertRegexMatchShouldNotUseBoolLiteralCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertRegexMatchShouldNotUseBoolLiteralCheck>;\n\npublic class AssertRegexMatchShouldNotUseBoolLiteralCheckFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllBooleanRegexChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Text.RegularExpressions;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = \"foo bar baz\";\n\n\t\t\t\t\t[|Assert.True(Regex.IsMatch(result, \"foo (.*?) baz\"))|];\n\t\t\t\t\t[|Assert.False(Regex.IsMatch(result, \"foo (.*?) baz\"))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Text.RegularExpressions;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = \"foo bar baz\";\n\n\t\t\t\t\tAssert.Matches(\"foo (.*?) baz\", result);\n\t\t\t\t\tAssert.DoesNotMatch(\"foo (.*?) baz\", result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertRegexMatchShouldNotUseBoolLiteralCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertSameShouldNotBeCalledOnValueTypesFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSameShouldNotBeCalledOnValueTypes>;\n\npublic class AssertSameShouldNotBeCalledOnValueTypesFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllSameCallsWithEqual()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = 1;\n\n\t\t\t\t\t[|Assert.Same(1, data)|];\n\t\t\t\t\t[|Assert.NotSame(1, data)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = 1;\n\n\t\t\t\t\tAssert.Equal(1, data);\n\t\t\t\t\tAssert.NotEqual(1, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertSameShouldNotBeCalledOnValueTypesFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertSingleShouldBeUsedForSingleParameterFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSingleShouldBeUsedForSingleParameter>;\n\npublic class AssertSingleShouldBeUsedForSingleParameterFixerTests\n{\n\t[Fact]\n\tpublic async ValueTask CannotFixInsideLambda()\n\t{\n\t\tvar source = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\t\t\t\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic static void TestMethod()\n\t\t\t\t{\n\t\t\t\t\tRecord.Exception(\n\t\t\t\t\t\t() => [|Assert.Collection(default(IEnumerable<object>), item => Assert.True(false))|]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(LanguageVersion.CSharp8, source, source, AssertSingleShouldBeUsedForSingleParameterFixer.Key_UseSingleMethod);\n\t}\n\n\t[Fact]\n\tpublic async ValueTask EnumerableAcceptanceTest()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInlineLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), item => Assert.NotNull(item))|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), async item => Assert.Equal(42, await item))|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithOneStatementLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), item => { Assert.NotNull(item); })|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), async item => { Assert.Equal(42, await item); })|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithTwoStatementLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), item => { Assert.NotNull(item); Assert.NotNull(item); })|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), async item => { Assert.Equal(42, await item); Assert.Equal(42, await item); })|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithMultiLineLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), item => {\n\t\t\t\t\t\tif (item != null)\n\t\t\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\t})|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), async item => {\n\t\t\t\t\t\tif (item != null)\n\t\t\t\t\t\t\tAssert.Equal(42, await item);\n\t\t\t\t\t})|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithNameCollision() {\n\t\t\t\t\tvar item = 42;\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), item => Assert.NotNull(item))|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), async item => Assert.Equal(2112, await item))|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInspector() {\n\t\t\t\t\t[|Assert.Collection(default(IEnumerable<object>), ElementInspector)|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IEnumerable<Task<int>>), AsyncElementInspector)|];\n\t\t\t\t}\n\n\t\t\t\tvoid ElementInspector(object obj)\n\t\t\t\t{ }\n\n\t\t\t\tTask AsyncElementInspector(Task<int> obj) =>\n\t\t\t\t\tTask.CompletedTask;\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInlineLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithOneStatementLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithTwoStatementLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item); Assert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2); Assert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithMultiLineLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tif (item != null)\n\t\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tif (item_2 != null)\n\t\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithNameCollision() {\n\t\t\t\t\tvar item = 42;\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item_2);\n\t\t\t\t\tvar item_3 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(2112, await item_3);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInspector() {\n\t\t\t\t\tvar item = Assert.Single(default(IEnumerable<object>));\n\t\t\t\t\tElementInspector(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IEnumerable<Task<int>>));\n\t\t\t\t\tawait AsyncElementInspector(item_2);\n\t\t\t\t}\n\n\t\t\t\tvoid ElementInspector(object obj)\n\t\t\t\t{ }\n\n\t\t\t\tTask AsyncElementInspector(Task<int> obj) =>\n\t\t\t\t\tTask.CompletedTask;\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(LanguageVersion.CSharp8, before, after, AssertSingleShouldBeUsedForSingleParameterFixer.Key_UseSingleMethod);\n\t}\n\n#if NETCOREAPP3_0_OR_GREATER\n\n\t[Fact]\n\tpublic async ValueTask AsyncEnumerableAcceptanceTest()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInlineLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), item => Assert.NotNull(item))|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), async item => Assert.Equal(42, await item))|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithOneStatementLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), item => { Assert.NotNull(item); })|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), async item => { Assert.Equal(42, await item); })|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithTwoStatementLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), item => { Assert.NotNull(item); Assert.NotNull(item); })|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), async item => { Assert.Equal(42, await item); Assert.Equal(42, await item); })|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithMultiLineLambda() {\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), item => {\n\t\t\t\t\t\tif (item != null)\n\t\t\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\t})|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), async item => {\n\t\t\t\t\t\tif (item != null)\n\t\t\t\t\t\t\tAssert.Equal(42, await item);\n\t\t\t\t\t})|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithNameCollision() {\n\t\t\t\t\tvar item = 42;\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), item => Assert.NotNull(item))|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), async item => Assert.Equal(42, await item))|];\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInspector() {\n\t\t\t\t\t[|Assert.Collection(default(IAsyncEnumerable<object>), ElementInspector)|];\n\t\t\t\t\tawait [|Assert.CollectionAsync(default(IAsyncEnumerable<Task<int>>), AsyncElementInspector)|];\n\t\t\t\t}\n\n\t\t\t\tvoid ElementInspector(object obj)\n\t\t\t\t{ }\n\n\t\t\t\tTask AsyncElementInspector(Task<int> obj) =>\n\t\t\t\t\tTask.CompletedTask;\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Collections.Generic;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInlineLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithOneStatementLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithTwoStatementLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item); Assert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_2); Assert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithMultiLineLambda() {\n\t\t\t\t\tvar item = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tif (item != null)\n\t\t\t\t\t\tAssert.NotNull(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tif (item_2 != null)\n\t\t\t\t\t\tAssert.Equal(42, await item_2);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithNameCollision() {\n\t\t\t\t\tvar item = 42;\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tAssert.NotNull(item_2);\n\t\t\t\t\tvar item_3 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tAssert.Equal(42, await item_3);\n\t\t\t\t}\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task WithInspector() {\n\t\t\t\t\tvar item = Assert.Single(default(IAsyncEnumerable<object>));\n\t\t\t\t\tElementInspector(item);\n\t\t\t\t\tvar item_2 = Assert.Single(default(IAsyncEnumerable<Task<int>>));\n\t\t\t\t\tawait AsyncElementInspector(item_2);\n\t\t\t\t}\n\n\t\t\t\tvoid ElementInspector(object obj)\n\t\t\t\t{ }\n\n\t\t\t\tTask AsyncElementInspector(Task<int> obj) =>\n\t\t\t\t\tTask.CompletedTask;\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(LanguageVersion.CSharp8, before, after, AssertSingleShouldBeUsedForSingleParameterFixer.Key_UseSingleMethod);\n\t}\n\n#endif  // NETCOREAPP3_0_OR_GREATER\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertSingleShouldUseTwoArgumentCallFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSingleShouldUseTwoArgumentCall>;\n\npublic class AssertSingleShouldUseTwoArgumentCallFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System.Linq;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar list = new[] {{ -1, 0, 1, 2 }};\n\n\t\t\t\t{0};\n\t\t\t}}\n\n\t\t\tpublic bool IsEven(int num) => num % 2 == 0;\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Single(list.Where(f => f > 0))|]\",\n\t\t/* lang=c#-test */ \"Assert.Single(list, f => f > 0)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Single(list.Where(n => n == 1))|]\",\n\t\t/* lang=c#-test */ \"Assert.Single(list, n => n == 1)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ \"[|Assert.Single(list.Where(IsEven))|]\",\n\t\t/* lang=c#-test */ \"Assert.Single(list, IsEven)\")]\n\tpublic async Task FixerReplacesAssertSingleOneArgumentToTwoArgumentCall(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertSingleShouldUseTwoArgumentCallFixer.Key_UseTwoArguments);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllSingleOneArgumentCalls()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\t[|Assert.Single(list.Where(f => f > 0))|];\n\t\t\t\t\t[|Assert.Single(list.Where(n => n == 1))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Linq;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar list = new[] { -1, 0, 1, 2 };\n\n\t\t\t\t\tAssert.Single(list, f => f > 0);\n\t\t\t\t\tAssert.Single(list, n => n == 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertSingleShouldUseTwoArgumentCallFixer.Key_UseTwoArguments);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertStringEqualityCheckShouldNotUseBoolCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertStringEqualityCheckShouldNotUseBoolCheck>;\n\npublic class AssertStringEqualityCheckShouldNotUseBoolCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t// Instance Equals (true)\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(\"\"foo bar baz\"\".Equals(data))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(\"\"foo bar baz\"\".Equals(data, StringComparison.Ordinal))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(\"\"foo bar baz\"\".Equals(data, StringComparison.OrdinalIgnoreCase))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data, ignoreCase: true)\")]\n\t// Static Equals (true)\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(string.Equals(\"\"foo bar baz\"\", data))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(string.Equals(\"\"foo bar baz\"\", data, StringComparison.Ordinal))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(string.Equals(\"\"foo bar baz\"\", data, StringComparison.OrdinalIgnoreCase))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Equal(\"\"foo bar baz\"\", data, ignoreCase: true)\")]\n\t// Instance Equals (false)\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(\"\"foo bar baz\"\".Equals(data))|]\",\n\t\t/* lang=c#-test */ @\"Assert.NotEqual(\"\"foo bar baz\"\", data)\")]\n\t// Static Equals (false)\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(string.Equals(\"\"foo bar baz\"\", data))|]\",\n\t\t/* lang=c#-test */ @\"Assert.NotEqual(\"\"foo bar baz\"\", data)\")]\n\tpublic async Task ConvertsBooleanAssertToEqualityAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertStringEqualityCheckShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllBooleanStringEqualityChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t\t[|Assert.True(\"foo bar baz\".Equals(data))|];\n\t\t\t\t\t[|Assert.False(\"foo bar baz\".Equals(data))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t\tAssert.Equal(\"foo bar baz\", data);\n\t\t\t\t\tAssert.NotEqual(\"foo bar baz\", data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertStringEqualityCheckShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertSubstringCheckShouldNotUseBoolCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertSubstringCheckShouldNotUseBoolCheck>;\n\npublic class AssertSubstringCheckShouldNotUseBoolCheckFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\t[Theory]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(data.Contains(\"\"foo\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.Contains(\"\"foo\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(data.StartsWith(\"\"foo\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.StartsWith(\"\"foo\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(data.StartsWith(\"\"foo\"\", StringComparison.Ordinal))|]\",\n\t\t/* lang=c#-test */ @\"Assert.StartsWith(\"\"foo\"\", data, StringComparison.Ordinal)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(data.EndsWith(\"\"foo\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.EndsWith(\"\"foo\"\", data)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.True(data.EndsWith(\"\"foo\"\", StringComparison.OrdinalIgnoreCase))|]\",\n\t\t/* lang=c#-test */ @\"Assert.EndsWith(\"\"foo\"\", data, StringComparison.OrdinalIgnoreCase)\")]\n\t[InlineData(\n\t\t/* lang=c#-test */ @\"[|Assert.False(data.Contains(\"\"foo\"\"))|]\",\n\t\t/* lang=c#-test */ @\"Assert.DoesNotContain(\"\"foo\"\", data)\")]\n\tpublic async Task ConvertsBooleanAssertToStringSpecificAssert(\n\t\tstring beforeAssert,\n\t\tstring afterAssert)\n\t{\n\t\tvar before = string.Format(template, beforeAssert);\n\t\tvar after = string.Format(template, afterAssert);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertSubstringCheckShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllBooleanSubstringChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t\t[|Assert.True(data.Contains(\"foo\"))|];\n\t\t\t\t\t[|Assert.False(data.Contains(\"foo\"))|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"foo bar baz\";\n\n\t\t\t\t\tAssert.Contains(\"foo\", data);\n\t\t\t\t\tAssert.DoesNotContain(\"foo\", data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssertSubstringCheckShouldNotUseBoolCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssertThrowsShouldNotBeUsedForAsyncThrowsCheck>;\n\npublic class AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixerTests\n{\n\tpublic static readonly TheoryData<string, string> Assertions = GenerateAssertions();\n\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing System.Threading.Tasks;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\tTask ThrowingMethod() {{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}}\n\n\t\t\t[Fact]{0}\n\t\t}}\n\t\t\"\"\";\n\n\tstatic TheoryData<string, string> GenerateAssertions()\n\t{\n\t\tvar templates = new (string, string)[]\n\t\t{\n\t\t\t(\n\t\t\t\t/* lang=c#-test */ \"Assert.Throws(typeof(Exception), {0})\",\n\t\t\t\t/* lang=c#-test */ \"Assert.ThrowsAsync(typeof(Exception), {0})\"\n\t\t\t),\n\t\t\t(\n\t\t\t\t/* lang=c#-test */ \"Assert.Throws<Exception>({0})\",\n\t\t\t\t/* lang=c#-test */ \"Assert.ThrowsAsync<Exception>({0})\"\n\t\t\t),\n\t\t\t(\n\t\t\t\t/* lang=c#-test */ \"Assert.Throws<ArgumentException>(\\\"parameter\\\", {0})\",\n\t\t\t\t/* lang=c#-test */ \"Assert.ThrowsAsync<ArgumentException>(\\\"parameter\\\", {0})\"\n\t\t\t),\n\t\t\t(\n\t\t\t\t/* lang=c#-test */ \"Assert.ThrowsAny<Exception>({0})\",\n\t\t\t\t/* lang=c#-test */ \"Assert.ThrowsAnyAsync<Exception>({0})\"\n\t\t\t),\n\t\t};\n\n\t\tvar lambdas = new[]\n\t\t{\n\t\t\t/* lang=c#-test */ \"(Func<Task>)ThrowingMethod\",\n\t\t\t/* lang=c#-test */ \"() => Task.Delay(0)\",\n\t\t\t/* lang=c#-test */ \"(Func<Task>)(async () => await Task.Delay(0))\",\n\t\t\t/* lang=c#-test */ \"(Func<Task>)(async () => await Task.Delay(0).ConfigureAwait(false))\",\n\t\t};\n\n\t\tvar assertions = new TheoryData<string, string>();\n\n\t\tforeach ((var assertionTemplate, var replacementTemplate) in templates)\n\t\t\tforeach (var lambda in lambdas)\n\t\t\t{\n\t\t\t\tvar assertion = string.Format(assertionTemplate, lambda);\n\t\t\t\tvar replacement = string.Format(replacementTemplate, lambda);\n\t\t\t\tassertions.Add(assertion, replacement);\n\t\t\t}\n\n\t\treturn assertions;\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInMethod_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tawait {0};\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tFunc<int> function = () => {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = function();\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tFunc<Task<int>> function = async () => {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = {{|CS0029:function()|}};\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedAnonymousFunctionWithAssignment_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tFunc<int> function = () => 0;\n\t\t\t\t\tfunction = () => {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = function();\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tFunc<Task<int>> function = () => {{|CS0029:{{|CS1662:0|}}|}};\n\t\t\t\t\tfunction = async () => {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = {{|CS0029:function()|}};\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n#if ROSLYN_LATEST  // C# 10 is required for anonymous lambda types\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedAnonymousFunctionWithVar_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tvar function = () => {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = function();\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tvar function = async () => {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\n\t\t\t\t\tint number = {{|CS0029:function()|}};\n\t\t\t\t\tfunction();\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp10, beforeMethod, afterMethod);\n\t}\n\n#endif\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInUninvokedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tFunc<int> function = () => {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tFunc<Task<int>> function = async () => {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}};\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedNestedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAction<int> outerFunction = (number) => {{\n\t\t\t\t\t\tFunc<string> innerFunction = delegate () {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction().ToLower();\n\t\t\t\t\t\tinnerFunction();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction(0);\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tFunc<int, Task> outerFunction = async (number) => {{\n\t\t\t\t\t\tFunc<Task<string>> innerFunction = async delegate () {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction().{{|CS7036:ToLower|}}();\n\t\t\t\t\t\tinnerFunction();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction(0);\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInExplicitlyInvokedNestedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAction<int> outerFunction = (number) => {{\n\t\t\t\t\t\tFunc<string> innerFunction = delegate () {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction.Invoke().ToLower();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction.Invoke(0);\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tFunc<int, Task> outerFunction = async (number) => {{\n\t\t\t\t\t\tFunc<Task<string>> innerFunction = async delegate () {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction.Invoke().{{|CS7036:ToLower|}}();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction.Invoke(0);\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInConditionallyInvokedNestedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAction<int> outerFunction = (number) => {{\n\t\t\t\t\t\tFunc<string> innerFunction = delegate () {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction?.Invoke().ToLower();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction?.Invoke(0);\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tFunc<int, Task> outerFunction = async (number) => {{\n\t\t\t\t\t\tFunc<Task<string>> innerFunction = async delegate () {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tvar message = innerFunction?.Invoke().{{|CS7036:ToLower|}}();\n\t\t\t\t\t}};\n\n\t\t\t\t\touterFunction?.Invoke(0);\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInUninvokedNestedAnonymousFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAction<int> outerFunction = (number) => {{\n\t\t\t\t\t\tFunc<string> innerFunction = () => {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\t\t\t\t\t}};\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tAction<int> outerFunction = (number) => {{\n\t\t\t\t\t\tFunc<Task<string>> innerFunction = async () => {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}};\n\t\t\t\t\t}};\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedLocalFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint number = Function();\n\t\t\t\t\tFunction();\n\n\t\t\t\t\tint Function() {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tint number = {{|CS0029:Function()|}};\n\t\t\t\t\tFunction();\n\n\t\t\t\t\tasync Task<int> Function() {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp7, beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInUninvokedLocalFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint Function() {{\n\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tasync Task<int> Function() {{\n\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp7, beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInInvokedNestedLocalFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint number = OuterFunction();\n\t\t\t\t\tOuterFunction();\n\n\t\t\t\t\tint OuterFunction() {{\n\t\t\t\t\t\tvar message = InnerFunction().ToLower();\n\t\t\t\t\t\tInnerFunction();\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t\tstring InnerFunction() {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tint number = {{|CS0029:OuterFunction()|}};\n\t\t\t\t\tOuterFunction();\n\n\t\t\t\t\tasync Task<int> OuterFunction() {{\n\t\t\t\t\t\tvar message = InnerFunction().{{|CS7036:ToLower|}}();\n\t\t\t\t\t\tInnerFunction();\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t\tasync Task<string> InnerFunction() {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp7, beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInUninvokedNestedLocalFunction_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint OuterFunction() {{\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t\tstring InnerFunction() {{\n\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint OuterFunction() {{\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t\tasync Task<string> InnerFunction() {{\n\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t}}\n\t\t\t\t\t}}\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp7, beforeMethod, afterMethod);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(Assertions))]\n\tpublic async Task GivenAssertionInMixedNestedFunctions_ReplacesWithAsyncAssertion(\n\t\tstring assertion,\n\t\tstring replacement)\n\t{\n\t\tvar beforeMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tint OuterLocalFunction() {{\n\t\t\t\t\t\tFunc<bool> outerAnonymousFunction = () => {{\n\t\t\t\t\t\t\tstring InnerLocalFunction() {{\n\t\t\t\t\t\t\t\tAction innerAnonymousFunction = () => {{\n\t\t\t\t\t\t\t\t\t{{|CS0619:[|{0}|]|}};\n\t\t\t\t\t\t\t\t}};\n\n\t\t\t\t\t\t\t\tinnerAnonymousFunction();\n\t\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t\tstring message = InnerLocalFunction();\n\t\t\t\t\t\t\tInnerLocalFunction();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tbool condition = outerAnonymousFunction();\n\t\t\t\t\t\touterAnonymousFunction();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\n\t\t\t\t\tint number = OuterLocalFunction();\n\t\t\t\t\tOuterLocalFunction();\n\t\t\t\t}}\n\t\t\t\"\"\", assertion);\n\t\tvar afterMethod = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tasync Task<int> OuterLocalFunction() {{\n\t\t\t\t\t\tFunc<Task<bool>> outerAnonymousFunction = async () => {{\n\t\t\t\t\t\t\tasync Task<string> InnerLocalFunction() {{\n\t\t\t\t\t\t\t\tFunc<Task> innerAnonymousFunction = async () => {{\n\t\t\t\t\t\t\t\t\tawait {0};\n\t\t\t\t\t\t\t\t}};\n\n\t\t\t\t\t\t\t\tinnerAnonymousFunction();\n\t\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t\tstring message = {{|CS0029:InnerLocalFunction()|}};\n\t\t\t\t\t\t\tInnerLocalFunction();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}};\n\n\t\t\t\t\t\tbool condition = {{|CS0029:outerAnonymousFunction()|}};\n\t\t\t\t\t\touterAnonymousFunction();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}}\n\n\t\t\t\t\tint number = {{|CS0029:OuterLocalFunction()|}};\n\t\t\t\t\tOuterLocalFunction();\n\t\t\t\t}}\n\t\t\t\"\"\", replacement);\n\n\t\tawait VerifyCodeFix(LanguageVersion.CSharp7, beforeMethod, afterMethod);\n\t}\n\n\tstatic async Task VerifyCodeFix(\n\t\tstring beforeMethod,\n\t\tstring afterMethod)\n\t{\n\t\tvar before = string.Format(template, beforeMethod);\n\t\tvar after = string.Format(template, afterMethod);\n\n\t\tawait Verify.VerifyCodeFix(before, after, AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixer.Key_UseAlternateAssert);\n\t}\n\n\tstatic async Task VerifyCodeFix(\n\t\tLanguageVersion languageVersion,\n\t\tstring beforeMethod,\n\t\tstring afterMethod)\n\t{\n\t\tvar before = string.Format(template, beforeMethod);\n\t\tvar after = string.Format(template, afterMethod);\n\n\t\tawait Verify.VerifyCodeFix(languageVersion, before, after, AssertThrowsShouldNotBeUsedForAsyncThrowsCheckFixer.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AssignableFromAssertionIsConfusinglyNamedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AssignableFromAssertionIsConfusinglyNamed>;\n\npublic class AssignableFromAssertionIsConfusinglyNamedFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllAssignableFromAssertions()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"Hello world\";\n\n\t\t\t\t\t[|Assert.IsAssignableFrom(typeof(object), data)|];\n\t\t\t\t\t[|Assert.IsAssignableFrom<object>(data)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar data = \"Hello world\";\n\n\t\t\t\t\tAssert.IsType(typeof(object), data, exactMatch: false);\n\t\t\t\t\tAssert.IsType<object>(data, exactMatch: false);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, AssignableFromAssertionIsConfusinglyNamedFixer.Key_UseIsType);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/AsyncAssertsShouldBeAwaitedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.AsyncAssertsShouldBeAwaited>;\n\npublic class AsyncAssertsShouldBeAwaitedFixerTests\n{\n\tconst string codeTemplate = /* lang=c#-test */ \"\"\"\n\t\tusing System;\n\t\tusing System.ComponentModel;\n\t\tusing System.Threading.Tasks;\n\t\tusing Xunit;\n\n\t\tpublic class TestClass : INotifyPropertyChanged {{\n\t\t\tpublic int Property {{ get; set; }}\n\n\t\t\tpublic event PropertyChangedEventHandler? PropertyChanged;\n\t\t\tpublic event EventHandler? SimpleEvent;\n\t\t\tpublic event EventHandler<int>? SimpleIntEvent;\n\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\t{0}\n\t\t\t}}\n\t\t}}\n\n\t\tpublic static class MyTaskExtensions {{\n\t\t\tpublic static void ConsumeTask(this Task t) {{ }}\n\t\t}}\n\t\t\"\"\";\n\n\tpublic static TheoryData<string> AsyncAssertions =\n\t[\n\t\t\"Assert.PropertyChangedAsync(this, nameof(Property), async () => throw new DivideByZeroException())\",\n\t\t\"Assert.RaisesAnyAsync(eh => SimpleEvent += eh, eh => SimpleEvent -= eh, async () => throw new DivideByZeroException())\",\n\t\t\"Assert.RaisesAnyAsync<int>(eh => SimpleIntEvent += eh, eh => SimpleIntEvent -= eh, async () => throw new DivideByZeroException())\",\n\t\t\"Assert.RaisesAsync<int>(eh => SimpleIntEvent += eh, eh => SimpleIntEvent -= eh, async () => throw new DivideByZeroException())\",\n\t\t\"Assert.ThrowsAnyAsync<Exception>(async () => throw new DivideByZeroException())\",\n\t\t\"Assert.ThrowsAsync(typeof(DivideByZeroException), async () => throw new DivideByZeroException())\",\n\t\t\"Assert.ThrowsAsync<DivideByZeroException>(async () => throw new DivideByZeroException())\",\n\t\t\"Assert.ThrowsAsync<ArgumentException>(\\\"argName\\\", async () => throw new DivideByZeroException())\",\n\t];\n\n\t[Theory]\n\t[MemberData(nameof(AsyncAssertions))]\n\tpublic async Task AddsAsyncAndAwait(string assertion)\n\t{\n\t\tvar before = string.Format(codeTemplate, $\"[|{assertion}|];\");\n\t\tvar after = string.Format(codeTemplate, $\"await {assertion};\").Replace(\"public void TestMethod\", \"public async Task TestMethod\");\n\n\t\tawait Verify.VerifyCodeFix(LanguageVersion.CSharp8, before, after, AsyncAssertsShouldBeAwaitedFixer.Key_AddAwait);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/BooleanAssertsShouldNotBeNegatedFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.BooleanAssertsShouldNotBeNegated>;\n\npublic class BooleanAssertsShouldNotBeNegatedFixerTests\n{\n\t[Fact]\n\tpublic async Task AcceptanceTest()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\t// Not negated\n\t\t\t\t\tAssert.True(false);\n\t\t\t\t\tAssert.False(false);\n\t\t\t\t\tAssert.True(condition);\n\t\t\t\t\tAssert.False(condition);\n\n\t\t\t\t\t// Negated\n\t\t\t\t\t[|Assert.True(!false)|];\n\t\t\t\t\t[|Assert.False(!false)|];\n\t\t\t\t\t[|Assert.True(!condition)|];\n\t\t\t\t\t[|Assert.False(!condition)|];\n\n\t\t\t\t\t// Not negated, with message\n\t\t\t\t\tAssert.True(false, \"test message\");\n\t\t\t\t\tAssert.False(false, \"test message\");\n\t\t\t\t\tAssert.True(condition, \"test message\");\n\t\t\t\t\tAssert.False(condition, \"test message\");\n\n\t\t\t\t\t// Negated, with message\n\t\t\t\t\t[|Assert.True(!false, \"test message\")|];\n\t\t\t\t\t[|Assert.False(!false, \"test message\")|];\n\t\t\t\t\t[|Assert.True(!condition, \"test message\")|];\n\t\t\t\t\t[|Assert.False(!condition, \"test message\")|];\n\n\t\t\t\t\t// Not negated, with named parameter message\n\t\t\t\t\tAssert.True(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.False(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.True(condition, userMessage: \"test message\");\n\t\t\t\t\tAssert.False(condition, userMessage: \"test message\");\n\n\t\t\t\t\t// Negated, with named parameter message\n\t\t\t\t\t[|Assert.True(!false, userMessage: \"test message\")|];\n\t\t\t\t\t[|Assert.False(!false, userMessage: \"test message\")|];\n\t\t\t\t\t[|Assert.True(!condition, userMessage: \"test message\")|];\n\t\t\t\t\t[|Assert.False(!condition, userMessage: \"test message\")|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\t// Not negated\n\t\t\t\t\tAssert.True(false);\n\t\t\t\t\tAssert.False(false);\n\t\t\t\t\tAssert.True(condition);\n\t\t\t\t\tAssert.False(condition);\n\n\t\t\t\t\t// Negated\n\t\t\t\t\tAssert.False(false);\n\t\t\t\t\tAssert.True(false);\n\t\t\t\t\tAssert.False(condition);\n\t\t\t\t\tAssert.True(condition);\n\n\t\t\t\t\t// Not negated, with message\n\t\t\t\t\tAssert.True(false, \"test message\");\n\t\t\t\t\tAssert.False(false, \"test message\");\n\t\t\t\t\tAssert.True(condition, \"test message\");\n\t\t\t\t\tAssert.False(condition, \"test message\");\n\n\t\t\t\t\t// Negated, with message\n\t\t\t\t\tAssert.False(false, \"test message\");\n\t\t\t\t\tAssert.True(false, \"test message\");\n\t\t\t\t\tAssert.False(condition, \"test message\");\n\t\t\t\t\tAssert.True(condition, \"test message\");\n\n\t\t\t\t\t// Not negated, with named parameter message\n\t\t\t\t\tAssert.True(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.False(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.True(condition, userMessage: \"test message\");\n\t\t\t\t\tAssert.False(condition, userMessage: \"test message\");\n\n\t\t\t\t\t// Negated, with named parameter message\n\t\t\t\t\tAssert.False(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.True(false, userMessage: \"test message\");\n\t\t\t\t\tAssert.False(condition, userMessage: \"test message\");\n\t\t\t\t\tAssert.True(condition, userMessage: \"test message\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFix(before, after, BooleanAssertsShouldNotBeNegatedFixer.Key_UseSuggestedAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllNegatedBooleanAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\t[|Assert.True(!condition)|];\n\t\t\t\t\t[|Assert.False(!condition)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\tAssert.False(condition);\n\t\t\t\t\tAssert.True(condition);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, BooleanAssertsShouldNotBeNegatedFixer.Key_UseSuggestedAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck>;\n\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing Xunit;\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\tbool condition = true;\n\n\t\t\t\t{0};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\tpublic static TheoryData<string, string, string> AssertExpressionReplacement = new()\n\t{\n\t\t/* lang=c#-test */ { \"True\", \"condition == true\", \"True\" },\n\t\t/* lang=c#-test */ { \"True\", \"condition != true\", \"False\" },\n\t\t/* lang=c#-test */ { \"True\", \"true == condition\", \"True\" },\n\t\t/* lang=c#-test */ { \"True\", \"true != condition\", \"False\" },\n\n\t\t/* lang=c#-test */ { \"True\", \"condition == false\", \"False\" },\n\t\t/* lang=c#-test */ { \"True\", \"condition != false\", \"True\" },\n\t\t/* lang=c#-test */ { \"True\", \"false == condition\", \"False\" },\n\t\t/* lang=c#-test */ { \"True\", \"false != condition\", \"True\" },\n\n\t\t/* lang=c#-test */ { \"False\", \"condition == true\", \"False\" },\n\t\t/* lang=c#-test */ { \"False\", \"condition != true\", \"True\" },\n\t\t/* lang=c#-test */ { \"False\", \"true == condition\", \"False\" },\n\t\t/* lang=c#-test */ { \"False\", \"true != condition\", \"True\" },\n\n\t\t/* lang=c#-test */ { \"False\", \"condition == false\", \"True\" },\n\t\t/* lang=c#-test */ { \"False\", \"condition != false\", \"False\" },\n\t\t/* lang=c#-test */ { \"False\", \"false == condition\", \"True\" },\n\t\t/* lang=c#-test */ { \"False\", \"false != condition\", \"False\" },\n\t};\n\n\t[Theory]\n\t[MemberData(nameof(AssertExpressionReplacement))]\n\tpublic async Task SimplifiesBooleanAssert(\n\t\tstring assertion,\n\t\tstring expression,\n\t\tstring replacement)\n\t{\n\t\tvar before = string.Format(template, $\"{{|xUnit2025:Assert.{assertion}({expression})|}}\");\n\t\tvar after = string.Format(template, $\"Assert.{replacement}(condition)\");\n\n\t\tawait Verify.VerifyCodeFix(before, after, BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer.Key_UseSuggestedAssert);\n\t}\n\n\t[Theory]\n\t[MemberData(nameof(AssertExpressionReplacement))]\n\tpublic async Task SimplifiesBooleanAssertWithMessage(\n\t\tstring assertion,\n\t\tstring expression,\n\t\tstring replacement)\n\t{\n\t\tvar before = string.Format(template, $\"{{|xUnit2025:Assert.{assertion}({expression}, \\\"message\\\")|}}\");\n\t\tvar after = string.Format(template, $\"Assert.{replacement}(condition, \\\"message\\\")\");\n\n\t\tawait Verify.VerifyCodeFix(before, after, BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer.Key_UseSuggestedAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_SimplifiesAllBooleanAsserts()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\t{|xUnit2025:Assert.True(condition == true)|};\n\t\t\t\t\t{|xUnit2025:Assert.True(condition == false)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tbool condition = true;\n\n\t\t\t\t\tAssert.True(condition);\n\t\t\t\t\tAssert.False(condition);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckBooleanFixer.Key_UseSuggestedAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.BooleanAssertsShouldNotBeUsedForSimpleEqualityCheck>;\n\npublic class BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixerTests\n{\n\tconst string template = /* lang=c#-test */ \"\"\"\n\t\tusing Xunit;\n\n\t\tpublic enum MyEnum {{ None, Bacon, Veggie }}\n\n\t\tpublic class TestClass {{\n\t\t\t[Fact]\n\t\t\tpublic void TestMethod() {{\n\t\t\t\t{0} value = {1};\n\n\t\t\t\t{2};\n\t\t\t}}\n\t\t}}\n\t\t\"\"\";\n\n\tpublic static MatrixTheoryData<string, string, string> MethodOperatorValue =\n\t\tnew(\n\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t[\"==\", \"!=\"],\n\t\t\t[\"\\\"bacon\\\"\", \"'5'\", \"5\", \"5l\", \"5.0d\", \"5.0f\", \"5.0m\", \"MyEnum.Bacon\"]\n\t\t);\n\n\t[Theory]\n\t[MemberData(nameof(MethodOperatorValue))]\n\tpublic async Task BooleanAssertAgainstLiteralValue_ReplaceWithEquality(\n\t\tstring method,\n\t\tstring @operator,\n\t\tstring value)\n\t{\n\t\tvar replacement =\n\t\t\t(method, @operator) switch\n\t\t\t{\n\t\t\t\t(Constants.Asserts.True, \"==\") or (Constants.Asserts.False, \"!=\") => Constants.Asserts.Equal,\n\t\t\t\t(_, _) => Constants.Asserts.NotEqual,\n\t\t\t};\n\n\t\t// Literal on the right\n\t\tawait Verify.VerifyCodeFix(\n\t\t\tstring.Format(template, \"var\", value, $\"{{|xUnit2024:Assert.{method}(value {@operator} {value})|}}\"),\n\t\t\tstring.Format(template, \"var\", value, $\"Assert.{replacement}({value}, value)\"),\n\t\t\tBooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.Key_UseSuggestedAssert\n\t\t);\n\n\t\t// Literal on the left\n\t\tawait Verify.VerifyCodeFix(\n\t\t\tstring.Format(template, \"var\", value, $\"{{|xUnit2024:Assert.{method}({value} {@operator} value)|}}\"),\n\t\t\tstring.Format(template, \"var\", value, $\"Assert.{replacement}({value}, value)\"),\n\t\t\tBooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.Key_UseSuggestedAssert\n\t\t);\n\t}\n\n\tpublic static MatrixTheoryData<string, string, string> MethodOperatorType =\n\t\tnew(\n\t\t\t[Constants.Asserts.True, Constants.Asserts.False],\n\t\t\t[\"==\", \"!=\"],\n\t\t\t[\"string\", \"int\", \"object\", \"MyEnum\"]\n\t\t);\n\n\t[Theory]\n\t[MemberData(nameof(MethodOperatorType))]\n\tpublic async Task BooleanAssertAgainstNull_ReplaceWithNull(\n\t\tstring method,\n\t\tstring @operator,\n\t\tstring type)\n\t{\n\t\tvar replacement =\n\t\t\t(method, @operator) switch\n\t\t\t{\n\t\t\t\t(Constants.Asserts.True, \"==\") or (Constants.Asserts.False, \"!=\") => Constants.Asserts.Null,\n\t\t\t\t(_, _) => Constants.Asserts.NotNull,\n\t\t\t};\n\n\t\t// Null on the right\n\t\tawait Verify.VerifyCodeFix(\n\t\t\tLanguageVersion.CSharp8,\n\t\t\tstring.Format(template, type + \"?\", \"null\", $\"{{|xUnit2024:Assert.{method}(value {@operator} null)|}}\"),\n\t\t\tstring.Format(template, type + \"?\", \"null\", $\"Assert.{replacement}(value)\"),\n\t\t\tBooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.Key_UseSuggestedAssert\n\t\t);\n\n\t\t// Null on the left\n\t\tawait Verify.VerifyCodeFix(\n\t\t\tLanguageVersion.CSharp8,\n\t\t\tstring.Format(template, type + \"?\", \"null\", $\"{{|xUnit2024:Assert.{method}(null {@operator} value)|}}\"),\n\t\t\tstring.Format(template, type + \"?\", \"null\", $\"Assert.{replacement}(value)\"),\n\t\t\tBooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.Key_UseSuggestedAssert\n\t\t);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllNonBooleanEqualityChecks()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar value = 5;\n\n\t\t\t\t\t{|xUnit2024:Assert.True(value == 5)|};\n\t\t\t\t\t{|xUnit2024:Assert.True(value != 5)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar value = 5;\n\n\t\t\t\t\tAssert.Equal(5, value);\n\t\t\t\t\tAssert.NotEqual(5, value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, BooleanAssertsShouldNotBeUsedForSimpleEqualityCheckNonBooleanFixer.Key_UseSuggestedAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/UseAssertFailInsteadOfBooleanAssertFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.UseAssertFailInsteadOfBooleanAssert>;\n\npublic class UseAssertFailInsteadOfBooleanAssertFixerTests\n{\n\t[Fact]\n\tpublic async Task FixAll_ReplacesAllBooleanAssertsWithFail()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\t[|Assert.True(false, \"message one\")|];\n\t\t\t\t\t[|Assert.False(true, \"message two\")|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tAssert.Fail(\"message one\");\n\t\t\t\t\tAssert.Fail(\"message two\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCodeFixFixAll(before, after, UseAssertFailInsteadOfBooleanAssertFixer.Key_UseAssertFail);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X2000/UseGenericOverloadFixTests.cs",
    "content": "using System.Threading.Tasks;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify_X2007 = CSharpVerifier<Xunit.Analyzers.AssertIsTypeShouldUseGenericOverloadType>;\nusing Verify_X2015 = CSharpVerifier<Xunit.Analyzers.AssertThrowsShouldUseGenericOverloadCheck>;\n\npublic class UseGenericOverloadFixTests\n{\n\t[Fact]\n\tpublic async Task X2007_SwitchesToGenericIsAssignableFrom()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\t[|Assert.IsAssignableFrom(typeof(int), result)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\tAssert.IsAssignableFrom<int>(result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X2007.VerifyCodeFix(before, after, UseGenericOverloadFix.Key_UseAlternateAssert);\n\t}\n\n\t[Theory]\n\t[InlineData(\"result\")]\n\t[InlineData(\"result, true\")]\n\t[InlineData(\"result, false\")]\n\tpublic async Task X2007_SwitchesToGenericIsType(string arguments)\n\t{\n\t\tvar before = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\t[|Assert.IsType(typeof(int), {0})|];\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", arguments);\n\t\tvar after = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {{\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\tAssert.IsType<int>({0});\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", arguments);\n\n\t\tawait Verify_X2007.VerifyCodeFix(before, after, UseGenericOverloadFix.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task X2015_SwitchesToGenericThrows()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tAction func = () => { };\n\n\t\t\t\t\t[|Assert.Throws(typeof(DivideByZeroException), func)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tAction func = () => { };\n\n\t\t\t\t\tAssert.Throws<DivideByZeroException>(func);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X2015.VerifyCodeFix(before, after, UseGenericOverloadFix.Key_UseAlternateAssert);\n\t}\n\n\t[Fact]\n\tpublic async Task FixAll_SwitchesAllToGenericOverloads()\n\t{\n\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\t[|Assert.IsType(typeof(int), result)|];\n\t\t\t\t\t[|Assert.IsAssignableFrom(typeof(int), result)|];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tvar result = 123;\n\n\t\t\t\t\tAssert.IsType<int>(result);\n\t\t\t\t\tAssert.IsAssignableFrom<int>(result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify_X2007.VerifyCodeFixFixAll(before, after, UseGenericOverloadFix.Key_UseAlternateAssert);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X3000/CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Xunit.Analyzers.Fixes;\nusing Verify_WithAbstractions = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests.WithAbstractions.Analyzer>;\nusing Verify_WithExecution = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests.WithExecution.Analyzer>;\nusing Verify_WithRunnerUtility = CSharpVerifier<CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests.WithRunnerUtility.Analyzer>;\n\npublic class CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests\n{\n\tpublic class WithAbstractions : CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixerTests\n\t{\n\t\tconst string Template = /* lang=c#-test */ \"using Xunit.Abstractions; public class {0}: {1} {{ }}\";\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithAbstractions.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithAbstractions))]\n\t\tpublic async Task DoesNotAttemptToFix(string @interface)\n\t\t{\n\t\t\tvar source = string.Format(Template, /* lang=c#-test */ \"[|MyClass|]\", @interface);\n\n\t\t\tawait Verify_WithAbstractions.VerifyCodeFixV2(\n\t\t\t\tsource,\n\t\t\t\tsource,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2Abstractions(compilation);\n\t\t}\n\t}\n\n\tpublic class WithExecution\n\t{\n\t\tconst string Template_WithoutUsing = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class {0}: {1} {{ }}\n\t\t\t\"\"\";\n\t\tconst string Template_WithUsing = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class {0}: {1} {{ }}\n\t\t\t\"\"\";\n\n\t\t[Fact]\n\t\tpublic async Task FixAll_AddsBaseClassToMultipleClasses()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing Xunit.Abstractions;\n\n\t\t\t\tpublic class [|MyClass1|]: IMessageSink {\n\t\t\t\t\tpublic bool OnMessage(IMessageSinkMessage message) => true;\n\t\t\t\t}\n\t\t\t\tpublic class [|MyClass2|]: IMessageSink {\n\t\t\t\t\tpublic bool OnMessage(IMessageSinkMessage message) => true;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit;\n\t\t\t\tusing Xunit.Abstractions;\n\n\t\t\t\tpublic class MyClass1: LongLivedMarshalByRefObject, IMessageSink {\n\t\t\t\t\tpublic bool OnMessage(IMessageSinkMessage message) => true;\n\t\t\t\t}\n\t\t\t\tpublic class MyClass2: LongLivedMarshalByRefObject, IMessageSink {\n\t\t\t\t\tpublic bool OnMessage(IMessageSinkMessage message) => true;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify_WithExecution.VerifyCodeFixV2FixAll(before, after, CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution))]\n\t\tpublic async Task WithNoBaseClass_WithoutUsing_AddsBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithoutUsing, /* lang=c#-test */ \"[|MyClass|]\", @interface);\n\t\t\tvar after = string.Format(Template_WithoutUsing, \"MyClass\", $\"Xunit.LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithExecution.VerifyCodeFixV2(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution))]\n\t\tpublic async Task WithNoBaseClass_WithUsing_AddsBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithUsing, /* lang=c#-test */ \"[|MyClass|]\", @interface);\n\t\t\tvar after = string.Format(Template_WithUsing, \"MyClass\", $\"LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithExecution.VerifyCodeFixV2(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution))]\n\t\tpublic async Task WithBadBaseClass_WithoutUsing_ReplacesBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithoutUsing, /* lang=c#-test */ \"[|MyClass|]\", $\"Foo, {@interface}\");\n\t\t\tvar after = string.Format(Template_WithoutUsing, \"MyClass\", $\"Xunit.LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithExecution.VerifyCodeFixV2(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithExecution))]\n\t\tpublic async Task WithBadBaseClass_WithUsing_ReplacesBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithUsing, /* lang=c#-test */ \"[|MyClass|]\", $\"Foo, {@interface}\");\n\t\t\tvar after = string.Format(Template_WithUsing, \"MyClass\", $\"LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithExecution.VerifyCodeFixV2(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2Execution(compilation);\n\t\t}\n\t}\n\n\tpublic class WithRunnerUtility\n\t{\n\t\tconst string Template_WithoutUsing = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class {0}: {1} {{ }}\n\t\t\t\"\"\";\n\t\tconst string Template_WithUsing = /* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit.Abstractions;\n\t\t\tusing Xunit.Sdk;\n\n\t\t\tpublic class Foo {{ }}\n\t\t\tpublic class {0}: {1} {{ }}\n\t\t\t\"\"\";\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility))]\n\t\tpublic async Task WithNoBaseClass_WithoutUsing_AddsBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithoutUsing, /* lang=c#-test */ \"[|MyClass|]\", @interface);\n\t\t\tvar after = string.Format(Template_WithoutUsing, \"MyClass\", $\"Xunit.Sdk.LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyCodeFixV2RunnerUtility(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility))]\n\t\tpublic async Task WithNoBaseClass_WithUsing_AddsBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithUsing, /* lang=c#-test */ \"[|MyClass|]\", @interface);\n\t\t\tvar after = string.Format(Template_WithUsing, \"MyClass\", $\"LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyCodeFixV2RunnerUtility(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility))]\n\t\tpublic async Task WithBadBaseClass_WithoutUsing_ReplacesBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithoutUsing, /* lang=c#-test */ \"[|MyClass|]\", $\"Foo, {@interface}\");\n\t\t\tvar after = string.Format(Template_WithoutUsing, \"MyClass\", $\"Xunit.Sdk.LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyCodeFixV2RunnerUtility(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\t[Theory]\n\t\t[MemberData(nameof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility.Interfaces), MemberType = typeof(CrossAppDomainClassesMustBeLongLivedMarshalByRefObjectTests.WithRunnerUtility))]\n\t\tpublic async Task WithBadBaseClass_WithUsing_ReplacesBaseClass(string @interface)\n\t\t{\n\t\t\tvar before = string.Format(Template_WithUsing, /* lang=c#-test */ \"[|MyClass|]\", $\"Foo, {@interface}\");\n\t\t\tvar after = string.Format(Template_WithUsing, \"MyClass\", $\"LongLivedMarshalByRefObject, {@interface}\");\n\n\t\t\tawait Verify_WithRunnerUtility.VerifyCodeFixV2RunnerUtility(\n\t\t\t\tbefore,\n\t\t\t\tafter,\n\t\t\t\tCrossAppDomainClassesMustBeLongLivedMarshalByRefObjectFixer.Key_SetBaseType\n\t\t\t);\n\t\t}\n\n\t\tinternal class Analyzer : CrossAppDomainClassesMustBeLongLivedMarshalByRefObject\n\t\t{\n\t\t\tprotected override XunitContext CreateXunitContext(Compilation compilation) =>\n\t\t\t\tXunitContext.ForV2RunnerUtility(compilation);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Fixes/X3000/SerializableClassMustHaveParameterlessConstructorFixerTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Xunit;\nusing Xunit.Analyzers.Fixes;\nusing Verify = CSharpVerifier<Xunit.Analyzers.SerializableClassMustHaveParameterlessConstructor>;\n\npublic class SerializableClassMustHaveParameterlessConstructorFixerTests\n{\n\tpublic class JsonTypeID\n\t{\n\t\t[Fact]\n\t\tpublic async Task WithPublicParameteredConstructor_AddsNewConstructor()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\t[JsonTypeID(\"1\")]\n\t\t\t\tpublic class [|MyJsonObject|] {\n\t\t\t\t\tpublic MyJsonObject(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\t[JsonTypeID(\"1\")]\n\t\t\t\tpublic class MyJsonObject {\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyJsonObject()\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tpublic MyJsonObject(int _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithNonPublicParameterlessConstructor_ChangesVisibility()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\t[JsonTypeID(\"1\")]\n\t\t\t\tpublic class [|MyJsonObject|] {\n\t\t\t\t\tprotected MyJsonObject() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\t[JsonTypeID(\"1\")]\n\t\t\t\tpublic class MyJsonObject {\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyJsonObject() { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\t}\n\n\tpublic class RunnerReporter\n\t{\n\t\t[Fact]\n\t\tpublic async Task WithPublicParameteredConstructor_AddsNewConstructor()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit.Runner.Common;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class [|MyRunnerReporter|] : IRunnerReporter\n\t\t\t\t{\n\t\t\t\t\tpublic MyRunnerReporter(int _) { }\n\t\t\t\t\n\t\t\t\t\tpublic bool CanBeEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string Description => string.Empty;\n\t\t\t\t\tpublic bool ForceNoLogo => false;\n\t\t\t\t\tpublic bool IsEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string? RunnerSwitch => \"unused\";\n\t\t\t\t\n\t\t\t\t\tpublic ValueTask<IRunnerReporterMessageHandler> CreateMessageHandler(\n\t\t\t\t\t\tIRunnerLogger logger,\n\t\t\t\t\t\tIMessageSink? diagnosticMessageSink) =>\n\t\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit.Runner.Common;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class MyRunnerReporter : IRunnerReporter\n\t\t\t\t{\n\t\t\t\t\tpublic MyRunnerReporter()\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic MyRunnerReporter(int _) { }\n\t\t\t\t\n\t\t\t\t\tpublic bool CanBeEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string Description => string.Empty;\n\t\t\t\t\tpublic bool ForceNoLogo => false;\n\t\t\t\t\tpublic bool IsEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string? RunnerSwitch => \"unused\";\n\t\t\t\t\n\t\t\t\t\tpublic ValueTask<IRunnerReporterMessageHandler> CreateMessageHandler(\n\t\t\t\t\t\tIRunnerLogger logger,\n\t\t\t\t\t\tIMessageSink? diagnosticMessageSink) =>\n\t\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(LanguageVersion.CSharp8, before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithNonPublicParameterlessConstructor_ChangesVisibility()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit.Runner.Common;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class [|MyRunnerReporter|] : IRunnerReporter\n\t\t\t\t{\n\t\t\t\t\tprotected MyRunnerReporter() { }\n\t\t\t\t\n\t\t\t\t\tpublic bool CanBeEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string Description => string.Empty;\n\t\t\t\t\tpublic bool ForceNoLogo => false;\n\t\t\t\t\tpublic bool IsEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string? RunnerSwitch => \"unused\";\n\t\t\t\t\n\t\t\t\t\tpublic ValueTask<IRunnerReporterMessageHandler> CreateMessageHandler(\n\t\t\t\t\t\tIRunnerLogger logger,\n\t\t\t\t\t\tIMessageSink? diagnosticMessageSink) =>\n\t\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing System.Threading.Tasks;\n\t\t\t\tusing Xunit.Runner.Common;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class MyRunnerReporter : IRunnerReporter\n\t\t\t\t{\n\t\t\t\t\tpublic MyRunnerReporter() { }\n\t\t\t\t\n\t\t\t\t\tpublic bool CanBeEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string Description => string.Empty;\n\t\t\t\t\tpublic bool ForceNoLogo => false;\n\t\t\t\t\tpublic bool IsEnvironmentallyEnabled => false;\n\t\t\t\t\tpublic string? RunnerSwitch => \"unused\";\n\t\t\t\t\n\t\t\t\t\tpublic ValueTask<IRunnerReporterMessageHandler> CreateMessageHandler(\n\t\t\t\t\t\tIRunnerLogger logger,\n\t\t\t\t\t\tIMessageSink? diagnosticMessageSink) =>\n\t\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(LanguageVersion.CSharp8, before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\t}\n\n\tpublic class XunitSerializable\n\t{\n\t\t[Fact]\n\t\tpublic async Task FixAll_AddsConstructorsToMultipleClasses()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\tpublic class [|MyTestCase1|]: IXunitSerializable {\n\t\t\t\t\tpublic MyTestCase1(int x) { }\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) { }\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class [|MyTestCase2|]: IXunitSerializable {\n\t\t\t\t\tpublic MyTestCase2(string s) { }\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) { }\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing Xunit.Sdk;\n\n\t\t\t\tpublic class MyTestCase1: IXunitSerializable {\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyTestCase1()\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic MyTestCase1(int x) { }\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) { }\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) { }\n\t\t\t\t}\n\n\t\t\t\tpublic class MyTestCase2: IXunitSerializable {\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyTestCase2()\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic MyTestCase2(string s) { }\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) { }\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) { }\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3FixAll(before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithPublicParameteredConstructor_AddsNewConstructor()\n\t\t{\n\t\t\tvar beforeTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class [|MyTestCase|]: {0}.IXunitSerializable {{\n\t\t\t\t\tpublic MyTestCase(int x) {{ }}\n\n\t\t\t\t\tvoid {0}.IXunitSerializable.Deserialize({0}.IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid {0}.IXunitSerializable.Serialize({0}.IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\t\t\tvar afterTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tpublic class MyTestCase: {0}.IXunitSerializable {{\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyTestCase()\n\t\t\t\t\t{{\n\t\t\t\t\t}}\n\n\t\t\t\t\tpublic MyTestCase(int x) {{ }}\n\n\t\t\t\t\tvoid {0}.IXunitSerializable.Deserialize({0}.IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid {0}.IXunitSerializable.Serialize({0}.IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\n\t\t\tvar v2Before = string.Format(beforeTemplate, \"Xunit.Abstractions\");\n\t\t\tvar v2After = string.Format(afterTemplate, \"Xunit.Abstractions\");\n\n\t\t\tawait Verify.VerifyCodeFixV2(v2Before, v2After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\n\t\t\tvar v3Before = string.Format(beforeTemplate, \"Xunit.Sdk\");\n\t\t\tvar v3After = string.Format(afterTemplate, \"Xunit.Sdk\");\n\n\t\t\tawait Verify.VerifyCodeFixV3(v3Before, v3After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithNonPublicParameterlessConstructor_ChangesVisibility_WithoutUsing()\n\t\t{\n\t\t\tvar beforeTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing {0};\n\n\t\t\t\tpublic class [|MyTestCase|]: IXunitSerializable {{\n\t\t\t\t\tprotected MyTestCase() {{ throw new System.DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\t\t\tvar afterTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing {0};\n\n\t\t\t\tpublic class MyTestCase: IXunitSerializable {{\n\t\t\t\t\t[System.Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyTestCase() {{ throw new System.DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\n\t\t\tvar v2Before = string.Format(beforeTemplate, \"Xunit.Abstractions\");\n\t\t\tvar v2After = string.Format(afterTemplate, \"Xunit.Abstractions\");\n\n\t\t\tawait Verify.VerifyCodeFixV2(v2Before, v2After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\n\t\t\tvar v3Before = string.Format(beforeTemplate, \"Xunit.Sdk\");\n\t\t\tvar v3After = string.Format(afterTemplate, \"Xunit.Sdk\");\n\n\t\t\tawait Verify.VerifyCodeFixV3(v3Before, v3After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithNonPublicParameterlessConstructor_ChangesVisibility_WithUsing()\n\t\t{\n\t\t\tvar beforeTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing {0};\n\n\t\t\t\tpublic class [|MyTestCase|]: IXunitSerializable {{\n\t\t\t\t\tprotected MyTestCase() {{ throw new DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\t\t\tvar afterTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing {0};\n\n\t\t\t\tpublic class MyTestCase: IXunitSerializable {{\n\t\t\t\t\t[Obsolete(\"Called by the de-serializer; should only be called by deriving classes for de-serialization purposes\")]\n\t\t\t\t\tpublic MyTestCase() {{ throw new DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\n\t\t\tvar v2Before = string.Format(beforeTemplate, \"Xunit.Abstractions\");\n\t\t\tvar v2After = string.Format(afterTemplate, \"Xunit.Abstractions\");\n\n\t\t\tawait Verify.VerifyCodeFixV2(v2Before, v2After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\n\t\t\tvar v3Before = string.Format(beforeTemplate, \"Xunit.Sdk\");\n\t\t\tvar v3After = string.Format(afterTemplate, \"Xunit.Sdk\");\n\n\t\t\tawait Verify.VerifyCodeFixV3(v3Before, v3After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task PreservesExistingObsoleteAttribute()\n\t\t{\n\t\t\tvar beforeTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing {0};\n\t\t\t\tusing obo = System.ObsoleteAttribute;\n\n\t\t\t\tpublic class [|MyTestCase|]: IXunitSerializable {{\n\t\t\t\t\t[obo(\"This is my custom obsolete message\")]\n\t\t\t\t\tprotected MyTestCase() {{ throw new System.DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\t\t\tvar afterTemplate = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing {0};\n\t\t\t\tusing obo = System.ObsoleteAttribute;\n\n\t\t\t\tpublic class MyTestCase: IXunitSerializable {{\n\t\t\t\t\t[obo(\"This is my custom obsolete message\")]\n\t\t\t\t\tpublic MyTestCase() {{ throw new System.DivideByZeroException(); }}\n\n\t\t\t\t\tvoid IXunitSerializable.Deserialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t\tvoid IXunitSerializable.Serialize(IXunitSerializationInfo _) {{ }}\n\t\t\t\t}}\n\t\t\t\t\"\"\";\n\n\t\t\tvar v2Before = string.Format(beforeTemplate, \"Xunit.Abstractions\");\n\t\t\tvar v2After = string.Format(afterTemplate, \"Xunit.Abstractions\");\n\n\t\t\tawait Verify.VerifyCodeFixV2(v2Before, v2After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\n\t\t\tvar v3Before = string.Format(beforeTemplate, \"Xunit.Sdk\");\n\t\t\tvar v3After = string.Format(afterTemplate, \"Xunit.Sdk\");\n\n\t\t\tawait Verify.VerifyCodeFixV3(v3Before, v3After, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\t}\n\n\tpublic class XunitSerializer\n\t{\n\t\t[Fact]\n\t\tpublic async Task WithPublicParameteredConstructor_AddsNewConstructor()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class [|MySerializer|] : IXunitSerializer\n\t\t\t\t{\n\t\t\t\t\tpublic MySerializer(int _) { }\n\n\t\t\t\t\tpublic object Deserialize(Type type, string serializedValue) => null!;\n\t\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t\t{\n\t\t\t\t\t\tfailureReason = null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tpublic string Serialize(object value) => string.Empty;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class MySerializer : IXunitSerializer\n\t\t\t\t{\n\t\t\t\t\tpublic MySerializer()\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic MySerializer(int _) { }\n\t\t\t\t\n\t\t\t\t\tpublic object Deserialize(Type type, string serializedValue) => null!;\n\t\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t\t{\n\t\t\t\t\t\tfailureReason = null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tpublic string Serialize(object value) => string.Empty;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(LanguageVersion.CSharp8, before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic async Task WithNonPublicParameterlessConstructor_ChangesVisibility()\n\t\t{\n\t\t\tvar before = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class [|MySerializer|] : IXunitSerializer\n\t\t\t\t{\n\t\t\t\t\tprotected MySerializer() { }\n\n\t\t\t\t\tpublic object Deserialize(Type type, string serializedValue) => null!;\n\t\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t\t{\n\t\t\t\t\t\tfailureReason = null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tpublic string Serialize(object value) => string.Empty;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\t\t\tvar after = /* lang=c#-test */ \"\"\"\n\t\t\t\tusing System;\n\t\t\t\tusing Xunit.Sdk;\n\t\t\t\t\n\t\t\t\tpublic class MySerializer : IXunitSerializer\n\t\t\t\t{\n\t\t\t\t\tpublic MySerializer() { }\n\t\t\t\t\n\t\t\t\t\tpublic object Deserialize(Type type, string serializedValue) => null!;\n\t\t\t\t\tpublic bool IsSerializable(Type type, object? value, out string? failureReason)\n\t\t\t\t\t{\n\t\t\t\t\t\tfailureReason = null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tpublic string Serialize(object value) => string.Empty;\n\t\t\t\t}\n\t\t\t\t\"\"\";\n\n\t\t\tawait Verify.VerifyCodeFixV3(LanguageVersion.CSharp8, before, after, SerializableClassMustHaveParameterlessConstructorFixer.Key_GenerateOrUpdateConstructor);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Suppressors/ConsiderCallingConfigureAwaitSuppressorTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Suppressors.ConsiderCallingConfigureAwaitSuppressor>;\n\npublic sealed class ConsiderCallingConfigureAwaitSuppressorTests\n{\n\t[Fact]\n\tpublic async Task NonTestMethod_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\n\t\t\tpublic class NonTestClass {\n\t\t\t\tpublic async Task NonTestMethod() {\n\t\t\t\t\tawait {|CA2007:Task.Delay(1)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifySuppressor(code, CodeAnalysisNetAnalyzers.CA2007());\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"FactAttribute\")]\n\t[InlineData(\"Theory\")]\n\t[InlineData(\"TheoryAttribute\")]\n\tpublic async Task StandardTestMethod_Suppresses(string attribute)\n\t{\n\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic async Task TestMethod() {{\n\t\t\t\t\tawait {{|#0:Task.Delay(1)|}};\n\t\t\t\t}}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CA2007\").WithLocation(0).WithIsSuppressed(true);\n\n\t\tawait Verify.VerifySuppressor(code, CodeAnalysisNetAnalyzers.CA2007(), expected);\n\t}\n\n\t[Fact]\n\tpublic async Task CustomFactTestMethod_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tinternal class CustomFactAttribute : FactAttribute { }\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[CustomFact]\n\t\t\t\tpublic async Task TestMethod() {\n\t\t\t\t\tawait {|CA2007:Task.Delay(1)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifySuppressor(code, CodeAnalysisNetAnalyzers.CA2007());\n\t}\n\n\t[Fact]\n\tpublic async Task CodeInsideFunctions_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System;\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic void TestMethod() {\n\t\t\t\t\tasync Task InnerMethod1() { await {|CA2007:Task.Delay(1)|}; }\n\t\t\t\t\tasync Task InnerMethod2() => await {|CA2007:Task.Delay(1)|};\n\t\t\t\t\tFunc<Task> Lambda = async () => await {|CA2007:Task.Delay(1)|};\n\t\t\t\t}\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifySuppressor(LanguageVersion.CSharp7, code, CodeAnalysisNetAnalyzers.CA2007());\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Suppressors/MakeTypesInternalSuppressorTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Suppressors.MakeTypesInternalSuppressor>;\n\npublic sealed class MakeTypesInternalSuppressorTests\n{\n\t[Fact]\n\tpublic async Task NonTestClass_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tpublic class {|CA1515:NonTestClass|} {\n\t\t\t\tpublic void NonTestMethod() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifySuppressor(code, CodeAnalysisNetAnalyzers.CA1515());\n\t}\n\n\t[Theory]\n\t[InlineData(\"Fact\")]\n\t[InlineData(\"FactAttribute\")]\n\t[InlineData(\"Theory\")]\n\t[InlineData(\"TheoryAttribute\")]\n\t[InlineData(\"CustomFact\")]\n\t[InlineData(\"CustomFactAttribute\")]\n\tpublic async Task TestClass_Suppresses(string attribute)\n\t{\n\t\tvar code = string.Format(/* lang=c#-test */ \"\"\"\n\t\t\tusing Xunit;\n\n\t\t\tinternal class CustomFactAttribute : FactAttribute {{ }}\n\n\t\t\tpublic class {{|#0:TestClass|}} {{\n\t\t\t\t[{0}]\n\t\t\t\tpublic void TestMethod() {{ }}\n\t\t\t}}\n\t\t\t\"\"\", attribute);\n\t\tvar expected = new DiagnosticResult(\"CA1515\", DiagnosticSeverity.Warning).WithLocation(0).WithIsSuppressed(true);\n\n\t\tawait Verify.VerifySuppressor(code, CodeAnalysisNetAnalyzers.CA1515(), expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Suppressors/NonNullableFieldInitializationSuppressorTests.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Verify = CSharpVerifier<Xunit.Suppressors.NonNullableFieldInitializationSuppressor>;\n\npublic sealed class NonNullableFieldInitializationSuppressorTests\n{\n\t// ----- v2 (Task-based IAsyncLifetime) -----\n\n\t[Fact]\n\tpublic async Task NonAsyncLifetimeClass_V2_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\n\t\t\tpublic class NonTestClass {\n\t\t\t\tprivate string {|CS8618:_field|};\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldInitializedInInitializeAsync_V2_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|#0:_field|};\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\t_field = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task PropertyInitializedInInitializeAsync_V2_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tpublic string {|#0:Prop|} { get; set; }\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\tProp = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldNotInitializedInInitializeAsync_V2_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|CS8618:_field|};\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldInitializedWithThis_V2_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|#0:_field|};\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\tthis._field = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task MultipleFields_OnlyInitializedOnesSuppressed_V2()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|#0:_initialized|};\n\t\t\t\tprivate string {|CS8618:_notInitialized|};\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\t_initialized = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldAssignedWithExplicitConstructor_V2_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string _field;\n\t\t\t\tpublic {|#0:TestClass|}() { }\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\t_field = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldNotAssignedWithExplicitConstructor_V2_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string _field;\n\t\t\t\tpublic {|CS8618:TestClass|}() { }\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task PropertyAssignedWithExplicitConstructor_V2_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tpublic string MyProp { get; set; }\n\t\t\t\tpublic {|#0:TestClass|}() { }\n\n\t\t\t\tpublic Task InitializeAsync() {\n\t\t\t\t\tMyProp = \"hello\";\n\t\t\t\t\treturn Task.CompletedTask;\n\t\t\t\t}\n\n\t\t\t\tpublic Task DisposeAsync() => Task.CompletedTask;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV2(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t// ----- v3 (ValueTask-based IAsyncLifetime) -----\n\n\t[Fact]\n\tpublic async Task NonAsyncLifetimeClass_V3_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\n\t\t\tpublic class NonTestClass {\n\t\t\t\tprivate string {|CS8618:_field|};\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldInitializedInInitializeAsync_V3_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|#0:_field|};\n\n\t\t\t\tpublic ValueTask InitializeAsync() {\n\t\t\t\t\t_field = \"hello\";\n\t\t\t\t\treturn default;\n\t\t\t\t}\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task PropertyInitializedInInitializeAsync_V3_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tpublic string {|#0:Prop|} { get; set; }\n\n\t\t\t\tpublic ValueTask InitializeAsync() {\n\t\t\t\t\tProp = \"hello\";\n\t\t\t\t\treturn default;\n\t\t\t\t}\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldNotInitializedInInitializeAsync_V3_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string {|CS8618:_field|};\n\n\t\t\t\tpublic ValueTask InitializeAsync() => default;\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldAssignedWithExplicitConstructor_V3_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string _field;\n\t\t\t\tpublic {|#0:TestClass|}() { }\n\n\t\t\t\tpublic ValueTask InitializeAsync() {\n\t\t\t\t\t_field = \"hello\";\n\t\t\t\t\treturn default;\n\t\t\t\t}\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code], expected);\n\t}\n\n\t[Fact]\n\tpublic async Task FieldNotAssignedWithExplicitConstructor_V3_DoesNotSuppress()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tprivate string _field;\n\t\t\t\tpublic {|CS8618:TestClass|}() { }\n\n\t\t\t\tpublic ValueTask InitializeAsync() => default;\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code]);\n\t}\n\n\t[Fact]\n\tpublic async Task PropertyAssignedWithExplicitConstructor_V3_Suppresses()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\t#nullable enable\n\t\t\t#pragma warning disable CS0414, CS0169, CS1591\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class TestClass : IAsyncLifetime {\n\t\t\t\tpublic string MyProp { get; set; }\n\t\t\t\tpublic {|#0:TestClass|}() { }\n\n\t\t\t\tpublic ValueTask InitializeAsync() {\n\t\t\t\t\tMyProp = \"hello\";\n\t\t\t\t\treturn default;\n\t\t\t\t}\n\n\t\t\t\tpublic ValueTask DisposeAsync() => default;\n\n\t\t\t\t[Fact]\n\t\t\t\tpublic void Test1() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = DiagnosticResult.CompilerWarning(\"CS8618\").WithLocation(0).WithIsSuppressed(true).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations);\n\n\t\tawait Verify.VerifyCompilerWarningSuppressorV3(LanguageVersion.CSharp8, [code], expected);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Suppressors/UseAsyncSuffixForAsyncMethodsSuppressorTests.cs",
    "content": "#if NETCOREAPP  // System.Collections.Immutable 1.6.0 conflicts with 6.0.0 in NetFx\n\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Testing;\nusing Xunit;\nusing Xunit.Analyzers;\nusing Verify = CSharpVerifier<Xunit.Suppressors.UseAsyncSuffixForAsyncMethodsSuppressor>;\n\npublic class UseAsyncSuffixForAsyncMethodsSuppressorTests\n{\n\t[Fact]\n\tpublic async Task AcceptanceTest()\n\t{\n\t\tvar code = /* lang=c#-test */ \"\"\"\n\t\t\tusing System.Threading.Tasks;\n\t\t\tusing Xunit;\n\n\t\t\tpublic class NonTestClass {\n\t\t\t\tpublic async Task {|#0:NonTestMethod|}() { }\n\t\t\t}\n\n\t\t\tpublic class TestClass {\n\t\t\t\t[Fact]\n\t\t\t\tpublic async Task {|#1:TestMethod|]() { }\n\t\t\t}\n\t\t\t\"\"\";\n\t\tvar expected = new[]\n\t\t{\n\t\t\tnew DiagnosticResult(\"VSTHRD200\", DiagnosticSeverity.Warning).WithLocation(0),\n\t\t\tnew DiagnosticResult(\"VSTHRD200\", DiagnosticSeverity.Warning).WithLocation(1).WithIsSuppressed(true),\n\t\t};\n\n\t\tawait Verify.VerifySuppressor(code, VsThreadingAnalyzers.VSTHRD200(), expected);\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/3rdPartyAnalyzers/AnalyzerLoaderBase.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#if NETCOREAPP\nusing System.Runtime.Loader;\n#endif\n\nnamespace Xunit.Analyzers;\n\npublic class AnalyzerLoaderBase\n{\n\tstatic readonly Lazy<string> nuGetPackagesFolder = new(GetNuGetPackagesFolder, isThreadSafe: true);\n\n\tprotected static string NuGetPackagesFolder => nuGetPackagesFolder.Value;\n\n\tprotected static Type FindType(\n\t\tLazy<Assembly> assembly,\n\t\tstring typeName) =>\n\t\t\tassembly.Value.GetType(typeName) ?? throw new InvalidOperationException($\"Could not locate type '{typeName}' from '{assembly.Value.GetName().Name}'\");\n\n\tstatic string GetNuGetPackagesFolder()\n\t{\n\t\tvar result = Environment.GetEnvironmentVariable(\"NUGET_PACKAGES\");\n\t\tif (result is null)\n\t\t{\n\t\t\tvar homeFolder =\n\t\t\t\tRuntimeInformation.IsOSPlatform(OSPlatform.Windows)\n\t\t\t\t\t? Environment.GetEnvironmentVariable(\"USERPROFILE\")\n\t\t\t\t\t: Environment.GetEnvironmentVariable(\"HOME\");\n\n\t\t\tresult = Path.Combine(homeFolder ?? throw new InvalidOperationException(\"Could not determine home folder\"), \".nuget\", \"packages\");\n\t\t}\n\n\t\tif (!Directory.Exists(result))\n\t\t\tthrow new InvalidOperationException($\"NuGet package cache folder '{result}' does not exist\");\n\n\t\treturn result;\n\t}\n\n\tprotected static Assembly LoadAssembly(string assemblyPath) =>\n#if NETCOREAPP\n\t\tAssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath);\n#else\n\t\tAssembly.LoadFrom(assemblyPath);\n#endif\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/3rdPartyAnalyzers/CodeAnalysisNetAnalyzers.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reflection;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\npublic class CodeAnalysisNetAnalyzers : AnalyzerLoaderBase\n{\n\tstatic readonly Lazy<Assembly> assemblyCSharpNetAnalyzers = new(LoadCSharpNetAnalyzers, isThreadSafe: true);\n\tstatic readonly Lazy<Assembly> assemblyNetAnalyzers = new(LoadNetAnalyzers, isThreadSafe: true);\n\tstatic readonly Lazy<Type> typeCA1515 = new(() => FindType(assemblyCSharpNetAnalyzers, \"Microsoft.CodeQuality.CSharp.Analyzers.Maintainability.CSharpMakeTypesInternal\"), isThreadSafe: true);\n\tstatic readonly Lazy<Type> typeCA2007 = new(() => FindType(assemblyNetAnalyzers, \"Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.DoNotDirectlyAwaitATaskAnalyzer\"), isThreadSafe: true);\n\n\tpublic static DiagnosticAnalyzer CA1515() =>\n\t\tActivator.CreateInstance(typeCA1515.Value) as DiagnosticAnalyzer ?? throw new InvalidOperationException($\"Could not create instance of '{typeCA1515.Value.FullName}'\");\n\n\tpublic static DiagnosticAnalyzer CA2007() =>\n\t\tActivator.CreateInstance(typeCA2007.Value) as DiagnosticAnalyzer ?? throw new InvalidOperationException($\"Could not create instance of '{typeCA2007.Value.FullName}'\");\n\n\tstatic Assembly LoadCSharpNetAnalyzers()\n\t{\n\t\t// Make sure we load the dependencies first\n\t\tvar _ = assemblyNetAnalyzers.Value;\n\n\t\treturn LoadAssembly(Path.Combine(NuGetPackagesFolder, \"microsoft.codeanalysis.netanalyzers\", \"10.0.100\", \"analyzers\", \"dotnet\", \"cs\", \"Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll\"));\n\t}\n\n\tstatic Assembly LoadNetAnalyzers()\n\t{\n\t\tLoadAssembly(Path.Combine(NuGetPackagesFolder, \"microsoft.codeanalysis.workspaces.common\", \"3.11.0\", \"lib\", \"netcoreapp3.1\", \"Microsoft.CodeAnalysis.Workspaces.dll\"));\n\t\treturn LoadAssembly(Path.Combine(NuGetPackagesFolder, \"microsoft.codeanalysis.netanalyzers\", \"10.0.100\", \"analyzers\", \"dotnet\", \"Microsoft.CodeAnalysis.NetAnalyzers.dll\"));\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/3rdPartyAnalyzers/VsThreadingAnalyzers.cs",
    "content": "#if NETCOREAPP  // System.Collections.Immutable 1.6.0 conflicts with 6.0.0 in NetFx\n\nusing System;\nusing System.IO;\nusing System.Reflection;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Xunit.Analyzers;\n\npublic class VsThreadingAnalyzers : AnalyzerLoaderBase\n{\n\tstatic readonly Lazy<Assembly> assemblyVsThreading = new(LoadVsThreadingAnalyzers, isThreadSafe: true);\n\tstatic readonly Lazy<Type> typeVSTHRD200 = new(() => FindType(assemblyVsThreading, \"Microsoft.VisualStudio.Threading.Analyzers.VSTHRD200UseAsyncNamingConventionAnalyzer\"), isThreadSafe: true);\n\n\tpublic static DiagnosticAnalyzer VSTHRD200() =>\n\t\tActivator.CreateInstance(typeVSTHRD200.Value) as DiagnosticAnalyzer ?? throw new InvalidOperationException($\"Could not create instance of '{typeVSTHRD200.Value.FullName}'\");\n\n\tstatic Assembly LoadVsThreadingAnalyzers()\n\t{\n\t\tLoadAssembly(Path.Combine(NuGetPackagesFolder, \"system.collections.immutable\", \"6.0.0\", \"lib\", \"net6.0\", \"System.Collections.Immutable.dll\"));\n\t\tLoadAssembly(Path.Combine(NuGetPackagesFolder, \"microsoft.codeanalysis.workspaces.common\", \"3.11.0\", \"lib\", \"netcoreapp3.1\", \"Microsoft.CodeAnalysis.Workspaces.dll\"));\n\t\treturn LoadAssembly(Path.Combine(NuGetPackagesFolder, \"microsoft.visualstudio.threading.analyzers\", \"17.11.20\", \"analyzers\", \"cs\", \"Microsoft.VisualStudio.Threading.Analyzers.dll\"));\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/AssertsExtensions/EmptyException.cs",
    "content": "using System;\n\nnamespace Xunit.Sdk;\n\ninternal partial class EmptyException\n{\n\tpublic static EmptyException ForNamedNonEmptyCollection(\n\t\tstring collection,\n\t\tstring collectionName) =>\n\t\t\tnew(\n\t\t\t\t$\"Assert.Empty() Failure: Collection '{collectionName}' was not empty\" + Environment.NewLine +\n\t\t\t\t\"Collection: \" + collection\n\t\t\t);\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/AssertsExtensions/EqualException.cs",
    "content": "using System;\n\nnamespace Xunit.Sdk;\n\ninternal partial class EqualException\n{\n\tpublic static EqualException ForMismatchedValuesWithMessage(\n\t\tobject? expected,\n\t\tobject? actual,\n\t\tstring? message)\n\t{\n\t\tvar expectedText = expected as string ?? ArgumentFormatter.Format(expected);\n\t\tvar actualText = actual as string ?? ArgumentFormatter.Format(actual);\n\n\t\tif (string.IsNullOrWhiteSpace(message))\n\t\t\tmessage =\n\t\t\t\t\"Assert.Equal() Failure: Values differ\" + Environment.NewLine +\n\t\t\t\t\"Expected: \" + expectedText.Replace(Environment.NewLine, newLineAndIndent) + Environment.NewLine +\n\t\t\t\t\"Actual:   \" + actualText.Replace(Environment.NewLine, newLineAndIndent);\n\n\t\treturn new(message);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/AssertsExtensions/NotEmptyException.cs",
    "content": "namespace Xunit.Sdk;\n\ninternal partial class NotEmptyException\n{\n\tpublic static NotEmptyException ForNamedNonEmptyCollection(string collectionName) =>\n\t\tnew($\"Assert.NotEmpty() Failure: Collection '{collectionName}' was empty\");\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.Analyzers.RunnerUtility.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Testing;\n\npublic partial class CSharpVerifier<TAnalyzer>\n{\n\t// ----- Multi-version -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzerRunnerUtility(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2RunnerUtility(LanguageVersion.CSharp6, [source], diagnostics);\n\t\tawait VerifyAnalyzerV3RunnerUtility(LanguageVersion.CSharp6, [source], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3 Runner Utility, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzerRunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2RunnerUtility(languageVersion, [source], diagnostics);\n\t\tawait VerifyAnalyzerV3RunnerUtility(languageVersion, [source], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzerRunnerUtility(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2RunnerUtility(LanguageVersion.CSharp6, sources, diagnostics);\n\t\tawait VerifyAnalyzerV3RunnerUtility(LanguageVersion.CSharp6, sources, diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3 Runner Utility, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzerRunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2RunnerUtility(languageVersion, sources, diagnostics);\n\t\tawait VerifyAnalyzerV3RunnerUtility(languageVersion, sources, diagnostics);\n\t}\n\n\t// ----- v2 -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2RunnerUtility(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2RunnerUtility(LanguageVersion.CSharp6, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2RunnerUtility(languageVersion, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2RunnerUtility(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2RunnerUtility(LanguageVersion.CSharp6, sources, diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV2RunnerUtility(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- v3 -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3RunnerUtility(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3RunnerUtility(LanguageVersion.CSharp6, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3 Runner Utility, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3RunnerUtility(languageVersion, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3RunnerUtility(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3RunnerUtility(LanguageVersion.CSharp6, sources, diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3 Runner Utility, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV3RunnerUtility(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.Analyzers.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Testing;\n\npublic partial class CSharpVerifier<TAnalyzer>\n{\n\t// ----- Multi-version -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzer(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2(LanguageVersion.CSharp6, [source], diagnostics);\n\t\tawait VerifyAnalyzerV3(LanguageVersion.CSharp6, [source], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzer(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2(languageVersion, [source], diagnostics);\n\t\tawait VerifyAnalyzerV3(languageVersion, [source], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzer(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2(LanguageVersion.CSharp6, sources, diagnostics);\n\t\tawait VerifyAnalyzerV3(LanguageVersion.CSharp6, sources, diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2 and v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static async Task VerifyAnalyzer(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyAnalyzerV2(languageVersion, sources, diagnostics);\n\t\tawait VerifyAnalyzerV3(languageVersion, sources, diagnostics);\n\t}\n\n\t// ----- v2 -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2(LanguageVersion.CSharp6, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2(languageVersion, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV2(LanguageVersion.CSharp6, sources, diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV2(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- v3 -----\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3(\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3(LanguageVersion.CSharp6, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3(languageVersion, [source], diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3(\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyAnalyzerV3(LanguageVersion.CSharp6, sources, diagnostics);\n\n\t/// <summary>\n\t/// Runs code for analysis, against xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">The expected diagnostics (pass none for code that\n\t/// should not trigger)</param>\n\tpublic static Task VerifyAnalyzerV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV3(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.CodeFixes.RunnerUtility.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Testing;\n\npublic partial class CSharpVerifier<TAnalyzer>\n{\n\t// ----- Multi-version -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 and v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static async Task VerifyCodeFixRunnerUtility(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyCodeFixV2RunnerUtility(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\t\tawait VerifyCodeFixV3RunnerUtility(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 and v3 Runner Utility, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static async Task VerifyCodeFixRunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyCodeFixV2RunnerUtility(languageVersion, before, after, fixerActionKey, diagnostics);\n\t\tawait VerifyCodeFixV3RunnerUtility(languageVersion, before, after, fixerActionKey, diagnostics);\n\t}\n\n\t// ----- v2 -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV2RunnerUtility(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyCodeFixV2RunnerUtility(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 Runner Utility, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV2RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV2RunnerUtility(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tFixedCode = after.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- v3 -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v3 Runner Utility, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV3RunnerUtility(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyCodeFixV3RunnerUtility(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v3 Runner Utility, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV3RunnerUtility(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV3RunnerUtility(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tFixedCode = after.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.CodeFixes.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Formatting;\nusing Microsoft.CodeAnalysis.Testing;\n\npublic partial class CSharpVerifier<TAnalyzer>\n{\n\t// ----- Fix All -----\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v2 and v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static async Task VerifyCodeFixFixAll(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey)\n\t{\n\t\tawait VerifyCodeFixV2FixAll(LanguageVersion.CSharp6, before, after, fixerActionKey);\n\t\tawait VerifyCodeFixV3FixAll(LanguageVersion.CSharp6, before, after, fixerActionKey);\n\t}\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v2 and v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static async Task VerifyCodeFixFixAll(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey)\n\t{\n\t\tawait VerifyCodeFixV2FixAll(languageVersion, before, after, fixerActionKey);\n\t\tawait VerifyCodeFixV3FixAll(languageVersion, before, after, fixerActionKey);\n\t}\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v2, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static Task VerifyCodeFixV2FixAll(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey) =>\n\t\t\tVerifyCodeFixV2FixAll(LanguageVersion.CSharp6, before, after, fixerActionKey);\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static Task VerifyCodeFixV2FixAll(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV2(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.FixedState.Sources.Add(after.Replace(\"\\n\", newLine));\n\t\ttest.BatchFixedState.Sources.Add(after.Replace(\"\\n\", newLine));\n\t\treturn test.RunAsync();\n\t}\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static Task VerifyCodeFixV3FixAll(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey) =>\n\t\t\tVerifyCodeFixV3FixAll(LanguageVersion.CSharp6, before, after, fixerActionKey);\n\n\t/// <summary>\n\t/// Verify that \"Fix All\" correctly applies fixes to all diagnostics in a document.\n\t/// Runs against xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix (should contain multiple diagnostics)</param>\n\t/// <param name=\"after\">The expected code after all fixes are applied</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\tpublic static Task VerifyCodeFixV3FixAll(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV3(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.FixedState.Sources.Add(after.Replace(\"\\n\", newLine));\n\t\ttest.BatchFixedState.Sources.Add(after.Replace(\"\\n\", newLine));\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- Multi-version -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 and v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static async Task VerifyCodeFix(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyCodeFixV2(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\t\tawait VerifyCodeFixV3(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2 and v3, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static async Task VerifyCodeFix(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyCodeFixV2(languageVersion, before, after, fixerActionKey, diagnostics);\n\t\tawait VerifyCodeFixV3(languageVersion, before, after, fixerActionKey, diagnostics);\n\t}\n\n\t// ----- v2 -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV2(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyCodeFixV2(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v2, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV2(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tFixedCode = after.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- v3 -----\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV3(\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifyCodeFixV3(LanguageVersion.CSharp6, before, after, fixerActionKey, diagnostics);\n\n\t/// <summary>\n\t/// Verify that a code fix has been applied. Runs against xUnit.net v3, using the\n\t/// provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"before\">The code before the fix</param>\n\t/// <param name=\"after\">The expected code after the fix</param>\n\t/// <param name=\"fixerActionKey\">The key of the fix to run</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the fix</param>\n\tpublic static Task VerifyCodeFixV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring before,\n\t\tstring after,\n\t\tstring fixerActionKey,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar newLine = FormattingOptions.NewLine.DefaultValue;\n\t\tvar test = new TestV3(languageVersion)\n\t\t{\n\t\t\tTestCode = before.Replace(\"\\n\", newLine),\n\t\t\tFixedCode = after.Replace(\"\\n\", newLine),\n\t\t\tCodeActionEquivalenceKey = fixerActionKey,\n\t\t};\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\treturn test.RunAsync();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.Suppressors.cs",
    "content": "using System.Threading.Tasks;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Testing;\n\npublic partial class CSharpVerifier<TAnalyzer>\n{\n\t// ----- Multi-version -----\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v2 and v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static async Task VerifySuppressor(\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifySuppressorV2(LanguageVersion.CSharp6, [source], [suppressedAnalyzer], diagnostics);\n\t\tawait VerifySuppressorV3(LanguageVersion.CSharp6, [source], [suppressedAnalyzer], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v2 and v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static async Task VerifySuppressor(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifySuppressorV2(languageVersion, [source], [suppressedAnalyzer], diagnostics);\n\t\tawait VerifySuppressorV3(languageVersion, [source], [suppressedAnalyzer], diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress one or more other analyzers. Runs against\n\t/// xUnit.net v2 and v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzers\">The analyzer(s) that are expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static async Task VerifySuppressor(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tDiagnosticAnalyzer[] suppressedAnalyzers,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifySuppressorV2(languageVersion, sources, suppressedAnalyzers, diagnostics);\n\t\tawait VerifySuppressorV3(languageVersion, sources, suppressedAnalyzers, diagnostics);\n\t}\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress a compiler warning. Runs against\n\t/// xUnit.net v2 and v3, using the provided version of C#. Sets CompilerDiagnostics\n\t/// to Warnings so that compiler warnings (like CS8618) are included in the analysis.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static async Task VerifyCompilerWarningSuppressor(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tawait VerifyCompilerWarningSuppressorV2(languageVersion, sources, diagnostics);\n\t\tawait VerifyCompilerWarningSuppressorV3(languageVersion, sources, diagnostics);\n\t}\n\n\t// ----- v2 -----\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v2, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV2(\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifySuppressorV2(LanguageVersion.CSharp6, [source], [suppressedAnalyzer], diagnostics);\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifySuppressorV2(languageVersion, [source], [suppressedAnalyzer], diagnostics);\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress one or more other analyzers. Runs against\n\t/// xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzers\">The analyzer(s) that are expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tDiagnosticAnalyzer[] suppressedAnalyzers,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV2(languageVersion);\n\n\t\tforeach (var suppressedAnalyzer in suppressedAnalyzers)\n\t\t\ttest.AddDiagnosticAnalyzer(suppressedAnalyzer);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\ttest.TestState.OutputKind = OutputKind.ConsoleApplication;\n\t\ttest.TestState.Sources.Add(\"internal class Program { public static void Main() { } }\");\n\t\treturn test.RunAsync();\n\t}\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress a compiler warning. Runs against\n\t/// xUnit.net v2, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifyCompilerWarningSuppressorV2(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV2(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.CompilerDiagnostics = CompilerDiagnostics.Warnings;\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\ttest.TestState.OutputKind = OutputKind.ConsoleApplication;\n\t\ttest.TestState.Sources.Add(\"internal class Program { public static void Main() { } }\");\n\t\ttest.SolutionTransforms.Add((solution, projectId) =>\n\t\t{\n\t\t\tvar project = solution.GetProject(projectId)!;\n\t\t\tvar compilationOptions = project.CompilationOptions!;\n\t\t\tcompilationOptions = compilationOptions.WithSpecificDiagnosticOptions(\n\t\t\t\tcompilationOptions.SpecificDiagnosticOptions.SetItem(\"CS1701\", ReportDiagnostic.Suppress)\n\t\t\t);\n\t\t\treturn solution.WithProjectCompilationOptions(projectId, compilationOptions);\n\t\t});\n\t\treturn test.RunAsync();\n\t}\n\n\t// ----- v3 -----\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v3, using C# 6.\n\t/// </summary>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV3(\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifySuppressorV3(LanguageVersion.CSharp6, [source], [suppressedAnalyzer], diagnostics);\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress another analyzers. Runs against\n\t/// xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"source\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzer\">The analyzer that is expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring source,\n\t\tDiagnosticAnalyzer suppressedAnalyzer,\n\t\tparams DiagnosticResult[] diagnostics) =>\n\t\t\tVerifySuppressorV3(languageVersion, [source], [suppressedAnalyzer], diagnostics);\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress one or more other analyzers. Runs against\n\t/// xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"suppressedAnalyzers\">The analyzer(s) that are expected to be suppressed</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifySuppressorV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tDiagnosticAnalyzer[] suppressedAnalyzers,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV3(languageVersion);\n\n\t\tforeach (var suppressedAnalyzer in suppressedAnalyzers)\n\t\t\ttest.AddDiagnosticAnalyzer(suppressedAnalyzer);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\ttest.TestState.OutputKind = OutputKind.ConsoleApplication;\n\t\ttest.TestState.Sources.Add(\"internal class Program { public static void Main() { } }\");\n\t\treturn test.RunAsync();\n\t}\n\n\t/// <summary>\n\t/// Verify that an analyzer was used to suppress a compiler warning. Runs against\n\t/// xUnit.net v3, using the provided version of C#.\n\t/// </summary>\n\t/// <param name=\"languageVersion\">The language version to compile with</param>\n\t/// <param name=\"sources\">The code to verify</param>\n\t/// <param name=\"diagnostics\">Any expected diagnostics that still exist after the suppression</param>\n\tpublic static Task VerifyCompilerWarningSuppressorV3(\n\t\tLanguageVersion languageVersion,\n\t\tstring[] sources,\n\t\tparams DiagnosticResult[] diagnostics)\n\t{\n\t\tvar test = new TestV3(languageVersion);\n\n\t\tforeach (var source in sources)\n\t\t\ttest.TestState.Sources.Add(source);\n\n\t\ttest.CompilerDiagnostics = CompilerDiagnostics.Warnings;\n\t\ttest.TestState.ExpectedDiagnostics.AddRange(diagnostics);\n\t\ttest.TestState.OutputKind = OutputKind.ConsoleApplication;\n\t\ttest.TestState.Sources.Add(\"internal class Program { public static void Main() { } }\");\n\t\treturn test.RunAsync();\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CSharpVerifier.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Testing;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing Microsoft.CodeAnalysis.Testing;\nusing Microsoft.CodeAnalysis.Testing.Verifiers;\nusing Microsoft.CodeAnalysis.Text;\n\npublic partial class CSharpVerifier<TAnalyzer>\n\twhere TAnalyzer : DiagnosticAnalyzer, new()\n{\n\t/// <summary>\n\t/// Creates a diagnostic result for the diagnostic referenced in <typeparamref name=\"TAnalyzer\"/>.\n\t/// </summary>\n\tpublic static DiagnosticResult Diagnostic() =>\n\t\tCSharpCodeFixVerifier<TAnalyzer, EmptyCodeFixProvider, XunitVerifier>.Diagnostic();\n\n\t/// <summary>\n\t/// Creates a diagnostic result for the given diagnostic ID.\n\t/// </summary>\n\t/// <param name=\"diagnosticId\">The diagnostic ID</param>\n\tpublic static DiagnosticResult Diagnostic(string diagnosticId) =>\n\t\tCSharpCodeFixVerifier<TAnalyzer, EmptyCodeFixProvider, XunitVerifier>.Diagnostic(diagnosticId);\n\n\t/// <summary>\n\t/// Creates a diagnostic result for an expected compiler error.\n\t/// </summary>\n\t/// <param name=\"errorIdentifier\">The compiler error code (e.g., CS0619)</param>\n\tpublic static DiagnosticResult CompilerError(string errorIdentifier) =>\n\t\tnew(errorIdentifier, DiagnosticSeverity.Error);\n\n\tclass TestBase<TVerifier> : CSharpCodeFixTest<TAnalyzer, EmptyCodeFixProvider, TVerifier>\n\t\twhere TVerifier : XunitVerifier, new()\n\t{\n\t\tList<DiagnosticAnalyzer> additionalDiagnosticAnalyzers = new();\n\n\t\tprotected TestBase(\n\t\t\tLanguageVersion languageVersion,\n\t\t\tReferenceAssemblies referenceAssemblies)\n\t\t{\n\t\t\tLanguageVersion = languageVersion;\n\t\t\tReferenceAssemblies = referenceAssemblies;\n\n\t\t\t// Ensure all fixed source matches the inline source (tabs, not spaces)\n\t\t\tTestState.AnalyzerConfigFiles.Add(\n\t\t\t\t(\n\t\t\t\t\t\"/.editorconfig\",\n\t\t\t\t\tSourceText.From(\"\"\"\n\t\t\t\t\t\t[*]\n\t\t\t\t\t\tindent_style = tab\n\t\t\t\t\t\t\"\"\")\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Diagnostics are reported in both normal and generated code\n\t\t\tTestBehaviors |= TestBehaviors.SkipGeneratedCodeCheck;\n\n\t\t\t// Tests that check for messages should run independent of current system culture.\n\t\t\tCultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;\n\t\t}\n\n\t\tpublic LanguageVersion LanguageVersion { get; }\n\n\t\tpublic void AddDiagnosticAnalyzer(DiagnosticAnalyzer analyzer) =>\n\t\t\tadditionalDiagnosticAnalyzers.Add(analyzer);\n\n\t\tprotected override IEnumerable<CodeFixProvider> GetCodeFixProviders()\n\t\t{\n\t\t\tvar analyzer = new TAnalyzer();\n\n\t\t\tforeach (var provider in CodeFixProviderDiscovery.GetCodeFixProviders(Language))\n\t\t\t\tif (analyzer.SupportedDiagnostics.Any(diagnostic => provider.FixableDiagnosticIds.Contains(diagnostic.Id)))\n\t\t\t\t\tyield return provider;\n\t\t}\n\n\t\tprotected override IEnumerable<DiagnosticAnalyzer> GetDiagnosticAnalyzers()\n\t\t{\n\t\t\tyield return new TAnalyzer();\n\n\t\t\tforeach (var diagnosticAnalyzer in additionalDiagnosticAnalyzers)\n\t\t\t\tyield return diagnosticAnalyzer;\n\t\t}\n\n\t\tprotected override ParseOptions CreateParseOptions() =>\n\t\t\tnew CSharpParseOptions(LanguageVersion, DocumentationMode.Diagnose);\n\t}\n\n\tclass TestV2 : TestBase<XunitVerifierV2>\n\t{\n\t\tpublic TestV2(LanguageVersion languageVersion) :\n\t\t\tbase(languageVersion, CodeAnalyzerHelper.CurrentXunitV2)\n\t\t{ }\n\t}\n\n\tclass TestV2RunnerUtility : TestBase<XunitVerifierV2>\n\t{\n\t\tpublic TestV2RunnerUtility(LanguageVersion languageVersion) :\n\t\t\tbase(languageVersion, CodeAnalyzerHelper.CurrentXunitV2RunnerUtility)\n\t\t{ }\n\t}\n\n\tclass TestV3 : TestBase<XunitVerifierV3>\n\t{\n\t\tpublic TestV3(LanguageVersion languageVersion) :\n\t\t\tbase(languageVersion, CodeAnalyzerHelper.CurrentXunitV3)\n\t\t{ }\n\t}\n\n\tclass TestV3RunnerUtility : TestBase<XunitVerifierV3>\n\t{\n\t\tpublic TestV3RunnerUtility(LanguageVersion languageVersion) :\n\t\t\tbase(languageVersion, CodeAnalyzerHelper.CurrentXunitV3RunnerUtility)\n\t\t{ }\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CodeAnalyzerHelper.cs",
    "content": "using System.Collections.Immutable;\nusing Microsoft.CodeAnalysis.Testing;\n\n#if !NET472\nusing System.IO;\n#endif\n\nstatic class CodeAnalyzerHelper\n{\n\tpublic static readonly ReferenceAssemblies CurrentXunitV2;\n\n\tpublic static readonly ReferenceAssemblies CurrentXunitV2RunnerUtility;\n\n\tpublic static readonly ReferenceAssemblies CurrentXunitV3;\n\n\tpublic static readonly ReferenceAssemblies CurrentXunitV3RunnerUtility;\n\n\t// When changing any references here, make sure to update xunit.analyzers.tests.csproj.\n\t// We either need a direct reference (like xunit.core) or a package download (like everything else)\n\t// in order for this list to work most efficiently.\n\tstatic CodeAnalyzerHelper()\n\t{\n#if NET472\n\t\tvar defaultAssemblies = ReferenceAssemblies.NetFramework.Net472.Default;\n#else\n\t\t// Can't use ReferenceAssemblies.Net.Net80 because it's too new for Microsoft.CodeAnalysis 3.11.0\n\t\tvar defaultAssemblies =\n\t\t\tnew ReferenceAssemblies(\n\t\t\t\t\"net8.0\",\n\t\t\t\tnew PackageIdentity(\"Microsoft.NETCore.App.Ref\", \"8.0.10\"),\n\t\t\t\tPath.Combine(\"ref\", \"net8.0\")\n\t\t\t);\n#endif\n\n\t\tCurrentXunitV2 = defaultAssemblies.AddPackages(\n\t\t\tImmutableArray.Create(\n\t\t\t\tnew PackageIdentity(\"Microsoft.Bcl.AsyncInterfaces\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"Microsoft.Extensions.Primitives\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Collections.Immutable\", \"1.6.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Threading.Tasks.Extensions\", \"4.5.4\"),\n\t\t\t\tnew PackageIdentity(\"xunit.abstractions\", \"2.0.3\"),\n\t\t\t\tnew PackageIdentity(\"xunit.assert\", \"2.9.3-pre.4\"),\n\t\t\t\tnew PackageIdentity(\"xunit.core\", \"2.9.3-pre.4\")\n\t\t\t)\n\t\t);\n\n\t\tCurrentXunitV2RunnerUtility = defaultAssemblies.AddPackages(\n\t\t\tImmutableArray.Create(\n\t\t\t\tnew PackageIdentity(\"Microsoft.Bcl.AsyncInterfaces\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"Microsoft.Extensions.Primitives\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Collections.Immutable\", \"1.6.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Threading.Tasks.Extensions\", \"4.5.4\"),\n\t\t\t\tnew PackageIdentity(\"xunit.abstractions\", \"2.0.3\"),\n\t\t\t\tnew PackageIdentity(\"xunit.runner.utility\", \"2.9.3-pre.4\")\n\t\t\t)\n\t\t);\n\n\t\tCurrentXunitV3 = defaultAssemblies.AddPackages(\n\t\t\tImmutableArray.Create(\n\t\t\t\tnew PackageIdentity(\"Microsoft.Bcl.AsyncInterfaces\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"Microsoft.Extensions.Primitives\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Threading.Tasks.Extensions\", \"4.5.4\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.assert\", \"3.2.2-pre.18\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.common\", \"3.2.2-pre.18\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.extensibility.core\", \"3.2.2-pre.18\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.runner.common\", \"3.2.2-pre.18\")\n\t\t\t)\n\t\t);\n\n\t\tCurrentXunitV3RunnerUtility = defaultAssemblies.AddPackages(\n\t\t\tImmutableArray.Create(\n\t\t\t\tnew PackageIdentity(\"Microsoft.Bcl.AsyncInterfaces\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"Microsoft.Extensions.Primitives\", \"6.0.0\"),\n\t\t\t\tnew PackageIdentity(\"System.Threading.Tasks.Extensions\", \"4.5.4\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.common\", \"3.2.2-pre.18\"),\n\t\t\t\tnew PackageIdentity(\"xunit.v3.runner.utility\", \"3.2.2-pre.18\")\n\t\t\t)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/CodeFixProviderDiscovery.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.CodeAnalysis.CodeFixes;\nusing Microsoft.VisualStudio.Composition;\nusing Xunit.Analyzers.Fixes;\n\nstatic class CodeFixProviderDiscovery\n{\n\tstatic readonly Lazy<IExportProviderFactory> ExportProviderFactory;\n\n\tstatic CodeFixProviderDiscovery()\n\t{\n\t\tExportProviderFactory = new Lazy<IExportProviderFactory>(\n\t\t\t() =>\n\t\t\t{\n\t\t\t\tvar discovery = new AttributedPartDiscovery(Resolver.DefaultInstance, isNonPublicSupported: true);\n\t\t\t\tvar parts = Task.Run(() => discovery.CreatePartsAsync(typeof(CodeAnalysisExtensions).Assembly)).GetAwaiter().GetResult();\n\t\t\t\tvar catalog = ComposableCatalog.Create(Resolver.DefaultInstance).AddParts(parts);\n\n\t\t\t\tvar configuration = CompositionConfiguration.Create(catalog);\n\t\t\t\tvar runtimeComposition = RuntimeComposition.CreateRuntimeComposition(configuration);\n\t\t\t\treturn runtimeComposition.CreateExportProviderFactory();\n\t\t\t},\n\t\t\tLazyThreadSafetyMode.ExecutionAndPublication\n\t\t);\n\t}\n\n\tpublic static IEnumerable<CodeFixProvider> GetCodeFixProviders(string language)\n\t{\n\t\tvar exportProvider = ExportProviderFactory.Value.CreateExportProvider();\n\t\tvar exports = exportProvider.GetExports<CodeFixProvider, LanguageMetadata>();\n\n\t\treturn exports.Where(export => export.Metadata.Languages.Contains(language)).Select(export => export.Value);\n\t}\n\n\tclass LanguageMetadata\n\t{\n\t\tpublic LanguageMetadata(IDictionary<string, object> data)\n\t\t{\n\t\t\tif (!data.TryGetValue(nameof(ExportCodeFixProviderAttribute.Languages), out var languages))\n\t\t\t\tlanguages = new string[0];\n\n\t\t\tLanguages = ((string[])languages).ToImmutableArray();\n\t\t}\n\n\t\tpublic ImmutableArray<string> Languages { get; }\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/XunitVerifier.cs",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing Xunit;\nusing Xunit.Sdk;\n\nnamespace Microsoft.CodeAnalysis.Testing.Verifiers;\n\npublic class XunitVerifier : IVerifier\n{\n\tpublic XunitVerifier() :\n\t\tthis(ImmutableStack<string>.Empty)\n\t{ }\n\n\tprotected XunitVerifier(ImmutableStack<string> context) =>\n\t\tContext = context ?? throw new ArgumentNullException(nameof(context));\n\n\tprotected ImmutableStack<string> Context { get; }\n\n\tprotected virtual string CreateMessage(string? message)\n\t{\n\t\tforeach (var frame in Context)\n\t\t\tmessage = \"Context: \" + frame + Environment.NewLine + message;\n\n\t\treturn message ?? string.Empty;\n\t}\n\n\tvoid IVerifier.Empty<T>(\n\t\tstring collectionName,\n\t\tIEnumerable<T> collection)\n\t{\n\t\tvar tracker = CollectionTracker<T>.Wrap(collection);\n\t\tusing var enumerator = tracker.GetEnumerator();\n\n\t\tif (enumerator.MoveNext())\n\t\t\tthrow EmptyException.ForNamedNonEmptyCollection(tracker.FormatStart(), collectionName);\n\t}\n\n\tvoid IVerifier.Equal<T>(\n\t\tT expected,\n\t\tT actual,\n\t\tstring? message)\n\t{\n\t\tif (EqualityComparer<T>.Default.Equals(expected, actual))\n\t\t\treturn;\n\n\t\tif (message is null && Context.IsEmpty)\n\t\t\tthrow EqualException.ForMismatchedValues(ArgumentFormatter.Format(expected), ArgumentFormatter.Format(actual));\n\t\telse\n\t\t\tthrow EqualException.ForMismatchedValuesWithMessage(expected, actual, CreateMessage(message));\n\t}\n\n\t[DoesNotReturn]\n\tvoid IVerifier.Fail(string? message) =>\n\t\tAssert.Fail(message is null ? \"<no message provided>\" : CreateMessage(message));\n\n\tvoid IVerifier.False(\n\t\t[DoesNotReturnIf(true)] bool assert,\n\t\tstring? message)\n\t{\n\t\tif (message is null && Context.IsEmpty)\n\t\t\tAssert.False(assert);\n\t\telse\n\t\t\tAssert.False(assert, CreateMessage(message));\n\t}\n\n\tvoid IVerifier.LanguageIsSupported(string language) =>\n\t\tAssert.False(language != LanguageNames.CSharp && language != LanguageNames.VisualBasic, CreateMessage($\"Unsupported Language: '{language}'\"));\n\n\tvoid IVerifier.NotEmpty<T>(\n\t\tstring collectionName,\n\t\tIEnumerable<T> collection)\n\t{\n\t\tusing var enumerator = collection.GetEnumerator();\n\n\t\tif (!enumerator.MoveNext())\n\t\t\tthrow NotEmptyException.ForNamedNonEmptyCollection(collectionName);\n\t}\n\n\tIVerifier IVerifier.PushContext(string context)\n\t{\n\t\tAssert.IsAssignableFrom<XunitVerifier>(this);\n\n\t\treturn new XunitVerifier(Context.Push(context));\n\t}\n\n\tvoid IVerifier.SequenceEqual<T>(\n\t\tIEnumerable<T> expected,\n\t\tIEnumerable<T> actual,\n\t\tIEqualityComparer<T>? equalityComparer,\n\t\tstring? message)\n\t{\n\t\tvar comparer = new SequenceEqualEnumerableEqualityComparer<T>(equalityComparer);\n\t\tvar areEqual = comparer.Equals(expected, actual);\n\n\t\tif (!areEqual)\n\t\t\tthrow EqualException.ForMismatchedValuesWithMessage(expected, actual, CreateMessage(message));\n\t}\n\n\tvoid IVerifier.True(\n\t\t[DoesNotReturnIf(false)] bool assert,\n\t\tstring? message)\n\t{\n\t\tif (message is null && Context.IsEmpty)\n\t\t\tAssert.True(assert);\n\t\telse\n\t\t\tAssert.True(assert, CreateMessage(message));\n\t}\n\n\tsealed class SequenceEqualEnumerableEqualityComparer<T> : IEqualityComparer<IEnumerable<T>?>\n\t{\n\t\treadonly IEqualityComparer<T> itemEqualityComparer;\n\n\t\tpublic SequenceEqualEnumerableEqualityComparer(IEqualityComparer<T>? itemEqualityComparer) =>\n\t\t\tthis.itemEqualityComparer = itemEqualityComparer ?? EqualityComparer<T>.Default;\n\n\t\tpublic bool Equals(IEnumerable<T>? x, IEnumerable<T>? y)\n\t\t{\n\t\t\tif (ReferenceEquals(x, y))\n\t\t\t\treturn true;\n\n\t\t\tif (x is null || y is null)\n\t\t\t\treturn false;\n\n\t\t\treturn x.SequenceEqual(y, itemEqualityComparer);\n\t\t}\n\n\t\tpublic int GetHashCode(IEnumerable<T>? obj)\n\t\t{\n\t\t\tif (obj is null)\n\t\t\t\treturn 0;\n\n\t\t\t// From System.Tuple\n\t\t\t//\n\t\t\t// The suppression is required due to an invalid contract in IEqualityComparer<T>\n\t\t\t// https://github.com/dotnet/runtime/issues/30998\n\t\t\treturn obj\n\t\t\t\t.Select(item => itemEqualityComparer.GetHashCode(item!))\n\t\t\t\t.Aggregate(\n\t\t\t\t\t0,\n\t\t\t\t\t(aggHash, nextHash) => ((aggHash << 5) + aggHash) ^ nextHash\n\t\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/XunitVerifierV2.cs",
    "content": "using System.Collections.Immutable;\n\nnamespace Microsoft.CodeAnalysis.Testing.Verifiers;\n\npublic class XunitVerifierV2 : XunitVerifier\n{\n\tpublic XunitVerifierV2() :\n\t\tbase(ImmutableStack.Create(\"Testing against xUnit.net v2\"))\n\t{ }\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/Utility/XunitVerifierV3.cs",
    "content": "using System.Collections.Immutable;\n\nnamespace Microsoft.CodeAnalysis.Testing.Verifiers;\n\npublic class XunitVerifierV3 : XunitVerifier\n{\n\tpublic XunitVerifierV3() :\n\t\tbase(ImmutableStack.Create(\"Testing against xUnit.net v3\"))\n\t{ }\n}\n"
  },
  {
    "path": "src/xunit.analyzers.tests/xunit.analyzers.tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <AssemblyName>xunit.analyzers.tests.$(TargetFramework)</AssemblyName>\n    <OutputType>Exe</OutputType>\n    <PackageId>xunit.analyzers.tests</PackageId>\n    <RootNamespace>Xunit.Analyzers</RootNamespace>\n    <TargetFrameworks>net8.0;net472</TargetFrameworks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!-- Download packages referenced by CodeAnalyzerHelper -->\n    <PackageDownload Include=\"Microsoft.Bcl.AsyncInterfaces\" Version=\"[6.0.0]\" />\n    <PackageDownload Include=\"Microsoft.Extensions.Primitives\" Version=\"[6.0.0]\" />\n    <PackageDownload Include=\"System.Collections.Immutable\" Version=\"[1.6.0]\" Condition=\" '$(TargetFramework)' == 'net472' \" />\n    <PackageDownload Include=\"System.Threading.Tasks.Extensions\" Version=\"[4.5.4]\" />\n\n    <PackageDownload Include=\"xunit.abstractions\" Version=\"[2.0.3]\" />\n    <PackageDownload Include=\"xunit.assert\" Version=\"[2.9.3-pre.4]\" />\n    <PackageDownload Include=\"xunit.core\" Version=\"[2.9.3-pre.4]\" />\n    <PackageDownload Include=\"xunit.extensibility.core\" Version=\"[2.9.3-pre.4]\" />\n    <PackageDownload Include=\"xunit.extensibility.execution\" Version=\"[2.9.3-pre.4]\" />\n    <PackageDownload Include=\"xunit.runner.utility\" Version=\"[2.9.3-pre.4]\" />\n\n    <PackageDownload Include=\"xunit.v3.assert\" Version=\"[3.2.2-pre.18]\" />\n    <PackageDownload Include=\"xunit.v3.common\" Version=\"[3.2.2-pre.18]\" />\n    <PackageDownload Include=\"xunit.v3.extensibility.core\" Version=\"[3.2.2-pre.18]\" />\n    <PackageDownload Include=\"xunit.v3.runner.common\" Version=\"[3.2.2-pre.18]\" />\n    <PackageDownload Include=\"xunit.v3.runner.utility\" Version=\"[3.2.2-pre.18]\" />\n\n    <!-- Download packages referenced by CodeAnalysisNetAnalyzers -->\n    <PackageDownload Include=\"Microsoft.CodeAnalysis.NetAnalyzers\" Version=\"[10.0.100]\" />\n    <PackageDownload Include=\"Microsoft.CodeAnalysis.Workspaces.Common\" Version=\"[3.11.0]\" />\n\n    <!-- Download packages referenced by VsThreadingAnalyzers -->\n    <PackageDownload Include=\"Microsoft.VisualStudio.Threading.Analyzers\" Version=\"[17.11.20]\" />\n    <PackageDownload Include=\"System.Collections.Immutable\" Version=\"[6.0.0]\" Condition=\" '$(TargetFramework)' == 'net8.0' \" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\xunit.analyzers\\xunit.analyzers.csproj\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"true\" />\n    <ProjectReference Include=\"..\\xunit.analyzers.fixes\\xunit.analyzers.fixes.csproj\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"true\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/xunit.analyzers.tests/xunit.runner.json",
    "content": "{\n\t\"$schema\": \"https://xUnit.net/schema/current/xunit.runner.schema.json\",\n  \"diagnosticMessages\": true,\n  \"parallelizeAssembly\": true,\n  \"parallelizeTestCollections\": true,\n\t\"shadowCopy\": false\n}\n"
  },
  {
    "path": "tools/SignClient/appsettings.json",
    "content": "{\n\t\"SignClient\": {\n\t\t\"AzureAd\": {\n\t\t\t\"AADInstance\": \"https://login.microsoftonline.com/\",\n\t\t\t\"ClientId\": \"c248d68a-ba6f-4aa9-8a68-71fe872063f8\",\n\t\t\t\"TenantId\": \"16076fdc-fcc1-4a15-b1ca-32c9a255900e\"\n\t\t},\n\t\t\"Service\": {\n\t\t\t\"Url\": \"https://codesign.dotnetfoundation.org/\",\n\t\t\t\"ResourceId\": \"https://SignService/3c30251f-36f3-490b-a955-520addb85001\"\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "tools/builder/.vscode/launch.json",
    "content": "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": []\n}\n"
  },
  {
    "path": "tools/builder/.vscode/settings.json",
    "content": "{\n\t\"cSpell.words\": [\n\t\t\"etailed\",\n\t\t\"inimal\",\n\t\t\"msbuild\",\n\t\t\"nbgv\",\n\t\t\"netfx\",\n\t\t\"nuget\",\n\t\t\"nupkg\",\n\t\t\"ormal\",\n\t\t\"uiet\"\n\t],\n\t\"files.exclude\": {\n\t\t\"**/.git\": true,\n\t\t\"**/.DS_Store\": true,\n\t\t\"**/bin\": true,\n\t\t\"**/obj\": true\n\t}\n}\n"
  },
  {
    "path": "tools/builder/.vscode/tasks.json",
    "content": "{\n\t\"version\": \"2.0.0\",\n\t\"tasks\": [\n\t\t{\n\t\t\t\"label\": \"Build (builder)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"build\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": \"$msCompile\"\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Build (analyzers)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"${workspaceRoot}\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"Build\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Unit test (analyzers, .NET Core)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"${workspaceRoot}\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"TestCore\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t},\n\t\t{\n\t\t\t\"label\": \"Unit test (analyzers, .NET Framework)\",\n\t\t\t\"type\": \"process\",\n\t\t\t\"command\": \"dotnet\",\n\t\t\t\"args\": [\n\t\t\t\t\"run\",\n\t\t\t\t\"--project\",\n\t\t\t\t\"${workspaceRoot}\",\n\t\t\t\t\"--no-launch-profile\",\n\t\t\t\t\"--\",\n\t\t\t\t\"TestFx\"\n\t\t\t],\n\t\t\t\"options\": {\n\t\t\t\t\"cwd\": \"${workspaceRoot}\"\n\t\t\t},\n\t\t\t\"group\": \"build\",\n\t\t\t\"presentation\": {\n\t\t\t\t\"focus\": true\n\t\t\t},\n\t\t\t\"problemMatcher\": []\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "tools/builder/Program.cs",
    "content": "using System.Threading.Tasks;\nusing McMaster.Extensions.CommandLineUtils;\nusing Xunit.BuildTools.Models;\n\nnamespace Xunit.BuildTools;\n\npublic class Program\n{\n\tpublic static Task<int> Main(string[] args)\n\t\t=> CommandLineApplication.ExecuteAsync<BuildContext>(args);\n}\n"
  },
  {
    "path": "tools/builder/build.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <Nullable>enable</Nullable>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net10.0</TargetFramework>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <!-- We may not be able to upgrade Bullseye easily because we are leveraging internal APIs -->\n    <PackageReference Include=\"Bullseye\" Version=\"[3.3.0]\" />\n    <PackageReference Include=\"McMaster.Extensions.CommandLineUtils\" Version=\"4.1.1\" />\n    <PackageReference Include=\"Microsoft.Security.Extensions\" Version=\"1.4.0\" />\n    <PackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.4\" />\n    <PackageReference Include=\"SimpleExec\" Version=\"12.0.0\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageDownload Include=\"xunit.v3.runner.console\" Version=\"[3.2.2-pre.18]\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tools/builder/models/BuildContext.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Xunit.BuildTools.Models;\n\npublic partial class BuildContext\n{\n\tstring? consoleRunner;\n\n\tpublic string ConsoleRunner =>\n\t\tconsoleRunner ?? throw new InvalidOperationException($\"Tried to retrieve unset {nameof(BuildContext)}.{nameof(ConsoleRunner)}\");\n\n\tpublic partial IReadOnlyList<string> GetSkippedAnalysisFolders() =>\n\t\tArray.Empty<string>();\n\n\tpartial void Initialize()\n\t{\n\t\tconsoleRunner = Path.Combine(NuGetPackageCachePath, \"xunit.v3.runner.console\", \"3.2.2-pre.18\", \"tools\", \"net472\", \"xunit.v3.runner.console.exe\");\n\t\tif (!File.Exists(consoleRunner))\n\t\t\tthrow new InvalidOperationException($\"Cannot find console runner at '{consoleRunner}'\");\n\t}\n}\n"
  },
  {
    "path": "tools/builder/targets/Build.cs",
    "content": "using System.IO;\nusing System.Threading.Tasks;\nusing Xunit.BuildTools.Models;\n\nnamespace Xunit.BuildTools.Targets;\n\npublic static partial class Build\n{\n\tpublic static partial async Task PerformBuild(BuildContext context)\n\t{\n\t\tcontext.BuildStep(\"Compiling binaries\");\n\n\t\tvar buildLog = Path.Combine(context.BuildArtifactsFolder, \"build.binlog\");\n\n\t\tawait context.Exec(\"dotnet\", $\"msbuild -nologo -maxCpuCount -restore:False -verbosity:{context.Verbosity} -property:Configuration={context.ConfigurationText} -binaryLogger:{buildLog}\");\n\t}\n}\n"
  },
  {
    "path": "tools/builder/targets/Packages.cs",
    "content": "using System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Xunit.BuildTools.Models;\n\nnamespace Xunit.BuildTools.Targets;\n\npublic static partial class Packages\n{\n\tpublic static async Task OnExecute(BuildContext context)\n\t{\n\t\tcontext.BuildStep(\"Creating NuGet packages\");\n\n\t\t// Clean up any existing packages to force re-packing\n\t\tvar packageFiles = Directory.GetFiles(context.PackageOutputFolder, \"*.nupkg\");\n\t\tforeach (var packageFile in packageFiles)\n\t\t\tFile.Delete(packageFile);\n\n\t\tawait context.Exec(\"dotnet\", $\"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {context.Verbosity} src/xunit.analyzers -p:NuspecFile=xunit.analyzers.nuspec -tl:off\");\n\t}\n}\n"
  },
  {
    "path": "tools/builder/targets/SignAssemblies.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Xunit.BuildTools.Models;\n\nnamespace Xunit.BuildTools.Targets;\n\npublic static partial class SignAssemblies\n{\n\tpublic static Task OnExecute(BuildContext context)\n\t{\n\t\t// Check early because we don't need to make copies or show the banner for non-signed scenarios\n\t\tif (!context.CanSign)\n\t\t\treturn Task.CompletedTask;\n\n\t\tcontext.BuildStep(\"Signing binaries\");\n\n\t\t// Note that any changes to .nuspec files means this list needs to be updated, and nuspec files should\n\t\t// always reference the original signed paths, and not dependency copies (i.e., xunit.v3.common.dll)\n\t\tvar binaries =\n\t\t\tnew[] {\n\t\t\t\tPath.Combine(context.BaseFolder, \"src\", \"xunit.analyzers\",       \"bin\", context.ConfigurationText, \"netstandard2.0\", \"xunit.analyzers.dll\"),\n\t\t\t\tPath.Combine(context.BaseFolder, \"src\", \"xunit.analyzers.fixes\", \"bin\", context.ConfigurationText, \"netstandard2.0\", \"xunit.analyzers.fixes.dll\"),\n\t\t\t}.Select(unsignedPath =>\n\t\t\t{\n\t\t\t\tvar unsignedFolder = Path.GetDirectoryName(unsignedPath) ?? throw new InvalidOperationException($\"Path '{unsignedPath}' did not have a folder\");\n\t\t\t\tvar signedFolder = Path.Combine(unsignedFolder, \"signed\");\n\t\t\t\tDirectory.CreateDirectory(signedFolder);\n\n\t\t\t\tvar signedPath = Path.Combine(signedFolder, Path.GetFileName(unsignedPath));\n\t\t\t\tFile.Copy(unsignedPath, signedPath, overwrite: true);\n\n\t\t\t\treturn signedPath;\n\t\t\t}).ToArray();\n\n\t\treturn context.SignFiles(context.BaseFolder, binaries);\n\t}\n}\n"
  },
  {
    "path": "tools/builder/targets/Test.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Xunit.BuildTools.Models;\n\nnamespace Xunit.BuildTools.Targets;\n\n[Target(\n\tBuildTarget.Test,\n\tBuildTarget.Build\n)]\npublic class Test\n{\n\tpublic static Task OnExecute(BuildContext context)\n\t{\n\t\tcontext.BuildStep(\"Running tests\");\n\n\t\tvar testDLLs =\n\t\t\tDirectory\n\t\t\t\t.GetFiles(Path.Join(context.BaseFolder, \"src\"), \"*.tests*.csproj\", SearchOption.AllDirectories)\n\t\t\t\t.Select(csproj => '\"' + Path.Combine(Path.GetDirectoryName(csproj)!, \"bin\", context.ConfigurationText, \"net8.0\", Path.GetFileNameWithoutExtension(csproj) + \".net8.0.dll\") + '\"');\n\n\t\tif (context.NeedMono)\n\t\t{\n\t\t\tcontext.WriteLineColor(ConsoleColor.Yellow, \"Skipping .NET Framework tests on Mono\");\n\t\t\tConsole.WriteLine();\n\t\t}\n\t\telse\n\t\t\ttestDLLs = testDLLs.Concat(\n\t\t\t\tDirectory\n\t\t\t\t\t.GetFiles(Path.Join(context.BaseFolder, \"src\"), \"*.tests*.csproj\", SearchOption.AllDirectories)\n\t\t\t\t\t.Select(csproj => '\"' + Path.Combine(Path.GetDirectoryName(csproj)!, \"bin\", context.ConfigurationText, \"net472\", Path.GetFileNameWithoutExtension(csproj) + \".net472.exe\") + '\"')\n\t\t\t);\n\n\n\t\treturn context.Exec(context.ConsoleRunner, $\"{string.Join(\" \", testDLLs)} -ctrf {Path.Join(context.TestOutputFolder, \"results.ctrf\")}\");\n\t}\n}\n"
  },
  {
    "path": "version.json",
    "content": "{\n  \"$schema\": \"https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json\",\n  \"version\": \"1.28.0-pre.{height}\",\n  \"nugetPackageVersion\": {\n    \"semVer\": 2\n  },\n  \"publicReleaseRefSpec\": [\n    \"^refs/heads/.*$\"\n  ]\n}\n"
  },
  {
    "path": "xunit.analyzers.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 17\r\nVisualStudioVersion = 17.4.33122.133\r\nMinimumVisualStudioVersion = 15.0.26124.0\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{3CAA9D63-0806-4CB1-8C32-AA8045E1F441}\"\r\n\tProjectSection(SolutionItems) = preProject\r\n\t\t.editorconfig = .editorconfig\r\n\t\tsrc\\Directory.Build.props = src\\Directory.Build.props\r\n\t\tsrc\\Directory.Build.targets = src\\Directory.Build.targets\r\n\t\tREADME.md = README.md\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers\", \"src\\xunit.analyzers\\xunit.analyzers.csproj\", \"{897D042D-2C87-412F-805E-2905A1A38C83}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers.fixes\", \"src\\xunit.analyzers.fixes\\xunit.analyzers.fixes.csproj\", \"{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers.tests\", \"src\\xunit.analyzers.tests\\xunit.analyzers.tests.csproj\", \"{58C228AC-60BB-4928-AE3A-282CDD2EA912}\"\r\nEndProject\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"compat\", \"compat\", \"{C4169EC8-5C1D-416C-82B2-B9084C8F9D77}\"\r\n\tProjectSection(SolutionItems) = preProject\r\n\t\tsrc\\compat\\Directory.Build.props = src\\compat\\Directory.Build.props\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers.latest\", \"src\\compat\\xunit.analyzers.latest\\xunit.analyzers.latest.csproj\", \"{ABFA42B0-3347-43C8-8D6B-13511DECED5F}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers.latest.fixes\", \"src\\compat\\xunit.analyzers.latest.fixes\\xunit.analyzers.latest.fixes.csproj\", \"{B3D3E63A-6E6E-4673-8C6A-25030BF24378}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"xunit.analyzers.latest.tests\", \"src\\compat\\xunit.analyzers.latest.tests\\xunit.analyzers.latest.tests.csproj\", \"{86C1AC30-64A1-47AD-83F1-D86E30D4DE20}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{897D042D-2C87-412F-805E-2905A1A38C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{897D042D-2C87-412F-805E-2905A1A38C83}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{897D042D-2C87-412F-805E-2905A1A38C83}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{897D042D-2C87-412F-805E-2905A1A38C83}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{58C228AC-60BB-4928-AE3A-282CDD2EA912}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{58C228AC-60BB-4928-AE3A-282CDD2EA912}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{58C228AC-60BB-4928-AE3A-282CDD2EA912}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{58C228AC-60BB-4928-AE3A-282CDD2EA912}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{ABFA42B0-3347-43C8-8D6B-13511DECED5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{ABFA42B0-3347-43C8-8D6B-13511DECED5F}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{ABFA42B0-3347-43C8-8D6B-13511DECED5F}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{ABFA42B0-3347-43C8-8D6B-13511DECED5F}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{B3D3E63A-6E6E-4673-8C6A-25030BF24378}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B3D3E63A-6E6E-4673-8C6A-25030BF24378}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B3D3E63A-6E6E-4673-8C6A-25030BF24378}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{B3D3E63A-6E6E-4673-8C6A-25030BF24378}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{86C1AC30-64A1-47AD-83F1-D86E30D4DE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{86C1AC30-64A1-47AD-83F1-D86E30D4DE20}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{86C1AC30-64A1-47AD-83F1-D86E30D4DE20}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{86C1AC30-64A1-47AD-83F1-D86E30D4DE20}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(NestedProjects) = preSolution\r\n\t\t{897D042D-2C87-412F-805E-2905A1A38C83} = {3CAA9D63-0806-4CB1-8C32-AA8045E1F441}\r\n\t\t{B8612BA7-3EC9-4D08-82D6-ABDBF73E6BF6} = {3CAA9D63-0806-4CB1-8C32-AA8045E1F441}\r\n\t\t{58C228AC-60BB-4928-AE3A-282CDD2EA912} = {3CAA9D63-0806-4CB1-8C32-AA8045E1F441}\r\n\t\t{C4169EC8-5C1D-416C-82B2-B9084C8F9D77} = {3CAA9D63-0806-4CB1-8C32-AA8045E1F441}\r\n\t\t{ABFA42B0-3347-43C8-8D6B-13511DECED5F} = {C4169EC8-5C1D-416C-82B2-B9084C8F9D77}\r\n\t\t{B3D3E63A-6E6E-4673-8C6A-25030BF24378} = {C4169EC8-5C1D-416C-82B2-B9084C8F9D77}\r\n\t\t{86C1AC30-64A1-47AD-83F1-D86E30D4DE20} = {C4169EC8-5C1D-416C-82B2-B9084C8F9D77}\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {601643AE-7617-4470-841B-56F1E8356D87}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  }
]