mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-15 00:12:50 +08:00
Moved analyzer tests to its own project
Also moves tests to `./test` which makes it possible for all test projects to share the same .editorconfig files and similar.
This commit is contained in:
parent
721d73e9eb
commit
c9b178ac96
@ -19,7 +19,13 @@ Task("Test")
|
||||
.IsDependentOn("Build")
|
||||
.Does(context =>
|
||||
{
|
||||
DotNetCoreTest("./src/Spectre.Console.Tests/Spectre.Console.Tests.csproj", new DotNetCoreTestSettings {
|
||||
DotNetCoreTest("./test/Spectre.Console.Tests/Spectre.Console.Tests.csproj", new DotNetCoreTestSettings {
|
||||
Configuration = configuration,
|
||||
NoRestore = true,
|
||||
NoBuild = true,
|
||||
});
|
||||
|
||||
DotNetCoreTest("./test/Spectre.Console.Analyzer.Tests/Spectre.Console.Analyzer.Tests.csproj", new DotNetCoreTestSettings {
|
||||
Configuration = configuration,
|
||||
NoRestore = true,
|
||||
NoBuild = true,
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"projects": [ "src" ],
|
||||
"projects": [ "src", "tests" ],
|
||||
"sdk": {
|
||||
"version": "5.0.202",
|
||||
"rollForward": "latestPatch"
|
||||
|
@ -6,7 +6,7 @@ namespace Spectre.Console.Analyzer.Sandbox
|
||||
public static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Main.
|
||||
/// The program's entry point.
|
||||
/// </summary>
|
||||
public static void Main()
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Description>Best practice analyzers for Spectre.Console.</Description>
|
||||
@ -8,6 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<NoPackageAnalysis>true</NoPackageAnalysis>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="..\stylecop.json" Link="Properties/stylecop.json" />
|
||||
<None Include="../../resources/gfx/small-logo.png" Pack="true" PackagePath="\" Link="Properties/small-logo.png" />
|
||||
@ -18,6 +19,10 @@
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="bin\Debug\netstandard2.0\\Spectre.Console.Analyzer.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
|
||||
|
@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.30225.117
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console", "Spectre.Console\Spectre.Console.csproj", "{80DCBEF3-99D6-46C0-9C5B-42B4534D9113}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console.Tests", "Spectre.Console.Tests\Spectre.Console.Tests.csproj", "{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{20595AD4-8D75-4AF8-B6BC-9C38C160423F}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
@ -90,9 +88,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shared", "..\examples\Share
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Live", "..\examples\Console\Live\Live.csproj", "{E607AA2A-A4A6-48E4-8AAB-B0EB74EACAA1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spectre.Console.Analyzer", "Spectre.Console.Analyzer\Spectre.Console.Analyzer.csproj", "{26006ACD-F19D-4C2A-8864-FE0D6C15B58C}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console.Analyzer", "Spectre.Console.Analyzer\Spectre.Console.Analyzer.csproj", "{26006ACD-F19D-4C2A-8864-FE0D6C15B58C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spectre.Console.Analyzer.Sandbox", "Spectre.Console.Analyzer.Sandbox\Spectre.Console.Analyzer.Sandbox.csproj", "{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console.Analyzer.Sandbox", "Spectre.Console.Analyzer.Sandbox\Spectre.Console.Analyzer.Sandbox.csproj", "{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Analyzer", "Analyzer", "{EEB25BA6-F77C-41A8-9464-64BB621D1019}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console.Tests", "..\test\Spectre.Console.Tests\Spectre.Console.Tests.csproj", "{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spectre.Console.Analyzer.Tests", "..\test\Spectre.Console.Analyzer.Tests\Spectre.Console.Analyzer.Tests.csproj", "{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -116,18 +120,6 @@ Global
|
||||
{80DCBEF3-99D6-46C0-9C5B-42B4534D9113}.Release|x64.Build.0 = Release|Any CPU
|
||||
{80DCBEF3-99D6-46C0-9C5B-42B4534D9113}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{80DCBEF3-99D6-46C0-9C5B-42B4534D9113}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9F1AC4C1-766E-4421-8A78-B28F5BCDD94F}.Release|x86.Build.0 = Release|Any CPU
|
||||
{94ECCBA8-7EBF-4B53-8379-52EB2327417E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94ECCBA8-7EBF-4B53-8379-52EB2327417E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94ECCBA8-7EBF-4B53-8379-52EB2327417E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
@ -500,6 +492,30 @@ Global
|
||||
{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11}.Release|x64.Build.0 = Release|Any CPU
|
||||
{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11}.Release|x86.Build.0 = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{60A4CADD-2B3D-48ED-89C0-1637A1F111AE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -536,6 +552,9 @@ Global
|
||||
{A0C772BA-C5F4-451D-AA7A-4045F2FA0201} = {F0575243-121F-4DEE-9F6B-246E26DC0844}
|
||||
{8428A7DD-29FC-4417-9CA0-B90D34B26AB2} = {A0C772BA-C5F4-451D-AA7A-4045F2FA0201}
|
||||
{E607AA2A-A4A6-48E4-8AAB-B0EB74EACAA1} = {F0575243-121F-4DEE-9F6B-246E26DC0844}
|
||||
{26006ACD-F19D-4C2A-8864-FE0D6C15B58C} = {EEB25BA6-F77C-41A8-9464-64BB621D1019}
|
||||
{241D2B07-FFE8-476E-A9C3-0A0E8E8A0E11} = {EEB25BA6-F77C-41A8-9464-64BB621D1019}
|
||||
{F78E47DF-8235-4EAC-9A01-C513AB7C7D13} = {EEB25BA6-F77C-41A8-9464-64BB621D1019}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5729B071-67A0-48FB-8B1B-275E6822086C}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using Spectre.Console.Rendering;
|
||||
using static Spectre.Console.AnsiSequences;
|
||||
|
||||
|
@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Spectre.Console
|
||||
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.VisualStudio.Composition;
|
||||
using Spectre.Console.Analyzer.FixProviders;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers
|
||||
namespace Spectre.Console.Analyzer.Tests
|
||||
{
|
||||
internal static class CodeFixProviderDiscovery
|
||||
{
|
@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.0.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Spectre.Console.Analyzer\Spectre.Console.Analyzer.csproj" />
|
||||
<ProjectReference Include="..\..\src\Spectre.Console\Spectre.Console.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Microsoft.CodeAnalysis.Testing.Verifiers;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers
|
||||
namespace Spectre.Console.Analyzer.Tests
|
||||
{
|
||||
public static class SpectreAnalyzerVerifier<TAnalyzer>
|
||||
where TAnalyzer : DiagnosticAnalyzer, new()
|
||||
@ -79,7 +79,8 @@ namespace Spectre.Console.Tests.CodeAnalyzers
|
||||
|
||||
static CodeAnalyzerHelper()
|
||||
{
|
||||
CurrentSpectre = ReferenceAssemblies.Net.Net50.AddAssemblies(ImmutableArray.Create(typeof(AnsiConsole).Assembly.Location.Replace(".dll", string.Empty)));
|
||||
CurrentSpectre = ReferenceAssemblies.Net.Net50.AddAssemblies(
|
||||
ImmutableArray.Create(typeof(AnsiConsole).Assembly.Location.Replace(".dll", string.Empty)));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,8 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.NoConcurrentLiveRenderablesAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Analyzers
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Analyzers
|
||||
{
|
||||
public class NoCurrentLiveRenderablesTests
|
||||
{
|
||||
@ -31,7 +27,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -55,7 +51,7 @@ class Child
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 13))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -76,7 +72,7 @@ class Program
|
||||
static void Start() => AnsiConsole.WriteLine(""Starting..."");
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
@ -1,13 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.NoPromptsDuringLiveRenderablesAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Analyzers
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Analyzers
|
||||
{
|
||||
public class NoPromptsDuringLiveRenderablesTests
|
||||
{
|
||||
@ -29,7 +25,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -53,7 +49,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 26))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -75,7 +71,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -100,7 +96,7 @@ class Program
|
||||
static string Confirm() => string.Empty;
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
@ -1,12 +1,8 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.FavorInstanceAnsiConsoleOverStaticAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Analyzers
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Analyzers
|
||||
{
|
||||
public class FavorInstanceAnsiConsoleOverStaticAnalyzerTests
|
||||
{
|
||||
@ -30,7 +26,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -49,7 +45,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -71,7 +67,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(11, 9))
|
||||
.ConfigureAwait(false);
|
||||
}
|
@ -1,12 +1,8 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.UseSpectreInsteadOfSystemConsoleAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Analyzers
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Analyzers
|
||||
{
|
||||
public class UseSpectreInsteadOfSystemConsoleAnalyzerTests
|
||||
{
|
||||
@ -27,7 +23,7 @@ class TestClass {
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -45,7 +41,7 @@ class TestClass {
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -63,7 +59,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9))
|
||||
.ConfigureAwait(false);
|
||||
}
|
@ -1,13 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.FavorInstanceAnsiConsoleOverStaticAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Fixes
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Fixes
|
||||
{
|
||||
public class UseInstanceOfStaticAnsiConsoleTests
|
||||
{
|
||||
@ -46,7 +42,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -76,7 +72,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -112,7 +108,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
@ -1,13 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Spectre.Console.Analyzer;
|
||||
using Xunit;
|
||||
using AnalyzerVerify =
|
||||
Spectre.Console.Tests.CodeAnalyzers.SpectreAnalyzerVerifier<
|
||||
Spectre.Console.Analyzer.UseSpectreInsteadOfSystemConsoleAnalyzer>;
|
||||
|
||||
namespace Spectre.Console.Tests.CodeAnalyzers.Fixes
|
||||
namespace Spectre.Console.Analyzer.Tests.Unit.Fixes
|
||||
{
|
||||
public class UseSpectreInsteadOfSystemConsoleFixTests
|
||||
{
|
||||
@ -41,7 +37,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -72,7 +68,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(8, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -108,7 +104,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@ -144,7 +140,7 @@ class TestClass
|
||||
}
|
||||
}";
|
||||
|
||||
await AnalyzerVerify
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyCodeFixAsync(Source, _expectedDiagnostic.WithLocation(11, 9), FixedSource)
|
||||
.ConfigureAwait(false);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user