Use FluentAssertions.Analyzers (#3314)

This commit is contained in:
George Pollard 2023-07-21 04:07:39 +12:00 committed by GitHub
parent b9911206ac
commit 938176b700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 4 deletions

View File

@ -14,6 +14,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" /> <PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client" Version="4.52.0" /> <PackageReference Include="Microsoft.Identity.Client" Version="4.52.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" /> <PackageReference Include="System.Net.Http" Version="4.3.4" />

View File

@ -17,6 +17,12 @@
"System.Configuration.ConfigurationManager": "4.4.0" "System.Configuration.ConfigurationManager": "4.4.0"
} }
}, },
"FluentAssertions.Analyzers": {
"type": "Direct",
"requested": "[0.21.0, )",
"resolved": "0.21.0",
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
},
"Microsoft.Identity.Client": { "Microsoft.Identity.Client": {
"type": "Direct", "type": "Direct",
"requested": "[4.52.0, )", "requested": "[4.52.0, )",

View File

@ -49,7 +49,7 @@ public abstract class AgentCommandsTestsBase : FunctionTestBase {
var pendingNodeCommand = BodyAs<PendingNodeCommand>(result); var pendingNodeCommand = BodyAs<PendingNodeCommand>(result);
pendingNodeCommand.Envelope.Should().NotBeNull(); pendingNodeCommand.Envelope.Should().NotBeNull();
pendingNodeCommand.Envelope?.Command.Should().BeEquivalentTo(command); pendingNodeCommand.Envelope!.Command.Should().BeEquivalentTo(command);
pendingNodeCommand.Envelope?.MessageId.Should().Be(messageId); pendingNodeCommand.Envelope.MessageId.Should().Be(messageId);
} }
} }

View File

@ -6,6 +6,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" /> <PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Moq" Version="4.18.4" /> <PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.2" /> <PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.2" />

View File

@ -17,6 +17,12 @@
"System.Configuration.ConfigurationManager": "4.4.0" "System.Configuration.ConfigurationManager": "4.4.0"
} }
}, },
"FluentAssertions.Analyzers": {
"type": "Direct",
"requested": "[0.21.0, )",
"resolved": "0.21.0",
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
},
"Microsoft.NET.Test.Sdk": { "Microsoft.NET.Test.Sdk": {
"type": "Direct", "type": "Direct",
"requested": "[17.6.2, )", "requested": "[17.6.2, )",

View File

@ -5,6 +5,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions.Analyzers" Version="0.21.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FsCheck" Version="2.16.5" /> <PackageReference Include="FsCheck" Version="2.16.5" />
<PackageReference Include="FsCheck.Xunit" Version="2.16.5" /> <PackageReference Include="FsCheck.Xunit" Version="2.16.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />

View File

@ -39,8 +39,8 @@ public class TruncationTests {
var truncatedEvent = eventCrashReported.Truncate(3) as EventCrashReported; var truncatedEvent = eventCrashReported.Truncate(3) as EventCrashReported;
truncatedEvent.Should().NotBeNull(); truncatedEvent.Should().NotBeNull();
truncatedEvent?.Report.Executable.Should().Be("SOM"); truncatedEvent!.Report.Executable.Should().Be("SOM");
truncatedEvent?.Report.CallStack.Count.Should().Be(0); truncatedEvent.Report.CallStack.Count.Should().Be(0);
} }
[Fact] [Fact]

View File

@ -17,6 +17,12 @@
"System.Configuration.ConfigurationManager": "4.4.0" "System.Configuration.ConfigurationManager": "4.4.0"
} }
}, },
"FluentAssertions.Analyzers": {
"type": "Direct",
"requested": "[0.21.0, )",
"resolved": "0.21.0",
"contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA=="
},
"FsCheck": { "FsCheck": {
"type": "Direct", "type": "Direct",
"requested": "[2.16.5, )", "requested": "[2.16.5, )",