From 938176b70036c38e91146298ecd30d17aa1dabb4 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Fri, 21 Jul 2023 04:07:39 +1200 Subject: [PATCH] Use FluentAssertions.Analyzers (#3314) --- src/ApiService/FunctionalTests/FunctionalTests.csproj | 4 ++++ src/ApiService/FunctionalTests/packages.lock.json | 6 ++++++ src/ApiService/IntegrationTests/AgentCommandsTests.cs | 4 ++-- src/ApiService/IntegrationTests/IntegrationTests.csproj | 4 ++++ src/ApiService/IntegrationTests/packages.lock.json | 6 ++++++ src/ApiService/Tests/Tests.csproj | 4 ++++ src/ApiService/Tests/TruncationTests.cs | 4 ++-- src/ApiService/Tests/packages.lock.json | 6 ++++++ 8 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/ApiService/FunctionalTests/FunctionalTests.csproj b/src/ApiService/FunctionalTests/FunctionalTests.csproj index 9b2a658e9..2dfe9df83 100644 --- a/src/ApiService/FunctionalTests/FunctionalTests.csproj +++ b/src/ApiService/FunctionalTests/FunctionalTests.csproj @@ -14,6 +14,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/src/ApiService/FunctionalTests/packages.lock.json b/src/ApiService/FunctionalTests/packages.lock.json index 030754b98..6a3e72e23 100644 --- a/src/ApiService/FunctionalTests/packages.lock.json +++ b/src/ApiService/FunctionalTests/packages.lock.json @@ -17,6 +17,12 @@ "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": { "type": "Direct", "requested": "[4.52.0, )", diff --git a/src/ApiService/IntegrationTests/AgentCommandsTests.cs b/src/ApiService/IntegrationTests/AgentCommandsTests.cs index e765179ab..6f6873ff0 100644 --- a/src/ApiService/IntegrationTests/AgentCommandsTests.cs +++ b/src/ApiService/IntegrationTests/AgentCommandsTests.cs @@ -49,7 +49,7 @@ public abstract class AgentCommandsTestsBase : FunctionTestBase { var pendingNodeCommand = BodyAs(result); pendingNodeCommand.Envelope.Should().NotBeNull(); - pendingNodeCommand.Envelope?.Command.Should().BeEquivalentTo(command); - pendingNodeCommand.Envelope?.MessageId.Should().Be(messageId); + pendingNodeCommand.Envelope!.Command.Should().BeEquivalentTo(command); + pendingNodeCommand.Envelope.MessageId.Should().Be(messageId); } } diff --git a/src/ApiService/IntegrationTests/IntegrationTests.csproj b/src/ApiService/IntegrationTests/IntegrationTests.csproj index f8877268d..de7af7b1a 100644 --- a/src/ApiService/IntegrationTests/IntegrationTests.csproj +++ b/src/ApiService/IntegrationTests/IntegrationTests.csproj @@ -6,6 +6,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/src/ApiService/IntegrationTests/packages.lock.json b/src/ApiService/IntegrationTests/packages.lock.json index b0148debd..1914f9d31 100644 --- a/src/ApiService/IntegrationTests/packages.lock.json +++ b/src/ApiService/IntegrationTests/packages.lock.json @@ -17,6 +17,12 @@ "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": { "type": "Direct", "requested": "[17.6.2, )", diff --git a/src/ApiService/Tests/Tests.csproj b/src/ApiService/Tests/Tests.csproj index 0253d7675..d1c3d6306 100644 --- a/src/ApiService/Tests/Tests.csproj +++ b/src/ApiService/Tests/Tests.csproj @@ -5,6 +5,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/src/ApiService/Tests/TruncationTests.cs b/src/ApiService/Tests/TruncationTests.cs index 2d2e92acb..7aeb487ab 100644 --- a/src/ApiService/Tests/TruncationTests.cs +++ b/src/ApiService/Tests/TruncationTests.cs @@ -39,8 +39,8 @@ public class TruncationTests { var truncatedEvent = eventCrashReported.Truncate(3) as EventCrashReported; truncatedEvent.Should().NotBeNull(); - truncatedEvent?.Report.Executable.Should().Be("SOM"); - truncatedEvent?.Report.CallStack.Count.Should().Be(0); + truncatedEvent!.Report.Executable.Should().Be("SOM"); + truncatedEvent.Report.CallStack.Count.Should().Be(0); } [Fact] diff --git a/src/ApiService/Tests/packages.lock.json b/src/ApiService/Tests/packages.lock.json index eb2759f1b..8ed617827 100644 --- a/src/ApiService/Tests/packages.lock.json +++ b/src/ApiService/Tests/packages.lock.json @@ -17,6 +17,12 @@ "System.Configuration.ConfigurationManager": "4.4.0" } }, + "FluentAssertions.Analyzers": { + "type": "Direct", + "requested": "[0.21.0, )", + "resolved": "0.21.0", + "contentHash": "5CprzHStF627DqPytBnjRMXT2dvmXrP4XwVK4+jRllU5JH8SC6tytyyuOOd06tzjDPHU8YbDZ7/JtgJSiMb8RA==" + }, "FsCheck": { "type": "Direct", "requested": "[2.16.5, )",