diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b25460755..944cfc125 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,48 +8,6 @@ env: jobs: - ################################################### - # DOCS - ################################################### - - docs: - name: Documentation - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.npm - key: npm-${{ hashFiles('package-lock.json') }} - restore-keys: npm- - - - name: Build - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - cd docs - dotnet tool restore - dotnet run --configuration Release - - - name: Archive doc generation - uses: actions/upload-artifact@v3 - with: - name: documentation-output - path: docs/output/ - retention-days: 5 - ################################################### # BUILD ################################################### @@ -57,17 +15,7 @@ jobs: build: name: Build if: "!contains(github.event.head_commit.message, 'skip-ci')" - strategy: - matrix: - kind: ['linux', 'windows', 'macOS'] - include: - - kind: linux - os: ubuntu-latest - - kind: windows - os: windows-latest - - kind: macOS - os: macos-latest - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2c9301716..cf3ef0a26 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -15,26 +15,13 @@ env: jobs: ################################################### - # BUILD + # PUBLISH ################################################### build: - name: Build - if: | - (!startsWith(github.event.head_commit.message, 'skip-ci') - && !startsWith(github.event.head_commit.message, 'chore:')) - || startsWith(github.ref, 'refs/tags/') - strategy: - matrix: - kind: ['linux', 'windows', 'macOS'] - include: - - kind: linux - os: ubuntu-latest - - kind: windows - os: windows-latest - - kind: macOS - os: macos-latest - runs-on: ${{ matrix.os }} + name: Publish NuGet Packages + if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')" + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -43,12 +30,19 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x - - name: Build + - name: Publish shell: bash run: | dotnet tool restore - dotnet cake + dotnet cake --target="publish" \ + --nuget-key="${{secrets.NUGET_API_KEY}}" \ + --github-key="${{secrets.GITHUB_TOKEN}}" ################################################### # DOCS @@ -88,35 +82,4 @@ jobs: run: | cd docs dotnet tool restore - dotnet run --configuration Release -- deploy - - ################################################### - # PUBLISH - ################################################### - - publish: - name: Publish NuGet Packages - needs: [build] - if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - 8.0.x - - - name: Publish - shell: bash - run: | - dotnet tool restore - dotnet cake --target="publish" \ - --nuget-key="${{secrets.NUGET_API_KEY}}" \ - --github-key="${{secrets.GITHUB_TOKEN}}" \ No newline at end of file + dotnet run --configuration Release -- deploy \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 101a5cfd6..d618f4742 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ true - 10 + 12 true embedded true @@ -15,8 +15,8 @@ A library that makes it easier to create beautiful console applications. - Patrik Svensson, Phil Scott, Nils Andresen - Patrik Svensson, Phil Scott, Nils Andresen + Patrik Svensson, Phil Scott, Nils Andresen, Cédric Luthi, Frank Ray + Patrik Svensson, Phil Scott, Nils Andresen, Cédric Luthi, Frank Ray git https://github.com/spectreconsole/spectre.console small-logo.png @@ -33,12 +33,12 @@ - - - + + + All - + All diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 4b6ff935c..68be9d04f 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,7 +1,7 @@ - preview + preview.0 normal diff --git a/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj b/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj index de1f52c6f..9d8573175 100644 --- a/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj +++ b/src/Spectre.Console.Cli/Spectre.Console.Cli.csproj @@ -31,19 +31,19 @@ - - - True - True - HelpProvider.resx - + + + True + True + HelpProvider.resx + - - - ResXFileCodeGenerator - HelpProvider.Designer.cs - + + + ResXFileCodeGenerator + HelpProvider.Designer.cs + diff --git a/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj b/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj index 904415295..e6411ff32 100644 --- a/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj +++ b/src/Spectre.Console.ImageSharp/Spectre.Console.ImageSharp.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0;netstandard2.0 + net8.0;net7.0;net6.0 enable true A library that extends Spectre.Console with ImageSharp superpowers. @@ -13,7 +13,7 @@ - + diff --git a/src/Spectre.Console.Json/Spectre.Console.Json.csproj b/src/Spectre.Console.Json/Spectre.Console.Json.csproj index 26b9cf9fc..6c411ca0b 100644 --- a/src/Spectre.Console.Json/Spectre.Console.Json.csproj +++ b/src/Spectre.Console.Json/Spectre.Console.Json.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0;netstandard2.0 + net8.0;net7.0;net6.0 enable true true @@ -13,7 +13,7 @@ - + diff --git a/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj b/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj index 1cbacc9b9..3dd0bacd7 100644 --- a/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj +++ b/src/Spectre.Console.Testing/Spectre.Console.Testing.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0;netstandard2.0 + net8.0;net7.0;net6.0 false enable true diff --git a/src/Spectre.Console/Spectre.Console.csproj b/src/Spectre.Console/Spectre.Console.csproj index d6cb71a04..4805f895b 100644 --- a/src/Spectre.Console/Spectre.Console.csproj +++ b/src/Spectre.Console/Spectre.Console.csproj @@ -16,8 +16,8 @@ - - + + all diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 7d0d62ad7..dc84e5b85 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -6,10 +6,10 @@ - + All - + All diff --git a/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj b/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj index 06c6f4613..b33f08a2f 100644 --- a/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj +++ b/test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj @@ -13,9 +13,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoConcurrentLiveRenderablesTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoConcurrentLiveRenderablesTests.cs index 940bd09c4..423ba05fb 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoConcurrentLiveRenderablesTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoConcurrentLiveRenderablesTests.cs @@ -12,7 +12,7 @@ public async void Status_call_within_live_call_warns() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { void Go() { @@ -24,8 +24,7 @@ void Go() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13)); } [Fact] @@ -48,8 +47,7 @@ public void Go() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 13)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 13)); } [Fact] @@ -69,7 +67,6 @@ static void Main() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoPromptsDuringLiveRenderablesTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoPromptsDuringLiveRenderablesTests.cs index 1ddb9c9b6..c08e79ee2 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoPromptsDuringLiveRenderablesTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/NoPromptsDuringLiveRenderablesTests.cs @@ -12,7 +12,7 @@ public async Task Prompt_out_of_progress_does_not_warn() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { void Go() { @@ -21,8 +21,7 @@ void Go() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } [Fact] @@ -31,7 +30,7 @@ public async Task Instance_variables_warn() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { public IAnsiConsole _console = AnsiConsole.Console; @@ -45,8 +44,7 @@ public void Go() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 26)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 26)); } [Fact] @@ -55,7 +53,7 @@ public async Task Prompt_in_progress_warns() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { void Go() { @@ -67,8 +65,7 @@ void Go() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13)); } [Fact] @@ -92,7 +89,6 @@ static void Main() }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseInstanceAnsiConsoleTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseInstanceAnsiConsoleTests.cs index 08e75d060..684501923 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseInstanceAnsiConsoleTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseInstanceAnsiConsoleTests.cs @@ -24,8 +24,7 @@ public Foo(IAnsiConsole console = null) "; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } [Fact] @@ -34,19 +33,18 @@ public async void Instance_console_has_no_warnings() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { _ansiConsole.Write(""this is fine""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } [Fact] @@ -55,17 +53,16 @@ public async void Static_console_with_no_instance_variables_has_no_warnings() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { AnsiConsole.Write(""this is fine""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } [Fact] @@ -74,19 +71,18 @@ public async void Console_Write_Has_Warning() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { _ansiConsole.Write(""this is fine""); AnsiConsole.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(11, 9)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(11, 9)); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzerTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzerTests.cs index aebabbfa9..094315f0a 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzerTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Analyzers/UseSpectreInsteadOfSystemConsoleAnalyzerTests.cs @@ -13,15 +13,14 @@ public async void Non_configured_SystemConsole_methods_report_no_warnings() using System; class TestClass { - void TestMethod() + void TestMethod() { var s = Console.ReadLine(); - } + } }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source); } [Fact] @@ -31,15 +30,14 @@ public async void Console_Write_Has_Warning() using System; class TestClass { - void TestMethod() + void TestMethod() { Console.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9)); } [Fact] @@ -48,7 +46,7 @@ public async void Console_WriteLine_Has_Warning() const string Source = @" using System; -class TestClass +class TestClass { void TestMethod() { Console.WriteLine(""Hello, World""); @@ -56,7 +54,6 @@ class TestClass }"; await SpectreAnalyzerVerifier - .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9)) - .ConfigureAwait(false); + .VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9)); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseInstanceOfStaticAnsiConsoleTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseInstanceOfStaticAnsiConsoleTests.cs index c308eaf4a..34fc78596 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseInstanceOfStaticAnsiConsoleTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseInstanceOfStaticAnsiConsoleTests.cs @@ -12,34 +12,33 @@ public async Task Static_call_replaced_with_field_call() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { _ansiConsole.Write(""this is fine""); AnsiConsole.Write(""Hello, World""); - } + } }"; const string FixedSource = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { _ansiConsole.Write(""this is fine""); _ansiConsole.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource); } [Fact] @@ -48,38 +47,37 @@ public async Task Static_call_replaced_with_field_call_Should_Preserve_Trivia() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { var foo = 1; AnsiConsole.Write(""this is fine""); _ansiConsole.Write(""Hello, World""); - } + } }"; const string FixedSource = @" using Spectre.Console; -class TestClass +class TestClass { - IAnsiConsole _ansiConsole = AnsiConsole.Console; + IAnsiConsole _ansiConsole = AnsiConsole.Console; - void TestMethod() + void TestMethod() { var foo = 1; _ansiConsole.Write(""this is fine""); _ansiConsole.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(12, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(12, 9), FixedSource); } [Fact] @@ -88,28 +86,27 @@ public async Task Static_call_replaced_with_parameter_call() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { - void TestMethod(IAnsiConsole ansiConsole) + void TestMethod(IAnsiConsole ansiConsole) { AnsiConsole.Write(""Hello, World""); - } + } }"; const string FixedSource = @" using Spectre.Console; -class TestClass +class TestClass { - void TestMethod(IAnsiConsole ansiConsole) + void TestMethod(IAnsiConsole ansiConsole) { ansiConsole.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource); } [Fact] @@ -118,33 +115,32 @@ public async Task Static_call_replaced_with_static_field_if_valid() const string Source = @" using Spectre.Console; -class TestClass +class TestClass { static IAnsiConsole staticConsole; IAnsiConsole instanceConsole; - static void TestMethod() + static void TestMethod() { AnsiConsole.Write(""Hello, World""); - } + } }"; const string FixedSource = @" using Spectre.Console; -class TestClass +class TestClass { static IAnsiConsole staticConsole; IAnsiConsole instanceConsole; - static void TestMethod() + static void TestMethod() { staticConsole.Write(""Hello, World""); - } + } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource); } } diff --git a/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseSpectreInsteadOfSystemConsoleFixTests.cs b/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseSpectreInsteadOfSystemConsoleFixTests.cs index d6b0aaf70..b0eadad67 100644 --- a/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseSpectreInsteadOfSystemConsoleFixTests.cs +++ b/test/Spectre.Console.Analyzer.Tests/Unit/Fixes/UseSpectreInsteadOfSystemConsoleFixTests.cs @@ -12,9 +12,9 @@ public async Task SystemConsole_replaced_with_AnsiConsole() const string Source = @" using System; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { Console.WriteLine(""Hello, World""); } @@ -24,17 +24,16 @@ void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { AnsiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource); } [Fact] @@ -43,9 +42,9 @@ public async Task SystemConsole_replaced_with_imported_AnsiConsole() const string Source = @" using System; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { Console.WriteLine(""Hello, World""); } @@ -55,17 +54,16 @@ void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { AnsiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource); } [Fact] @@ -75,11 +73,11 @@ public async Task SystemConsole_replaced_with_field_AnsiConsole() using System; using Spectre.Console; -class TestClass +class TestClass { IAnsiConsole _ansiConsole; - void TestMethod() + void TestMethod() { Console.WriteLine(""Hello, World""); } @@ -89,19 +87,18 @@ void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { IAnsiConsole _ansiConsole; - void TestMethod() + void TestMethod() { _ansiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource); } [Fact] @@ -111,9 +108,9 @@ public async Task SystemConsole_replaced_with_local_variable_AnsiConsole() using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { IAnsiConsole ansiConsole = null; Console.WriteLine(""Hello, World""); @@ -124,9 +121,9 @@ void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { IAnsiConsole ansiConsole = null; ansiConsole.WriteLine(""Hello, World""); @@ -134,8 +131,7 @@ void TestMethod() }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(10, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(10, 9), FixedSource); } [Fact] @@ -145,9 +141,9 @@ public async Task SystemConsole_not_replaced_with_local_variable_declared_after_ using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { Console.WriteLine(""Hello, World""); IAnsiConsole ansiConsole; @@ -158,9 +154,9 @@ void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - void TestMethod() + void TestMethod() { AnsiConsole.WriteLine(""Hello, World""); IAnsiConsole ansiConsole; @@ -168,8 +164,7 @@ void TestMethod() }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(9, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(9, 9), FixedSource); } [Fact] @@ -179,11 +174,11 @@ public async Task SystemConsole_replaced_with_static_field_AnsiConsole() using System; using Spectre.Console; -class TestClass +class TestClass { static IAnsiConsole _ansiConsole; - static void TestMethod() + static void TestMethod() { Console.WriteLine(""Hello, World""); } @@ -193,19 +188,18 @@ static void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { static IAnsiConsole _ansiConsole; - static void TestMethod() + static void TestMethod() { _ansiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource); } [Fact] @@ -215,11 +209,11 @@ public async Task SystemConsole_replaced_with_AnsiConsole_when_field_is_not_stat using System; using Spectre.Console; -class TestClass +class TestClass { IAnsiConsole _ansiConsole; - static void TestMethod() + static void TestMethod() { Console.WriteLine(""Hello, World""); } @@ -229,19 +223,18 @@ static void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { IAnsiConsole _ansiConsole; - static void TestMethod() + static void TestMethod() { AnsiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource); } [Fact] @@ -251,9 +244,9 @@ public async Task SystemConsole_replaced_with_AnsiConsole_from_local_function_pa using System; using Spectre.Console; -class TestClass +class TestClass { - static void TestMethod() + static void TestMethod() { static void LocalFunction(IAnsiConsole ansiConsole) => Console.WriteLine(""Hello, World""); } @@ -263,17 +256,16 @@ static void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - static void TestMethod() + static void TestMethod() { static void LocalFunction(IAnsiConsole ansiConsole) => ansiConsole.WriteLine(""Hello, World""); } }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(9, 64), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(9, 64), FixedSource); } [Fact] @@ -283,9 +275,9 @@ public async Task SystemConsole_do_not_use_variable_from_parent_method_in_static using System; using Spectre.Console; -class TestClass +class TestClass { - static void TestMethod() + static void TestMethod() { IAnsiConsole ansiConsole = null; static void LocalFunction() => Console.WriteLine(""Hello, World""); @@ -296,9 +288,9 @@ static void TestMethod() using System; using Spectre.Console; -class TestClass +class TestClass { - static void TestMethod() + static void TestMethod() { IAnsiConsole ansiConsole = null; static void LocalFunction() => AnsiConsole.WriteLine(""Hello, World""); @@ -306,8 +298,7 @@ static void TestMethod() }"; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(10, 40), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(10, 40), FixedSource); } [Fact] @@ -327,7 +318,7 @@ public async Task SystemConsole_replaced_with_AnsiConsole_in_top_level_statement "; await SpectreAnalyzerVerifier - .VerifyCodeFixAsync(Source, OutputKind.ConsoleApplication, _expectedDiagnostic.WithLocation(4, 1), FixedSource) - .ConfigureAwait(false); + .VerifyCodeFixAsync(Source, OutputKind.ConsoleApplication, _expectedDiagnostic.WithLocation(4, 1), + FixedSource); } } diff --git a/test/Spectre.Console.Cli.Tests/Data/Commands/AnimalCommand.cs b/test/Spectre.Console.Cli.Tests/Data/Commands/AnimalCommand.cs index 0419ec681..dceaa35ba 100644 --- a/test/Spectre.Console.Cli.Tests/Data/Commands/AnimalCommand.cs +++ b/test/Spectre.Console.Cli.Tests/Data/Commands/AnimalCommand.cs @@ -5,41 +5,4 @@ namespace Spectre.Console.Tests.Data; public abstract class AnimalCommand : Command where TSettings : CommandSettings { - protected void DumpSettings(CommandContext context, TSettings settings) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - if (settings == null) - { - throw new ArgumentNullException(nameof(settings)); - } - - var properties = settings.GetType().GetProperties(); - foreach (var group in properties.GroupBy(x => x.DeclaringType).Reverse()) - { - SystemConsole.WriteLine(); - SystemConsole.ForegroundColor = ConsoleColor.Yellow; - SystemConsole.WriteLine(group.Key.FullName); - SystemConsole.ResetColor(); - - foreach (var property in group) - { - SystemConsole.WriteLine($" {property.Name} = {property.GetValue(settings)}"); - } - } - - if (context.Remaining.Raw.Count > 0) - { - SystemConsole.WriteLine(); - SystemConsole.ForegroundColor = ConsoleColor.Yellow; - SystemConsole.WriteLine("Remaining:"); - SystemConsole.ResetColor(); - SystemConsole.WriteLine(string.Join(", ", context.Remaining)); - } - - SystemConsole.WriteLine(); - } } diff --git a/test/Spectre.Console.Cli.Tests/Data/Commands/CatCommand.cs b/test/Spectre.Console.Cli.Tests/Data/Commands/CatCommand.cs index 7e756e7cf..ab0a6afa8 100644 --- a/test/Spectre.Console.Cli.Tests/Data/Commands/CatCommand.cs +++ b/test/Spectre.Console.Cli.Tests/Data/Commands/CatCommand.cs @@ -4,7 +4,6 @@ public class CatCommand : AnimalCommand { public override int Execute(CommandContext context, CatSettings settings) { - DumpSettings(context, settings); return 0; } } diff --git a/test/Spectre.Console.Cli.Tests/Data/Commands/DogCommand.cs b/test/Spectre.Console.Cli.Tests/Data/Commands/DogCommand.cs index 3b6ed6927..1bb5e3ea1 100644 --- a/test/Spectre.Console.Cli.Tests/Data/Commands/DogCommand.cs +++ b/test/Spectre.Console.Cli.Tests/Data/Commands/DogCommand.cs @@ -25,7 +25,6 @@ public override ValidationResult Validate(CommandContext context, DogSettings se public override int Execute(CommandContext context, DogSettings settings) { - DumpSettings(context, settings); return 0; } } diff --git a/test/Spectre.Console.Cli.Tests/Data/Commands/HorseCommand.cs b/test/Spectre.Console.Cli.Tests/Data/Commands/HorseCommand.cs index e352a092b..148999cdc 100644 --- a/test/Spectre.Console.Cli.Tests/Data/Commands/HorseCommand.cs +++ b/test/Spectre.Console.Cli.Tests/Data/Commands/HorseCommand.cs @@ -5,7 +5,6 @@ public class HorseCommand : AnimalCommand { public override int Execute(CommandContext context, HorseSettings settings) { - DumpSettings(context, settings); return 0; } } diff --git a/test/Spectre.Console.Cli.Tests/Data/Commands/TurtleCommand.cs b/test/Spectre.Console.Cli.Tests/Data/Commands/TurtleCommand.cs index 30159b517..0b99327b3 100644 --- a/test/Spectre.Console.Cli.Tests/Data/Commands/TurtleCommand.cs +++ b/test/Spectre.Console.Cli.Tests/Data/Commands/TurtleCommand.cs @@ -5,7 +5,6 @@ public class TurtleCommand : AnimalCommand { public override int Execute(CommandContext context, TurtleSettings settings) { - DumpSettings(context, settings); return 0; } } diff --git a/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj b/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj index 537f557a6..1ff4569e6 100644 --- a/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj +++ b/test/Spectre.Console.Cli.Tests/Spectre.Console.Cli.Tests.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0 + net8.0;net7.0;net6.0 @@ -9,15 +9,16 @@ - + - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandArgumentAttributeTests.Rendering.cs b/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandArgumentAttributeTests.Rendering.cs index 500f7f6e6..6a5efde60 100644 --- a/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandArgumentAttributeTests.Rendering.cs +++ b/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandArgumentAttributeTests.Rendering.cs @@ -3,7 +3,6 @@ namespace Spectre.Console.Tests.Unit.Cli.Annotations; [ExpectationPath("Arguments")] public sealed partial class CommandArgumentAttributeTests { - [UsesVerify] public sealed class ArgumentCannotContainOptions { public sealed class Settings : CommandSettings @@ -24,7 +23,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class MultipleValuesAreNotSupported { public sealed class Settings : CommandSettings @@ -45,7 +43,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class ValuesMustHaveName { public sealed class Settings : CommandSettings diff --git a/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandOptionAttributeTests.Rendering.cs b/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandOptionAttributeTests.Rendering.cs index a17e7ae9b..5358993ff 100644 --- a/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandOptionAttributeTests.Rendering.cs +++ b/test/Spectre.Console.Cli.Tests/Unit/Annotations/CommandOptionAttributeTests.Rendering.cs @@ -3,7 +3,6 @@ namespace Spectre.Console.Tests.Unit.Cli.Annotations; [ExpectationPath("Arguments")] public sealed partial class CommandOptionAttributeTests { - [UsesVerify] public sealed class UnexpectedCharacter { public sealed class Settings : CommandSettings @@ -25,7 +24,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class UnterminatedValueName { public sealed class Settings : CommandSettings @@ -47,7 +45,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class OptionsMustHaveName { public sealed class Settings : CommandSettings @@ -69,7 +66,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class OptionNamesCannotStartWithDigit { public sealed class Settings : CommandSettings @@ -91,7 +87,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class InvalidCharacterInOptionName { public sealed class Settings : CommandSettings @@ -113,7 +108,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class LongOptionMustHaveMoreThanOneCharacter { public sealed class Settings : CommandSettings @@ -135,7 +129,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class ShortOptionMustOnlyBeOneCharacter { public sealed class Settings : CommandSettings @@ -157,7 +150,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class MultipleOptionValuesAreNotSupported { public sealed class Settings : CommandSettings @@ -179,7 +171,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class InvalidCharacterInValueName { public sealed class Settings : CommandSettings @@ -201,7 +192,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] public sealed class MissingLongAndShortName { public sealed class Settings : CommandSettings diff --git a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Help.cs b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Help.cs index 82621630d..f176b9e17 100644 --- a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Help.cs +++ b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Help.cs @@ -4,7 +4,6 @@ namespace Spectre.Console.Tests.Unit.Cli; public sealed partial class CommandAppTests { - [UsesVerify] [ExpectationPath("Help")] public class Help { diff --git a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Parsing.cs b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Parsing.cs index f06b56431..d7f6fa078 100644 --- a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Parsing.cs +++ b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Parsing.cs @@ -2,11 +2,9 @@ namespace Spectre.Console.Tests.Unit.Cli; public sealed partial class CommandAppTests { - [UsesVerify] [ExpectationPath("Parsing")] public sealed class Parsing { - [UsesVerify] [ExpectationPath("UnknownCommand")] public sealed class UnknownCommand { @@ -167,7 +165,6 @@ public Task Should_Return_Correct_Text_With_Suggestion_When_Command_After_Argume } } - [UsesVerify] [ExpectationPath("CannotAssignValueToFlag")] public sealed class CannotAssignValueToFlag { @@ -208,7 +205,6 @@ public Task Should_Return_Correct_Text_For_Short_Option() } } - [UsesVerify] [ExpectationPath("NoValueForOption")] public sealed class NoValueForOption { @@ -249,7 +245,6 @@ public Task Should_Return_Correct_Text_For_Short_Option() } } - [UsesVerify] [ExpectationPath("NoMatchingArgument")] public sealed class NoMatchingArgument { @@ -272,7 +267,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] [ExpectationPath("UnexpectedOption")] public sealed class UnexpectedOption { @@ -313,7 +307,6 @@ public Task Should_Return_Correct_Text_For_Short_Option() } } - [UsesVerify] [ExpectationPath("UnknownOption")] public sealed class UnknownOption { @@ -356,7 +349,6 @@ public Task Should_Return_Correct_Text_For_Short_Option_If_Strict_Mode_Is_Enable } } - [UsesVerify] [ExpectationPath("OptionWithoutName")] public sealed class OptionWithoutName { @@ -451,7 +443,6 @@ public Task Should_Return_Correct_Text_For_Missing_Short_Option_Value_With_Colon } } - [UsesVerify] [ExpectationPath("InvalidShortOptionName")] public sealed class InvalidShortOptionName { @@ -474,7 +465,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] [ExpectationPath("LongOptionNameIsOneCharacter")] public sealed class LongOptionNameIsOneCharacter { @@ -497,7 +487,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] [ExpectationPath("LongOptionNameIsMissing")] public sealed class LongOptionNameIsMissing { @@ -520,7 +509,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] [ExpectationPath("LongOptionNameStartWithDigit")] public sealed class LongOptionNameStartWithDigit { @@ -543,7 +531,6 @@ public Task Should_Return_Correct_Text() } } - [UsesVerify] [ExpectationPath("LongOptionNameContainSymbol")] public sealed class LongOptionNameContainSymbol { diff --git a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Xml.cs b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Xml.cs index a43e07d52..1ed1b4152 100644 --- a/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Xml.cs +++ b/test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.Xml.cs @@ -2,7 +2,6 @@ namespace Spectre.Console.Tests.Unit.Cli; public sealed partial class CommandAppTests { - [UsesVerify] [ExpectationPath("Xml")] public sealed class Xml { diff --git a/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj b/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj index aca2a4fe6..e199ee073 100644 --- a/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj +++ b/test/Spectre.Console.Tests/Spectre.Console.Tests.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0 + net8.0;net7.0;net6.0 @@ -18,15 +18,15 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Spectre.Console.Tests/Unit/AlternateScreenTests.cs b/test/Spectre.Console.Tests/Unit/AlternateScreenTests.cs index 696a9e7c1..841105ba1 100644 --- a/test/Spectre.Console.Tests/Unit/AlternateScreenTests.cs +++ b/test/Spectre.Console.Tests/Unit/AlternateScreenTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("AlternateScreen")] public sealed class AlternateScreenTests { diff --git a/test/Spectre.Console.Tests/Unit/ExceptionTests.cs b/test/Spectre.Console.Tests/Unit/ExceptionTests.cs index 5aa2b750d..a1c40dfa1 100644 --- a/test/Spectre.Console.Tests/Unit/ExceptionTests.cs +++ b/test/Spectre.Console.Tests/Unit/ExceptionTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Exception")] public sealed class ExceptionTests { diff --git a/test/Spectre.Console.Tests/Unit/Live/Progress/ProgressTests.cs b/test/Spectre.Console.Tests/Unit/Live/Progress/ProgressTests.cs index f42f38791..0f7d44fd7 100644 --- a/test/Spectre.Console.Tests/Unit/Live/Progress/ProgressTests.cs +++ b/test/Spectre.Console.Tests/Unit/Live/Progress/ProgressTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Live/Progress")] public sealed class ProgressTests { diff --git a/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs b/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs index dc4723dfe..b80c5d0d1 100644 --- a/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs +++ b/test/Spectre.Console.Tests/Unit/Live/StatusTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Live/Status")] public sealed class StatusTests { diff --git a/test/Spectre.Console.Tests/Unit/Prompts/TextPromptTests.cs b/test/Spectre.Console.Tests/Unit/Prompts/TextPromptTests.cs index ad79dc5c6..52d26e7d5 100644 --- a/test/Spectre.Console.Tests/Unit/Prompts/TextPromptTests.cs +++ b/test/Spectre.Console.Tests/Unit/Prompts/TextPromptTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Prompts/Text")] public sealed class TextPromptTests { diff --git a/test/Spectre.Console.Tests/Unit/RecorderTests.cs b/test/Spectre.Console.Tests/Unit/RecorderTests.cs index 798cbd691..a340b82c3 100644 --- a/test/Spectre.Console.Tests/Unit/RecorderTests.cs +++ b/test/Spectre.Console.Tests/Unit/RecorderTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Recorder")] public sealed class RecorderTests { diff --git a/test/Spectre.Console.Tests/Unit/Rendering/Borders/BoxBorderTests.cs b/test/Spectre.Console.Tests/Unit/Rendering/Borders/BoxBorderTests.cs index d9643cbf8..e66890a97 100644 --- a/test/Spectre.Console.Tests/Unit/Rendering/Borders/BoxBorderTests.cs +++ b/test/Spectre.Console.Tests/Unit/Rendering/Borders/BoxBorderTests.cs @@ -1,10 +1,8 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Rendering/Borders/Box")] public sealed class BoxBorderTests { - [UsesVerify] public sealed class NoBorder { public sealed class TheSafeGetBorderMethod @@ -52,7 +50,6 @@ public Task Should_Render_NoBorder_With_Header_As_Expected() } } - [UsesVerify] public sealed class AsciiBorder { public sealed class TheSafeGetBorderMethod @@ -84,7 +81,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class DoubleBorder { public sealed class TheSafeGetBorderMethod @@ -116,7 +112,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class HeavyBorder { public sealed class TheSafeGetBorderMethod @@ -148,7 +143,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class RoundedBorder { [Fact] @@ -177,7 +171,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class SquareBorder { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Rendering/Borders/TableBorderTests.cs b/test/Spectre.Console.Tests/Unit/Rendering/Borders/TableBorderTests.cs index a9177f2a6..beb1b089f 100644 --- a/test/Spectre.Console.Tests/Unit/Rendering/Borders/TableBorderTests.cs +++ b/test/Spectre.Console.Tests/Unit/Rendering/Borders/TableBorderTests.cs @@ -1,10 +1,8 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Rendering/Borders/Table")] public sealed class TableBorderTests { - [UsesVerify] public sealed class NoBorder { [Fact] @@ -46,7 +44,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class AsciiBorder { [Fact] @@ -88,7 +85,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class Ascii2Border { [Fact] @@ -130,7 +126,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class AsciiDoubleHeadBorder { [Fact] @@ -172,7 +167,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class SquareBorder { [Fact] @@ -214,7 +208,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class RoundedBorder { [Fact] @@ -256,7 +249,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class MinimalBorder { [Fact] @@ -298,7 +290,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class MinimalHeavyHeadBorder { [Fact] @@ -340,7 +331,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class MinimalDoubleHeadBorder { [Fact] @@ -382,7 +372,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class SimpleBorder { [Fact] @@ -424,7 +413,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class HorizontalBorder { [Fact] @@ -466,7 +454,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class SimpleHeavyBorder { [Fact] @@ -508,7 +495,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class HeavyBorder { [Fact] @@ -550,7 +536,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class HeavyEdgeBorder { [Fact] @@ -592,7 +577,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class HeavyHeadBorder { [Fact] @@ -634,7 +618,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class DoubleBorder { [Fact] @@ -676,7 +659,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class DoubleEdgeBorder { [Fact] @@ -718,7 +700,6 @@ public Task Should_Render_As_Expected() } } - [UsesVerify] public sealed class MarkdownBorder { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Rendering/SegmentTests.cs b/test/Spectre.Console.Tests/Unit/Rendering/SegmentTests.cs index 9d5eca814..94c36de24 100644 --- a/test/Spectre.Console.Tests/Unit/Rendering/SegmentTests.cs +++ b/test/Spectre.Console.Tests/Unit/Rendering/SegmentTests.cs @@ -2,7 +2,6 @@ namespace Spectre.Console.Tests.Unit; public sealed class SegmentTests { - [UsesVerify] public sealed class TheSplitMethod { [Theory] @@ -44,7 +43,6 @@ public void Should_Split_Segment_Correctly(string text, int offset, string expec } } - [UsesVerify] public sealed class TheSplitLinesMethod { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Widgets/AlignTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/AlignTests.cs index e3f292303..e40dce470 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/AlignTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/AlignTests.cs @@ -2,11 +2,9 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Align")] public sealed class AlignTests { - [UsesVerify] public sealed class Left { [Fact] @@ -55,7 +53,6 @@ public Task Should_Render_Panel_Left_Aligned_At_Bottom() } } - [UsesVerify] public sealed class Center { [Fact] @@ -104,7 +101,6 @@ public Task Should_Render_Panel_Center_Aligned_At_Bottom() } } - [UsesVerify] public sealed class Right { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Widgets/BarChartTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/BarChartTests.cs index 70a941cf2..26619e905 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/BarChartTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/BarChartTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/BarChart")] public sealed class BarChartTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs index 4fdc7d1ff..81ca27c1f 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/BreakdownChartTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/BreakdownChart")] public sealed class BreakdownChartTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/CalendarTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/CalendarTests.cs index 89df1e4c8..14d5a2c32 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/CalendarTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/CalendarTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Calendar")] public sealed class CalendarTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/CanvasTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/CanvasTests.cs index 4b38a819e..a223627ae 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/CanvasTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/CanvasTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Canvas")] public class CanvasTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/ColumnsTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/ColumnsTests.cs index 63afa78a0..b595fa26d 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/ColumnsTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/ColumnsTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Columns")] public sealed class ColumnsTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/FigletTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/FigletTests.cs index b2831769a..5fc668409 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/FigletTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/FigletTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Figlet")] public sealed class FigletTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/GridTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/GridTests.cs index 5689c86aa..4644790c8 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/GridTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/GridTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Grid")] public sealed class GridTests { @@ -70,7 +69,6 @@ public void Should_Throw_If_Row_Columns_Are_Greater_Than_Number_Of_Columns() } } - [UsesVerify] [ExpectationPath("AddEmptyRow")] public sealed class TheAddEmptyRowMethod { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/JsonTextTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/JsonTextTests.cs index 09d457607..a54531943 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/JsonTextTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/JsonTextTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Json")] public sealed class JsonTextTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/LayoutTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/LayoutTests.cs index fc0017e7b..550922a97 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/LayoutTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/LayoutTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Layout")] public sealed class LayoutTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/PadderTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/PadderTests.cs index ccca14bcd..dddd06238 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/PadderTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/PadderTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Padder")] public sealed class PadderTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/PanelTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/PanelTests.cs index 377c94f35..3d042fae4 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/PanelTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/PanelTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Panel")] public sealed class PanelTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/RowsTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/RowsTests.cs index 6937d842f..0278bacd3 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/RowsTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/RowsTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Rows")] public sealed class RowsTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/RuleTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/RuleTests.cs index fada3fd6d..9db45d39c 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/RuleTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/RuleTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Rule")] public sealed class RuleTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionExtensionsTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionExtensionsTests.cs index d1d609e07..69d31b89c 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionExtensionsTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionExtensionsTests.cs @@ -1,10 +1,8 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Table/Rows/Extensions")] public sealed class TableRowCollectionExtensionsTests { - [UsesVerify] public sealed class TheAddRowMethod { [Fact] @@ -48,7 +46,6 @@ public Task Should_Add_Strings() } } - [UsesVerify] public sealed class TheInsertRowMethod { [Fact] @@ -92,7 +89,6 @@ public Task Should_Insert_Strings() } } - [UsesVerify] public sealed class TheRemoveRowMethod { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionTests.cs index 12952ebd8..cb97b6ba0 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableRowCollectionTests.cs @@ -3,7 +3,6 @@ namespace Spectre.Console.Tests.Unit; [ExpectationPath("Widgets/Table/Rows")] public sealed class TableRowCollectionTests { - [UsesVerify] public sealed class TheAddMethod { [Fact] @@ -69,7 +68,6 @@ public Task Should_Add_Item_At_Correct_Place() } } - [UsesVerify] public sealed class TheInsertMethod { [Fact] @@ -137,7 +135,6 @@ public Task Should_Insert_Item_At_Correct_Place() } } - [UsesVerify] public sealed class TheRemoveMethod { [Fact] @@ -215,7 +212,6 @@ public void Should_Remove_All_Rows() } } - [UsesVerify] public sealed class TheUpdateMethod { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableTests.cs index 8a1ce1d36..9df303846 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/Table/TableTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/Table/TableTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Table")] public sealed class TableTests { @@ -101,7 +100,6 @@ public void Should_Throw_If_Row_Columns_Are_Greater_Than_Number_Of_Columns() } } - [UsesVerify] public sealed class TheAddEmptyRowMethod { [Fact] diff --git a/test/Spectre.Console.Tests/Unit/Widgets/TextPathTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/TextPathTests.cs index 0dda74206..b3eb0572a 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/TextPathTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/TextPathTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/TextPath")] public sealed class TextPathTests { diff --git a/test/Spectre.Console.Tests/Unit/Widgets/TreeTests.cs b/test/Spectre.Console.Tests/Unit/Widgets/TreeTests.cs index 14dde7863..c731af993 100644 --- a/test/Spectre.Console.Tests/Unit/Widgets/TreeTests.cs +++ b/test/Spectre.Console.Tests/Unit/Widgets/TreeTests.cs @@ -1,6 +1,5 @@ namespace Spectre.Console.Tests.Unit; -[UsesVerify] [ExpectationPath("Widgets/Tree")] public class TreeTests {