Skip to content

Commit 25b2294

Browse files
authored
Merge pull request #22137 from unoplatform/dev/youssef/gen-analyzers-tests
chore(deps): Avoid dependency on deprecated NuGet package
2 parents 3da63b9 + 00217e0 commit 25b2294

File tree

7 files changed

+8
-25
lines changed

7 files changed

+8
-25
lines changed

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyObjectGeneratorTests/Given_DependencyObjectGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.CodeAnalysis.CSharp.Syntax;
55
using Microsoft.CodeAnalysis.CSharp.Testing;
66
using Microsoft.CodeAnalysis.Testing;
7-
using Microsoft.CodeAnalysis.Testing.Verifiers;
87
using Microsoft.CodeAnalysis.Text;
98
using Uno.UI.SourceGenerators.DependencyObject;
109
using Uno.UI.SourceGenerators.Tests.Verifiers;

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/DependencyPropertyGeneratorTests/Given_DependencyPropertyGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.CodeAnalysis.Testing;
22
using Uno.UI.SourceGenerators.DependencyObject;
3-
using Microsoft.CodeAnalysis.Testing.Verifiers;
43
using Uno.UI.SourceGenerators.Tests.Verifiers;
54
using System.Collections.Immutable;
65
using Microsoft.VisualStudio.TestPlatform.ObjectModel;

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Uno.UI.SourceGenerators.Tests.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
<ImplicitUsings>enable</ImplicitUsings>
1212
<EnableAutomaticXamlPageInclusion>false</EnableAutomaticXamlPageInclusion>
1313
<OutputType>Exe</OutputType>
14-
<!-- To be able to get newer versions of Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.MSTest -->
15-
<!-- that are not yet published to NuGet.org -->
16-
<!-- The latest on NuGet.org doesn't have the fix from https://github.com/dotnet/roslyn-sdk/pull/988 -->
17-
<!-- which is very important for us -->
18-
<RestoreAdditionalProjectSources Condition="'$(UNO_UWP_BUILD)'=='false'">https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json</RestoreAdditionalProjectSources>
1914

2015
<!-- We need all the intermediate assemblies -->
2116
<DisablePrivateProjectReference>true</DisablePrivateProjectReference>
@@ -47,7 +42,7 @@
4742
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.13.0" />
4843
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="4.13.0" />
4944
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0" />
50-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.MSTest" Version="1.1.2" Condition="'$(UNO_UWP_BUILD)'=='false'" />
45+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2" Condition="'$(UNO_UWP_BUILD)'=='false'" />
5146
<PackageReference Include="AwesomeAssertions" />
5247
<PackageReference Include="CommunityToolkit.Mvvm" Condition="'$(UNO_UWP_BUILD)'=='false'" />
5348
<PackageReference Include="NuGet.Packaging" Version="6.3.4" />

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Verifiers/CSGenerator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.CodeAnalysis;
22
using Microsoft.CodeAnalysis.CSharp.Testing;
33
using Microsoft.CodeAnalysis.CSharp;
4-
using Microsoft.CodeAnalysis.Testing.Verifiers;
54
using Microsoft.CodeAnalysis.Testing;
65
using Microsoft.CodeAnalysis.Diagnostics;
76
using System.Collections.Immutable;
@@ -13,9 +12,7 @@ namespace Uno.UI.SourceGenerators.Tests.Verifiers
1312
public static partial class CSharpSourceGeneratorVerifier<TSourceGenerator>
1413
where TSourceGenerator : ISourceGenerator, new()
1514
{
16-
#pragma warning disable CS0618 // Type or member is obsolete
17-
public class Test : CSharpSourceGeneratorTest<TSourceGenerator, MSTestVerifier>
18-
#pragma warning restore CS0618 // Type or member is obsolete
15+
public class Test : CSharpSourceGeneratorTest<TSourceGenerator, DefaultVerifier>
1916
{
2017
public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.Default;
2118
public bool IgnoreAccessibility { get; set; }

src/Uno.Analyzers.Tests/Uno.Analyzers.Tests.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
<IsPackable>false</IsPackable>
99
<OutputType>Exe</OutputType>
1010
<CodeAnalysisVersionForAnalyzersTests>4.0.0</CodeAnalysisVersionForAnalyzersTests>
11-
12-
<!-- To be able to get newer versions of Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.MSTest -->
13-
<!-- that are not yet published to NuGet.org -->
14-
<!-- The latest on NuGet.org doesn't have the fix from https://github.com/dotnet/roslyn-sdk/pull/988 -->
15-
<!-- which is very important for us -->
16-
<RestoreAdditionalProjectSources>https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json</RestoreAdditionalProjectSources>
1711
</PropertyGroup>
1812

1913
<ItemGroup>
@@ -24,7 +18,7 @@
2418
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(CodeAnalysisVersionForAnalyzersTests)" />
2519
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(CodeAnalysisVersionForAnalyzersTests)" />
2620

27-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.MSTest" Version="1.1.2-beta1.23578.3" />
21+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
2822

2923
<PackageReference Include="NuGet.Packaging" Version="6.0.2" />
3024
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" />

src/Uno.Analyzers.Tests/Verifiers/CSCodeFix+Test.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.CodeAnalysis.CSharp;
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 Uno.Analyzers.Tests.Verifiers
1111
{
@@ -14,7 +14,7 @@ public static partial class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
1414
where TAnalyzer : DiagnosticAnalyzer, new()
1515
where TCodeFix : CodeFixProvider, new()
1616
{
17-
public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, MSTestVerifier>
17+
public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, DefaultVerifier>
1818
{
1919
public Test()
2020
{

src/Uno.Analyzers.Tests/Verifiers/CSCodeFix.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Microsoft.CodeAnalysis.CodeFixes;
44
using Microsoft.CodeAnalysis.CSharp.Testing;
55
using Microsoft.CodeAnalysis.Diagnostics;
6-
using Microsoft.CodeAnalysis.Testing.Verifiers;
76
using Microsoft.CodeAnalysis.Testing;
87
using Microsoft.CodeAnalysis;
98

@@ -16,15 +15,15 @@ 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, MSTestVerifier>.Diagnostic();
18+
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix>.Diagnostic();
2019

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

2524
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
2625
public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
27-
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, MSTestVerifier>.Diagnostic(descriptor);
26+
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix>.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)

0 commit comments

Comments
 (0)