Skip to content

Commit 5a86695

Browse files
AdaskoTheBeAsTMeir017
authored andcommitted
Upgraded to FluentAssertions 5.1.1, activated test for 5.x.x (#27)
* Upgraded to FluentAssertions 5.1.1, activated test for 5.x.x * upgraded libs
1 parent dcb2c69 commit 5a86695

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

src/FluentAssertions.Analyzers.Tests/DiagnosticVerifier.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ static DiagnosticVerifier()
4242
.Append(GetSystemAssemblyPathByName("System.Private.Xml.Linq.dll"))
4343
.Append(GetSystemAssemblyPathByName("System.Linq.Expressions.dll"))
4444
.Append(GetSystemAssemblyPathByName("System.Collections.dll"))
45+
.Append(GetSystemAssemblyPathByName("netstandard.dll"))
46+
.Append(GetSystemAssemblyPathByName("System.Xml.ReaderWriter.dll"))
47+
.Append(GetSystemAssemblyPathByName("System.Private.Xml.dll"))
4548
.Select(location => (MetadataReference)MetadataReference.CreateFromFile(location))
4649
.ToImmutableArray();
4750

src/FluentAssertions.Analyzers.Tests/FluentAssertions.Analyzers.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="FluentAssertions" Version="4.19.4" />
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
12-
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
13-
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
10+
<PackageReference Include="FluentAssertions" Version="5.1.1" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
13+
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/FluentAssertions.Analyzers.Tests/GenerateCode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static string EnumerableExpressionBodyAssertion(string assertion) => Enum
1616
.AppendLine("using System.Collections.Generic;")
1717
.AppendLine("using System.Linq;")
1818
.AppendLine("using System;")
19-
.AppendLine("using FluentAssertions;")
19+
.AppendLine("using FluentAssertions;using FluentAssertions.Extensions;")
2020
.AppendLine("namespace TestNamespace")
2121
.AppendLine("{")
2222
.AppendLine(" public class TestClass")
@@ -42,7 +42,7 @@ public static string EnumerableExpressionBodyAssertion(string assertion) => Enum
4242
.AppendLine("using System.Collections.Generic;")
4343
.AppendLine("using System.Linq;")
4444
.AppendLine("using System;")
45-
.AppendLine("using FluentAssertions;")
45+
.AppendLine("using FluentAssertions;using FluentAssertions.Extensions;")
4646
.AppendLine("namespace TestNamespace")
4747
.AppendLine("{")
4848
.AppendLine(" public class TestClass")
@@ -80,7 +80,7 @@ public static string EnumerableExpressionBodyAssertion(string assertion) => Enum
8080

8181
public static string StringAssertion(string assertion) => new StringBuilder()
8282
.AppendLine("using System;")
83-
.AppendLine("using FluentAssertions;")
83+
.AppendLine("using FluentAssertions;using FluentAssertions.Extensions;")
8484
.AppendLine("namespace TestNamespace")
8585
.AppendLine("{")
8686
.AppendLine(" class TestClass")

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public class CollectionTests
227227
[AssertionCodeFix(
228228
oldAssertion: "actual.AsEnumerable().Count().Should().BeGreaterThan(6{0}).And.ToString();",
229229
newAssertion: "actual.AsEnumerable().Should().HaveCountGreaterThan(6{0}).And.ToString();")]
230-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
230+
[Implemented]
231231
public void CollectionShouldHaveCountGreaterThan_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldHaveCountGreaterThanCodeFix, CollectionShouldHaveCountGreaterThanAnalyzer>(oldAssertion, newAssertion);
232232

233233
[AssertionDataTestMethod]
@@ -251,7 +251,7 @@ public class CollectionTests
251251
[AssertionCodeFix(
252252
oldAssertion: "actual.AsEnumerable().Count().Should().BeGreaterOrEqualTo(6{0}).And.ToString();",
253253
newAssertion: "actual.AsEnumerable().Should().HaveCountGreaterOrEqualTo(6{0}).And.ToString();")]
254-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
254+
[Implemented]
255255
public void CollectionShouldHaveCountGreaterOrEqualTo_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldHaveCountGreaterOrEqualToCodeFix, CollectionShouldHaveCountGreaterOrEqualToAnalyzer>(oldAssertion, newAssertion);
256256

257257
[AssertionDataTestMethod]
@@ -275,7 +275,7 @@ public class CollectionTests
275275
[AssertionCodeFix(
276276
oldAssertion: "actual.AsEnumerable().Count().Should().BeLessThan(6{0}).And.ToString();",
277277
newAssertion: "actual.AsEnumerable().Should().HaveCountLessThan(6{0}).And.ToString();")]
278-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
278+
[Implemented]
279279
public void CollectionShouldHaveCountLessThan_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldHaveCountLessThanCodeFix, CollectionShouldHaveCountLessThanAnalyzer>(oldAssertion, newAssertion);
280280

281281
[AssertionDataTestMethod]
@@ -299,7 +299,7 @@ public class CollectionTests
299299
[AssertionCodeFix(
300300
oldAssertion: "actual.AsEnumerable().Count().Should().BeLessOrEqualTo(6{0}).And.ToString();",
301301
newAssertion: "actual.AsEnumerable().Should().HaveCountLessOrEqualTo(6{0}).And.ToString();")]
302-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
302+
[Implemented]
303303
public void CollectionShouldHaveCountLessOrEqualTo_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldHaveCountLessOrEqualToCodeFix, CollectionShouldHaveCountLessOrEqualToAnalyzer>(oldAssertion, newAssertion);
304304

305305
[AssertionDataTestMethod]
@@ -323,7 +323,7 @@ public class CollectionTests
323323
[AssertionCodeFix(
324324
oldAssertion: "actual.AsEnumerable().Count().Should().NotBe(6{0}).And.ToString();",
325325
newAssertion: "actual.AsEnumerable().Should().NotHaveCount(6{0}).And.ToString();")]
326-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
326+
[Implemented]
327327
public void CollectionShouldNotHaveCount_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldNotHaveCountCodeFix, CollectionShouldNotHaveCountAnalyzer>(oldAssertion, newAssertion);
328328

329329
[AssertionDataTestMethod]
@@ -355,7 +355,7 @@ public class CollectionTests
355355
[AssertionCodeFix(
356356
oldAssertion: "actual.AsEnumerable().Count().Should().NotBe(unexpected.Count(){0}).And.ToString();",
357357
newAssertion: "actual.AsEnumerable().Should().NotHaveSameCount(unexpected{0}).And.ToString();")]
358-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
358+
[Implemented]
359359
public void CollectionShouldNotHaveSameCount_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldNotHaveSameCountCodeFix, CollectionShouldNotHaveSameCountAnalyzer>(oldAssertion, newAssertion);
360360

361361
[AssertionDataTestMethod]
@@ -563,7 +563,8 @@ public class CollectionTests
563563
[AssertionCodeFix(
564564
oldAssertion: "actual.AsEnumerable().Select(x => x.BooleanProperty).Should().NotContainNulls({0}).And.ToString();",
565565
newAssertion: "actual.AsEnumerable().Should().NotContainNulls(x => x.BooleanProperty{0}).And.ToString();")]
566-
[Implemented, Ignore("Will be available in Fluent Assertions 5.0")]
566+
[Implemented]
567+
[Ignore("What Should Happen?")]
567568
public void CollectionShouldNotContainNulls_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldNotContainNullsCodeFix, CollectionShouldNotContainNullsAnalyzer>(oldAssertion, newAssertion);
568569

569570
[AssertionDataTestMethod]
@@ -596,7 +597,6 @@ public class CollectionTests
596597
[AssertionCodeFix(
597598
oldAssertion: "actual.AsEnumerable().Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0}).And.ToString();",
598599
newAssertion: "actual.AsEnumerable().Should().OnlyHaveUniqueItems(x => x.BooleanProperty{0}).And.ToString();")]
599-
[Ignore("Will be available in Fluent Assertions 5.0")]
600600
public void CollectionShouldOnlyHaveUniqueItemsByComparer_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldOnlyHaveUniqueItemsByComparerCodeFix, CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer>(oldAssertion, newAssertion);
601601

602602
[AssertionDataTestMethod]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private void VerifyCSharpDiagnostic(string assertion)
1616
{
1717
var code = new StringBuilder()
1818
.AppendLine("using System;")
19-
.AppendLine("using FluentAssertions;")
19+
.AppendLine("using FluentAssertions;using FluentAssertions.Extensions;")
2020
.AppendLine("namespace TestNamespace")
2121
.AppendLine("{")
2222
.AppendLine(" class TestClass")

src/FluentAssertions.Analyzers/FluentAssertions.Analyzers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.3.2" />
10-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.3.2" />
9+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" />
10+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" />
1111
<PackageReference Include="Microsoft.Composition" Version="1.0.31" />
1212
</ItemGroup>
1313

0 commit comments

Comments
 (0)