Skip to content

Commit 731954c

Browse files
authored
chore: update dependencies (#382)
* chore: update dependencies
1 parent d42cba1 commit 731954c

File tree

4 files changed

+57
-44
lines changed

4 files changed

+57
-44
lines changed

src/Directory.Packages.props

+15-16
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
7-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" />
8-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.3.1" />
6+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
7+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
98
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
109

11-
<PackageVersion Include="FluentAssertions" Version="6.1.0" />
10+
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
1211

13-
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
14-
<PackageVersion Include="NUnit.Analyzers" Version="3.6.1" />
15-
<PackageVersion Include="NUnit" Version="4.0.1" />
12+
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
13+
<PackageVersion Include="NUnit.Analyzers" Version="4.3.0" />
14+
<PackageVersion Include="NUnit" Version="4.2.2" />
1615

17-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
18-
<PackageVersion Include="MSTest.TestAdapter" Version="3.0.4" />
19-
<PackageVersion Include="MSTest.TestFramework" Version="3.0.4" />
16+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
17+
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.0" />
18+
<PackageVersion Include="MSTest.TestFramework" Version="3.6.0" />
2019

21-
<PackageVersion Include="xunit.assert" Version="2.4.2" />
22-
<PackageVersion Include="xunit" Version="2.4.2" />
23-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
20+
<PackageVersion Include="xunit.assert" Version="2.9.0" />
21+
<PackageVersion Include="xunit" Version="2.9.0" />
22+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
2423

25-
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
26-
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
24+
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
25+
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
2726

28-
<PackageVersion Include="BenchmarkDotNet" Version="0.13.5" />
27+
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
2928
</ItemGroup>
3029
</Project>

src/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocsGenerator/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocsGenerator.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
109
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
1110
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
1211
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" PrivateAssets="all" />

src/FluentAssertions.Analyzers.Tests/TestAttributes.cs

+32-16
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ public class AssertionDiagnosticAttribute : Attribute, ITestDataSource
2626
{
2727
public string Assertion { get; }
2828

29-
public bool Ignore { get; }
30-
31-
public AssertionDiagnosticAttribute(string assertion, bool ignore = false) => (Assertion, Ignore) = (assertion, ignore);
29+
public AssertionDiagnosticAttribute(string assertion) => Assertion = assertion;
3230

3331
public IEnumerable<object[]> GetData(MethodInfo methodInfo)
3432
{
35-
if (Ignore) yield break;
36-
3733
foreach (var assertion in TestCasesInputUtils.GetTestCases(Assertion))
3834
{
3935
yield return new object[] { assertion };
@@ -43,20 +39,24 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
4339
public string GetDisplayName(MethodInfo methodInfo, object[] data) => $"{methodInfo.Name}(\"{data[0]}\")";
4440
}
4541

42+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
43+
public class IgnoreAssertionDiagnosticAttribute : Attribute
44+
{
45+
public string Assertion { get; }
46+
47+
public IgnoreAssertionDiagnosticAttribute(string assertion) => Assertion = assertion;
48+
}
49+
4650
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
4751
public class AssertionCodeFixAttribute : Attribute, ITestDataSource
4852
{
4953
public string OldAssertion { get; }
5054
public string NewAssertion { get; }
5155

52-
public bool Ignore { get; }
53-
54-
public AssertionCodeFixAttribute(string oldAssertion, string newAssertion, bool ignore = false) => (OldAssertion, NewAssertion, Ignore) = (oldAssertion, newAssertion, ignore);
56+
public AssertionCodeFixAttribute(string oldAssertion, string newAssertion) => (OldAssertion, NewAssertion) = (oldAssertion, newAssertion);
5557

5658
public IEnumerable<object[]> GetData(MethodInfo methodInfo)
5759
{
58-
if (Ignore) yield break;
59-
6060
foreach (var (oldAssertion, newAssertion) in TestCasesInputUtils.GetTestCases(OldAssertion, NewAssertion))
6161
{
6262
yield return new object[] { oldAssertion, newAssertion };
@@ -66,22 +66,27 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
6666
public string GetDisplayName(MethodInfo methodInfo, object[] data) => $"{methodInfo.Name}(\"old: {data[0]}\", new: {data[1]}\")";
6767
}
6868

69+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
70+
public class IgnoreAssertionCodeFixAttribute : Attribute
71+
{
72+
public string OldAssertion { get; }
73+
public string NewAssertion { get; }
74+
75+
public IgnoreAssertionCodeFixAttribute(string oldAssertion, string newAssertion) => (OldAssertion, NewAssertion) = (oldAssertion, newAssertion);
76+
}
77+
6978
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
7079
public class AssertionMethodCodeFixAttribute : Attribute, ITestDataSource
7180
{
7281
public string MethodArguments { get; }
7382
public string OldAssertion { get; }
7483
public string NewAssertion { get; }
7584

76-
public bool Ignore { get; }
77-
78-
public AssertionMethodCodeFixAttribute(string methodArguments, string oldAssertion, string newAssertion, bool ignore = false)
79-
=> (MethodArguments, OldAssertion, NewAssertion, Ignore) = (methodArguments, oldAssertion, newAssertion, ignore);
85+
public AssertionMethodCodeFixAttribute(string methodArguments, string oldAssertion, string newAssertion)
86+
=> (MethodArguments, OldAssertion, NewAssertion) = (methodArguments, oldAssertion, newAssertion);
8087

8188
public IEnumerable<object[]> GetData(MethodInfo methodInfo)
8289
{
83-
if (Ignore) yield break;
84-
8590
foreach (var (oldAssertion, newAssertion) in TestCasesInputUtils.GetTestCases(OldAssertion, NewAssertion))
8691
{
8792
yield return new object[] { MethodArguments, oldAssertion, newAssertion };
@@ -91,6 +96,17 @@ public IEnumerable<object[]> GetData(MethodInfo methodInfo)
9196
public string GetDisplayName(MethodInfo methodInfo, object[] data) => $"{methodInfo.Name}(\"arguments\":{data[0]}, \"old: {data[1]}\", new: {data[2]}\")";
9297
}
9398

99+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
100+
public class IgnoreAssertionMethodCodeFixAttribute : Attribute
101+
{
102+
public string MethodArguments { get; }
103+
public string OldAssertion { get; }
104+
public string NewAssertion { get; }
105+
106+
public IgnoreAssertionMethodCodeFixAttribute(string methodArguments, string oldAssertion, string newAssertion)
107+
=> (MethodArguments, OldAssertion, NewAssertion) = (methodArguments, oldAssertion, newAssertion);
108+
}
109+
94110
public static class TestCasesInputUtils
95111
{
96112
private static readonly string Empty = string.Empty;

src/FluentAssertions.Analyzers.Tests/Tips/CollectionTests.cs

+10-11
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ public class CollectionTests
184184
[Implemented]
185185
public void CollectionShouldNotContainProperty_WhereShouldBeEmpty_TestAnalyzer(string assertion) => VerifyCSharpDiagnosticCodeBlock(assertion, DiagnosticMetadata.CollectionShouldNotContainProperty_WhereShouldBeEmpty);
186186

187-
[DataTestMethod]
188-
[AssertionDiagnostic("actual.Should().OnlyContain(x => !x.BooleanProperty{0});", ignore: true)]
189-
[AssertionDiagnostic("actual.AsEnumerable().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();", ignore: true)]
190-
[AssertionDiagnostic("actual.ToArray().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();", ignore: true)]
191-
[AssertionDiagnostic("actual.ToList().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();", ignore: true)]
187+
// TODO: all test cases are ignored
188+
// [DataTestMethod]
189+
[IgnoreAssertionDiagnostic("actual.Should().OnlyContain(x => !x.BooleanProperty{0});")]
190+
[IgnoreAssertionDiagnostic("actual.AsEnumerable().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();")]
191+
[IgnoreAssertionDiagnostic("actual.ToArray().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();")]
192+
[IgnoreAssertionDiagnostic("actual.ToList().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();")]
192193
[Implemented]
193194
public void CollectionShouldNotContainProperty_ShouldOnlyContainNot_TestAnalyzer(string assertion) => VerifyCSharpDiagnosticCodeBlock(assertion, DiagnosticMetadata.CollectionShouldNotContainProperty_ShouldOnlyContainNot);
194195

@@ -199,20 +200,18 @@ public class CollectionTests
199200
[AssertionCodeFix(
200201
oldAssertion: "actual.Where(x => x.BooleanProperty).Should().BeEmpty({0});",
201202
newAssertion: "actual.Should().NotContain(x => x.BooleanProperty{0});")]
202-
[AssertionCodeFix(
203+
[IgnoreAssertionCodeFix(
203204
oldAssertion: "actual.Should().OnlyContain(x => !x.BooleanProperty{0});",
204-
newAssertion: "actual.Should().NotContain(x => x.BooleanProperty{0});",
205-
ignore: true)]
205+
newAssertion: "actual.Should().NotContain(x => x.BooleanProperty{0});")]
206206
[AssertionCodeFix(
207207
oldAssertion: "actual.AsEnumerable().Any(x => x.BooleanProperty).Should().BeFalse({0}).And.ToString();",
208208
newAssertion: "actual.AsEnumerable().Should().NotContain(x => x.BooleanProperty{0}).And.ToString();")]
209209
[AssertionCodeFix(
210210
oldAssertion: "actual.AsEnumerable().Where(x => x.BooleanProperty).Should().BeEmpty({0}).And.ToString();",
211211
newAssertion: "actual.AsEnumerable().Should().NotContain(x => x.BooleanProperty{0}).And.ToString();")]
212-
[AssertionCodeFix(
212+
[IgnoreAssertionCodeFix(
213213
oldAssertion: "actual.AsEnumerable().Should().OnlyContain(x => !x.BooleanProperty{0}).And.ToString();",
214-
newAssertion: "actual.AsEnumerable().Should().NotContain(x => x.BooleanProperty{0}).And.ToString();",
215-
ignore: true)]
214+
newAssertion: "actual.AsEnumerable().Should().NotContain(x => x.BooleanProperty{0}).And.ToString();")]
216215
[Implemented]
217216
public void CollectionShouldNotContainProperty_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock(oldAssertion, newAssertion);
218217

0 commit comments

Comments
 (0)