tests fixes and some product advisories tunes ups

This commit is contained in:
master
2026-01-30 07:57:43 +02:00
parent 644887997c
commit 55744f6a39
345 changed files with 26290 additions and 2267 deletions

View File

@@ -181,7 +181,7 @@ public sealed class IntentAnalyzerTests
public class MyTests
{
[Fact]
{|#0:[Intent("Safety")]|}
[Intent("Safety")]
public void TestWithIntent()
{
var a = 1;
@@ -202,7 +202,7 @@ public sealed class IntentAnalyzerTests
""";
var expected = new DiagnosticResult(IntentAnalyzer.MissingRationaleDiagnosticId, DiagnosticSeverity.Info)
.WithLocation(0)
.WithSpan(6, 6, 6, 22)
.WithArguments("TestWithIntent");
await VerifyWarningAsync(code, expected);
@@ -272,6 +272,8 @@ public sealed class IntentAnalyzerTests
test.TestState.AdditionalReferences.Add(
MetadataReference.CreateFromFile(typeof(Xunit.FactAttribute).Assembly.Location));
test.TestState.AdditionalReferences.Add(
MetadataReference.CreateFromFile(typeof(Xunit.Assert).Assembly.Location));
await test.RunAsync();
}
@@ -287,6 +289,8 @@ public sealed class IntentAnalyzerTests
test.TestState.AdditionalReferences.Add(
MetadataReference.CreateFromFile(typeof(Xunit.FactAttribute).Assembly.Location));
test.TestState.AdditionalReferences.Add(
MetadataReference.CreateFromFile(typeof(Xunit.Assert).Assembly.Location));
await test.RunAsync();
}

View File

@@ -9,9 +9,6 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="FluentAssertions" />