From f4366ffdb2ddd1aa9f2a0c1e680c71733d894932 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:02:22 +0000 Subject: [PATCH 1/2] Bump Meziantou.Analyzer from 2.0.127 to 2.0.132 Bumps [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) from 2.0.127 to 2.0.132. - [Release notes](https://github.com/meziantou/Meziantou.Analyzer/releases) - [Commits](https://github.com/meziantou/Meziantou.Analyzer/compare/2.0.127...2.0.132) --- updated-dependencies: - dependency-name: Meziantou.Analyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 4001b419f..7707e2941 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,7 +34,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 4f89147481dbbfceffa1a888b1a4fae06e5650ec Mon Sep 17 00:00:00 2001 From: Jonas Nyrup Date: Thu, 4 Jan 2024 20:44:35 +0100 Subject: [PATCH 2/2] Disable MA0147 for intentional use of async+void --- .../Exceptions/AsyncFunctionExceptionAssertionSpecs.cs | 2 ++ Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs index eeff68e60..c0b81c10d 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs @@ -1022,6 +1022,7 @@ public async Task When_async_method_does_not_throw_the_expected_exception_it_sho await action.Should().ThrowAsync().WithMessage("*InvalidOperation*Argument*"); } +#pragma warning disable MA0147 [Fact] public void When_asserting_async_void_method_should_throw_it_should_fail() { @@ -1077,6 +1078,7 @@ public void When_asserting_async_void_method_should_not_throw_specific_exception // Assert action.Should().Throw("*async*void*"); } +#pragma warning restore MA0147 [Fact] public async Task When_a_method_throws_with_a_matching_parameter_name_it_should_succeed() diff --git a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs index 2d5ebaeec..04013c0a3 100644 --- a/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs +++ b/Tests/FluentAssertions.Specs/Exceptions/NotThrowSpecs.cs @@ -104,7 +104,7 @@ public void When_subject_is_null_when_it_should_not_throw_it_should_throw() .Where(e => !e.Message.Contains("NullReferenceException")); } -#pragma warning disable CS1998 +#pragma warning disable CS1998, MA0147 [Fact] public void When_subject_is_async_it_should_throw() { @@ -119,7 +119,7 @@ public void When_subject_is_async_it_should_throw() action.Should().Throw() .WithMessage("Cannot use action assertions on an async void method.*"); } -#pragma warning restore CS1998 +#pragma warning restore CS1998, MA0147 [Fact] public void When_wait_time_is_negative_it_should_throw()