diff --git a/DecoratorGenerator.UnitTests/CSharpSourceGeneratorVerifier.cs b/DecoratorGenerator.UnitTests/CSharpSourceGeneratorVerifier.cs index 446a57c..27020e2 100644 --- a/DecoratorGenerator.UnitTests/CSharpSourceGeneratorVerifier.cs +++ b/DecoratorGenerator.UnitTests/CSharpSourceGeneratorVerifier.cs @@ -1,21 +1,19 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; +using Microsoft.CodeAnalysis.Testing; using System.Collections.Immutable; namespace DecoratorGenerator.UnitTests; public static class CSharpSourceGeneratorVerifier where TSourceGenerator : ISourceGenerator, new() { - public class Test : CSharpSourceGeneratorTest + public class Test : CSharpSourceGeneratorTest { - public Test() - { + public Test() { } - protected override CompilationOptions CreateCompilationOptions() - { + protected override CompilationOptions CreateCompilationOptions() { var compilationOptions = base.CreateCompilationOptions(); return compilationOptions.WithSpecificDiagnosticOptions( compilationOptions.SpecificDiagnosticOptions.SetItems(GetNullableWarningsFromCompiler())); @@ -23,8 +21,7 @@ protected override CompilationOptions CreateCompilationOptions() public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.Default; - private static ImmutableDictionary GetNullableWarningsFromCompiler() - { + private static ImmutableDictionary GetNullableWarningsFromCompiler() { string[] args = { "/warnaserror:nullable" }; var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory); var nullableWarnings = commandLineArguments.CompilationOptions.SpecificDiagnosticOptions; @@ -32,8 +29,7 @@ private static ImmutableDictionary GetNullableWarnings return nullableWarnings; } - protected override ParseOptions CreateParseOptions() - { + protected override ParseOptions CreateParseOptions() { return ((CSharpParseOptions)base.CreateParseOptions()).WithLanguageVersion(LanguageVersion); } } diff --git a/DecoratorGenerator.UnitTests/DecoratorGenerator.UnitTests.csproj b/DecoratorGenerator.UnitTests/DecoratorGenerator.UnitTests.csproj index 3cf83c7..c690225 100644 --- a/DecoratorGenerator.UnitTests/DecoratorGenerator.UnitTests.csproj +++ b/DecoratorGenerator.UnitTests/DecoratorGenerator.UnitTests.csproj @@ -11,17 +11,20 @@ - + - - - + + + - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/DecoratorGenerator/DecoratorGenerator.csproj b/DecoratorGenerator/DecoratorGenerator.csproj index 9353a1b..9d9bd27 100644 --- a/DecoratorGenerator/DecoratorGenerator.csproj +++ b/DecoratorGenerator/DecoratorGenerator.csproj @@ -53,8 +53,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive