Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 938176b

Browse files
authored
Use FluentAssertions.Analyzers (#3314)
1 parent b991120 commit 938176b

File tree

8 files changed

+34
-4
lines changed

8 files changed

+34
-4
lines changed

src/ApiService/FunctionalTests/FunctionalTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="FluentAssertions" Version="6.11.0" />
17+
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
<PrivateAssets>all</PrivateAssets>
20+
</PackageReference>
1721
<PackageReference Include="Microsoft.Identity.Client" Version="4.52.0" />
1822
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
1923
<PackageReference Include="System.Net.Http" Version="4.3.4" />

src/ApiService/FunctionalTests/packages.lock.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"System.Configuration.ConfigurationManager": "4.4.0"
1818
}
1919
},
20+
"FluentAssertions.Analyzers": {
21+
"type": "Direct",
22+
"requested": "[0.21.0, )",
23+
"resolved": "0.21.0",
24+
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
25+
},
2026
"Microsoft.Identity.Client": {
2127
"type": "Direct",
2228
"requested": "[4.52.0, )",

src/ApiService/IntegrationTests/AgentCommandsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ await Context.InsertAll(new[] {
4949

5050
var pendingNodeCommand = BodyAs<PendingNodeCommand>(result);
5151
pendingNodeCommand.Envelope.Should().NotBeNull();
52-
pendingNodeCommand.Envelope?.Command.Should().BeEquivalentTo(command);
53-
pendingNodeCommand.Envelope?.MessageId.Should().Be(messageId);
52+
pendingNodeCommand.Envelope!.Command.Should().BeEquivalentTo(command);
53+
pendingNodeCommand.Envelope.MessageId.Should().Be(messageId);
5454
}
5555
}

src/ApiService/IntegrationTests/IntegrationTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
<ItemGroup>
88
<PackageReference Include="FluentAssertions" Version="6.11.0" />
9+
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11+
<PrivateAssets>all</PrivateAssets>
12+
</PackageReference>
913
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
1014
<PackageReference Include="Moq" Version="4.18.4" />
1115
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.2" />

src/ApiService/IntegrationTests/packages.lock.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"System.Configuration.ConfigurationManager": "4.4.0"
1818
}
1919
},
20+
"FluentAssertions.Analyzers": {
21+
"type": "Direct",
22+
"requested": "[0.21.0, )",
23+
"resolved": "0.21.0",
24+
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
25+
},
2026
"Microsoft.NET.Test.Sdk": {
2127
"type": "Direct",
2228
"requested": "[17.6.2, )",

src/ApiService/Tests/Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
9+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
10+
<PrivateAssets>all</PrivateAssets>
11+
</PackageReference>
812
<PackageReference Include="FsCheck" Version="2.16.5" />
913
<PackageReference Include="FsCheck.Xunit" Version="2.16.5" />
1014
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />

src/ApiService/Tests/TruncationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public static void TestNestedTruncation() {
3939

4040
var truncatedEvent = eventCrashReported.Truncate(3) as EventCrashReported;
4141
truncatedEvent.Should().NotBeNull();
42-
truncatedEvent?.Report.Executable.Should().Be("SOM");
43-
truncatedEvent?.Report.CallStack.Count.Should().Be(0);
42+
truncatedEvent!.Report.Executable.Should().Be("SOM");
43+
truncatedEvent.Report.CallStack.Count.Should().Be(0);
4444
}
4545

4646
[Fact]

src/ApiService/Tests/packages.lock.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"System.Configuration.ConfigurationManager": "4.4.0"
1818
}
1919
},
20+
"FluentAssertions.Analyzers": {
21+
"type": "Direct",
22+
"requested": "[0.21.0, )",
23+
"resolved": "0.21.0",
24+
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
25+
},
2026
"FsCheck": {
2127
"type": "Direct",
2228
"requested": "[2.16.5, )",

0 commit comments

Comments
 (0)