Skip to content

Commit 1da2712

Browse files
authored
Update testing analyzers (dotnet#59516)
1 parent 1867e51 commit 1da2712

17 files changed

+55
-57
lines changed

eng/Dependencies.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ and are generated based on the last package release.
6666
<LatestPackageReference Include="Microsoft.Extensions.Diagnostics.Testing" />
6767
<LatestPackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
6868
<LatestPackageReference Include="Microsoft.Win32.Registry" />
69-
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
70-
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" />
69+
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
70+
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" />
7171
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" />
7272
<LatestPackageReference Include="Microsoft.OpenApi" />
7373
<LatestPackageReference Include="Microsoft.OpenApi.Readers" />

eng/SourceBuildPrebuiltBaseline.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<UsagePattern IdentityGlob="System.Composition.Runtime/*8.0.0*" />
1919
<UsagePattern IdentityGlob="System.Composition.TypedParts/*8.0.0*" />
2020
<UsagePattern IdentityGlob="System.Security.Cryptography.Pkcs/5.0.*" />
21+
<UsagePattern IdentityGlob="System.Security.Cryptography.Pkcs/6.0.*" />
2122

2223
<!-- These are what the analyzers are built against. They are overridden in full source build.
2324
It may be possible to generate SBRPs -->

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@
206206
<Uri>https://github.com/dotnet/runtime</Uri>
207207
<Sha>040cbe276907174316e2cc07b35814b3069874a6</Sha>
208208
</Dependency>
209+
<Dependency Name="System.Formats.Asn1" Version="10.0.0-alpha.1.24617.3">
210+
<Uri>https://github.com/dotnet/runtime</Uri>
211+
<Sha>040cbe276907174316e2cc07b35814b3069874a6</Sha>
212+
</Dependency>
209213
<Dependency Name="System.IO.Pipelines" Version="10.0.0-alpha.1.24617.3">
210214
<Uri>https://github.com/dotnet/runtime</Uri>
211215
<Sha>040cbe276907174316e2cc07b35814b3069874a6</Sha>

eng/Versions.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<SystemDiagnosticsDiagnosticSourceVersion>10.0.0-alpha.1.24617.3</SystemDiagnosticsDiagnosticSourceVersion>
118118
<SystemDiagnosticsEventLogVersion>10.0.0-alpha.1.24617.3</SystemDiagnosticsEventLogVersion>
119119
<SystemDirectoryServicesProtocolsVersion>10.0.0-alpha.1.24617.3</SystemDirectoryServicesProtocolsVersion>
120+
<SystemFormatsAsn1Version>10.0.0-alpha.1.24617.3</SystemFormatsAsn1Version>
120121
<SystemIOPipelinesVersion>10.0.0-alpha.1.24617.3</SystemIOPipelinesVersion>
121122
<SystemNetHttpJsonVersion>10.0.0-alpha.1.24617.3</SystemNetHttpJsonVersion>
122123
<SystemNetHttpWinHttpHandlerVersion>10.0.0-alpha.1.24617.3</SystemNetHttpWinHttpHandlerVersion>
@@ -208,7 +209,6 @@
208209
<MicrosoftExtensionsDiagnosticAdapterVersion>5.0.0-preview.3.20215.2</MicrosoftExtensionsDiagnosticAdapterVersion>
209210
<!-- Build tool dependencies -->
210211
<MicrosoftVSSDKBuildToolsVersion>15.9.3032</MicrosoftVSSDKBuildToolsVersion>
211-
<RepoTasksSystemSecurityCryptographyXmlVersion>8.0.0</RepoTasksSystemSecurityCryptographyXmlVersion>
212212
<!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
213213
<MicrosoftCSharpVersion>4.7.0</MicrosoftCSharpVersion>
214214
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
@@ -256,17 +256,17 @@
256256
-->
257257
<Analyzer_MicrosoftCodeAnalysisCSharpVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpVersion>
258258
<Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
259-
<!-- Pin the version of the M.CA dependencies that we utilize with a cutom version property $(MicrosoftCodeAnalysisVersion_LatestVS) to avoid automatically
259+
<!-- Pin the version of the M.CA dependencies that we utilize with a custom version property $(MicrosoftCodeAnalysisVersion_LatestVS) to avoid automatically
260260
consuming the newest version of the packages when using the $(MicrosoftCodeAnalysisCSharpVersion) properties in source-build. -->
261261
<MicrosoftCodeAnalysisVersion_LatestVS>4.13.0-3.24613.7</MicrosoftCodeAnalysisVersion_LatestVS>
262262
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.13.0-3.24613.7</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
263263
<MicrosoftCodeAnalysisCommonVersion>4.13.0-3.24613.7</MicrosoftCodeAnalysisCommonVersion>
264264
<MicrosoftCodeAnalysisCSharpVersion>4.13.0-3.24613.7</MicrosoftCodeAnalysisCSharpVersion>
265265
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.13.0-3.24613.7</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
266266
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
267-
<MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.24121.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
268-
<MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.24121.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
269-
<MicrosoftCodeAnalysisCSharpSourceGeneratorsTestingVersion>1.1.2-beta1.24121.1</MicrosoftCodeAnalysisCSharpSourceGeneratorsTestingVersion>
267+
<MicrosoftCodeAnalysisCSharpAnalyzerTestingVersion>1.1.2</MicrosoftCodeAnalysisCSharpAnalyzerTestingVersion>
268+
<MicrosoftCodeAnalysisCSharpCodeFixTestingVersion>1.1.2</MicrosoftCodeAnalysisCSharpCodeFixTestingVersion>
269+
<MicrosoftCodeAnalysisCSharpSourceGeneratorsTestingVersion>1.1.2</MicrosoftCodeAnalysisCSharpSourceGeneratorsTestingVersion>
270270
<MicrosoftCssParserVersion>1.0.0-20230414.1</MicrosoftCssParserVersion>
271271
<MicrosoftIdentityModelLoggingVersion>$(IdentityModelVersion)</MicrosoftIdentityModelLoggingVersion>
272272
<MicrosoftIdentityModelProtocolsOpenIdConnectVersion>$(IdentityModelVersion)</MicrosoftIdentityModelProtocolsOpenIdConnectVersion>

eng/tools/RepoTasks/RepoTasks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
3636
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />
3737
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" />
38-
<!-- Manually updated version from 6.0.0 to address CVE-2023-29331 -->
39-
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(RepoTasksSystemSecurityCryptographyXmlVersion)" />
38+
<!-- Manually updated version to address CVE-2024-38095 -->
39+
<PackageReference Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" />
4040
</ItemGroup>
4141

4242
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">

src/Analyzers/Analyzers/test/Microsoft.AspNetCore.Analyzers.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<ProjectReference Include="$(RepoRoot)src\Analyzers\Analyzers\src\Microsoft.AspNetCore.Analyzers.csproj" />
11-
<Reference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
11+
<Reference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
1212
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
1313
<Reference Include="Microsoft.Extensions.DependencyModel" />
1414

src/Analyzers/Analyzers/test/StartupCSharpAnalyzerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
using Microsoft.CodeAnalysis;
66
using Microsoft.CodeAnalysis.CSharp.Testing;
77
using Microsoft.CodeAnalysis.Diagnostics;
8-
using Microsoft.CodeAnalysis.Testing.Verifiers;
8+
using Microsoft.CodeAnalysis.Testing;
99

1010
namespace Microsoft.AspNetCore.Analyzers;
1111

12-
internal sealed class StartupCSharpAnalyzerTest : CSharpAnalyzerTest<StartupAnalyzer, XUnitVerifier>
12+
internal sealed class StartupCSharpAnalyzerTest : CSharpAnalyzerTest<StartupAnalyzer, DefaultVerifier>
1313
{
1414
public StartupCSharpAnalyzerTest(StartupAnalyzer analyzer, ImmutableArray<MetadataReference> metadataReferences)
1515
{

src/Framework/AspNetCoreAnalyzers/test/Microsoft.AspNetCore.App.Analyzers.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<Reference Include="Microsoft.AspNetCore.Mvc" />
2424
<Reference Include="Microsoft.AspNetCore.Http.Results" />
2525
<Reference Include="Microsoft.AspNetCore.RateLimiting" />
26-
<Reference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" />
27-
<Reference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
26+
<Reference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" />
27+
<Reference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
2828
<Reference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" />
2929
</ItemGroup>
3030

src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpAnalyzerVerifier.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Microsoft.CodeAnalysis.CSharp.Testing;
1010
using Microsoft.CodeAnalysis.Diagnostics;
1111
using Microsoft.CodeAnalysis.Testing;
12-
using Microsoft.CodeAnalysis.Testing.Verifiers;
1312
using Microsoft.Extensions.DependencyInjection;
1413
using Microsoft.AspNetCore.Hosting;
1514

@@ -20,20 +19,20 @@ public static partial class CSharpAnalyzerVerifier<TAnalyzer>
2019
{
2120
/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic()"/>
2221
public static DiagnosticResult Diagnostic()
23-
=> CSharpAnalyzerVerifier<TAnalyzer, XUnitVerifier>.Diagnostic();
22+
=> CSharpAnalyzerVerifier<TAnalyzer, DefaultVerifier>.Diagnostic();
2423

2524
/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(string)"/>
2625
public static DiagnosticResult Diagnostic(string diagnosticId)
27-
=> CSharpAnalyzerVerifier<TAnalyzer, XUnitVerifier>.Diagnostic(diagnosticId);
26+
=> CSharpAnalyzerVerifier<TAnalyzer, DefaultVerifier>.Diagnostic(diagnosticId);
2827

2928
/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
3029
public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
31-
=> CSharpAnalyzerVerifier<TAnalyzer, XUnitVerifier>.Diagnostic(descriptor);
30+
=> CSharpAnalyzerVerifier<TAnalyzer, DefaultVerifier>.Diagnostic(descriptor);
3231

3332
/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.VerifyAnalyzerAsync(string, DiagnosticResult[])"/>
3433
public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
3534
{
36-
var test = new CSharpAnalyzerTest<TAnalyzer, XUnitVerifier>
35+
var test = new CSharpAnalyzerTest<TAnalyzer, DefaultVerifier>
3736
{
3837
TestCode = source.ReplaceLineEndings(),
3938
// We need to set the output type to an exe to properly

src/Framework/AspNetCoreAnalyzers/test/Verifiers/CSharpCodeFixVerifier.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.CodeAnalysis.CSharp.Testing;
77
using Microsoft.CodeAnalysis.Diagnostics;
88
using Microsoft.CodeAnalysis.Testing;
9-
using Microsoft.CodeAnalysis.Testing.Verifiers;
109

1110
namespace Microsoft.AspNetCore.Analyzers.Verifiers;
1211

@@ -16,20 +15,20 @@ public static partial class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
1615
{
1716
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic()"/>
1817
public static DiagnosticResult Diagnostic()
19-
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, XUnitVerifier>.Diagnostic();
18+
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, DefaultVerifier>.Diagnostic();
2019

2120
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic(string)"/>
2221
public static DiagnosticResult Diagnostic(string diagnosticId)
23-
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, XUnitVerifier>.Diagnostic(diagnosticId);
22+
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, DefaultVerifier>.Diagnostic(diagnosticId);
2423

2524
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
2625
public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
27-
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, XUnitVerifier>.Diagnostic(descriptor);
26+
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, DefaultVerifier>.Diagnostic(descriptor);
2827

2928
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyAnalyzerAsync(string, DiagnosticResult[])"/>
3029
public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
3130
{
32-
var test = new CSharpCodeFixTest<TAnalyzer, TCodeFix, XUnitVerifier>
31+
var test = new CSharpCodeFixTest<TAnalyzer, TCodeFix, DefaultVerifier>
3332
{
3433
TestCode = source.ReplaceLineEndings(),
3534
// We need to set the output type to an exe to properly
@@ -54,7 +53,7 @@ public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expe
5453
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, DiagnosticResult[], string)"/>
5554
public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource, int? expectedIterations = null, string usageSource = null, string codeActionEquivalenceKey = null)
5655
{
57-
var test = new CSharpCodeFixTest<TAnalyzer, TCodeFix, XUnitVerifier>
56+
var test = new CSharpCodeFixTest<TAnalyzer, TCodeFix, DefaultVerifier>
5857
{
5958
// We need to set the output type to an exe to properly
6059
// support top-level programs in the tests. Otherwise,

0 commit comments

Comments
 (0)