From 3700694f992362b2a0cd4faedfcb61ed011984e8 Mon Sep 17 00:00:00 2001 From: Jonathon Marolf Date: Tue, 24 Aug 2021 17:22:56 -0700 Subject: [PATCH] Fixup the analyzer tests --- Directory.Packages.props | 2 +- src/dotnet-format.csproj | 2 +- tests/Analyzers/AnalyzerAssemblyGenerator.cs | 12 ++++++------ tests/Formatters/AbstractFormatterTests.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b7f9fce044..06f1a9f5ef 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,7 +14,7 @@ - + diff --git a/src/dotnet-format.csproj b/src/dotnet-format.csproj index 0e3799f137..0890a977b1 100644 --- a/src/dotnet-format.csproj +++ b/src/dotnet-format.csproj @@ -1,7 +1,7 @@  - netcoreapp6.0 + net6.0 Exe 9.0 true diff --git a/tests/Analyzers/AnalyzerAssemblyGenerator.cs b/tests/Analyzers/AnalyzerAssemblyGenerator.cs index 382fffdf4c..423d191da9 100644 --- a/tests/Analyzers/AnalyzerAssemblyGenerator.cs +++ b/tests/Analyzers/AnalyzerAssemblyGenerator.cs @@ -25,14 +25,14 @@ private static async Task> GetReferencesAsync() { var references = new List() { - MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(ImmutableArray).Assembly.Location))), - MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(SharedAttribute).Assembly.Location))), - MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(CSharpCompilation).Assembly.Location))), - MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(DiagnosticAnalyzer).Assembly.Location))), - MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(CodeFixProvider).Assembly.Location))), + MetadataReference.CreateFromFile(typeof(ImmutableArray).Assembly.Location), + MetadataReference.CreateFromFile(typeof(SharedAttribute).Assembly.Location), + MetadataReference.CreateFromFile(typeof(CSharpCompilation).Assembly.Location), + MetadataReference.CreateFromFile(typeof(DiagnosticAnalyzer).Assembly.Location), + MetadataReference.CreateFromFile(typeof(CodeFixProvider).Assembly.Location), }; - var netcoreMetadataReferences = await ReferenceAssemblies.NetCore.NetCoreApp31.ResolveAsync(LanguageNames.CSharp, CancellationToken.None); + var netcoreMetadataReferences = await ReferenceAssemblies.Net.Net60.ResolveAsync(LanguageNames.CSharp, CancellationToken.None); references.AddRange(netcoreMetadataReferences.Where(reference => Path.GetFileName(reference.Display) != "System.Collections.Immutable.dll")); return references; diff --git a/tests/Formatters/AbstractFormatterTests.cs b/tests/Formatters/AbstractFormatterTests.cs index 4b63f36291..5b1fd4812f 100644 --- a/tests/Formatters/AbstractFormatterTests.cs +++ b/tests/Formatters/AbstractFormatterTests.cs @@ -70,7 +70,7 @@ static AbstractFormatterTest() protected AbstractFormatterTest() { - TestState = new SolutionState(DefaultFilePathPrefix, DefaultFileExt); + TestState = new SolutionState("Test", Language, DefaultFilePathPrefix, DefaultFileExt); } ///