From 843695505bc6de610003e58be493ac2c20bd40b3 Mon Sep 17 00:00:00 2001 From: Antoine Griffard Date: Wed, 1 Nov 2023 15:27:44 +0100 Subject: [PATCH 1/2] xunit 2.6.0 --- src/OrchardCore.Build/Dependencies.props | 2 +- src/docs/resources/libraries/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index f9ca162e656..f4f905a8f23 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -58,7 +58,7 @@ - + diff --git a/src/docs/resources/libraries/README.md b/src/docs/resources/libraries/README.md index ce37b60dc00..9c10dae4571 100644 --- a/src/docs/resources/libraries/README.md +++ b/src/docs/resources/libraries/README.md @@ -95,6 +95,6 @@ The below table lists the different Tests libraries: | [Cypress Orchard](https://www.npmjs.com/package/cypress-orchardcore) | A collection of cypress commands for Orchard Core. | 0.4.5 | MIT | | [Moq](https://github.com/moq/moq) | The most popular and friendly mocking framework for .NET. | 4.18.4 | [MIT](https://github.com/moq/moq/blob/main/LICENSE) | | [VS Test SDK](https://github.com/microsoft/vstest/) | Visual Studio Test Platform. | 17.7.2 | [MIT](https://github.com/microsoft/vstest/blob/master/LICENSE) | -| [xUnit](https://github.com/xunit/xunit) | Free, open source, community-focused unit testing tool for the .NET Framework. | 2.5.3 | [MIT](https://github.com/xunit/xunit/blob/main/LICENSE) | +| [xUnit](https://github.com/xunit/xunit) | Free, open source, community-focused unit testing tool for the .NET Framework. | 2.6.0 | [MIT](https://github.com/xunit/xunit/blob/main/LICENSE) | | [xUnit Analyzers](https://github.com/xunit/xunit.analyzers) | Roslyn analyzers for xUnit.net. | 1.4.0 | [MIT](https://github.com/xunit/xunit.analyzers/blob/main/LICENSE) | | [xUnit VS runner](https://github.com/xunit/visualstudio.xunit) | VSTest runner for xUnit.net. | 2.5.3 | [MIT](https://github.com/xunit/visualstudio.xunit/blob/main/License.txt) | From a9ff2867ce7aac0b11e2a8ffae5dd885bdf1f91e Mon Sep 17 00:00:00 2001 From: Antoine Griffard Date: Wed, 1 Nov 2023 16:00:43 +0100 Subject: [PATCH 2/2] Fix ambiguities --- .../Commands/CommandHandlerTests.cs | 12 ++++++------ .../Localization/CultureScopeTests.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs index cfe54fb51f4..5d857593904 100644 --- a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs @@ -52,7 +52,7 @@ public async Task TestFooCommand() [Fact] public async Task TestNotExistingCommand() { - await Assert.ThrowsAsync(async () => + await Assert.ThrowsAsync(async Task () => { var commandContext = CreateCommandContext("NoSuchCommand"); await _handler.ExecuteAsync(commandContext); @@ -118,7 +118,7 @@ public async Task TestSwitchForCommandWithoutSupportForIt() { var switches = new Dictionary { { "User", "OrchardUser" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async Task () => await _handler.ExecuteAsync(commandContext)); } [Fact] @@ -134,7 +134,7 @@ public async Task TestNotExistingSwitch() { var switches = new Dictionary { { "ThisSwitchDoesNotExist", "Insignificant" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async Task () => await _handler.ExecuteAsync(commandContext)); } [Fact] @@ -175,21 +175,21 @@ public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndA public async Task TestCommandParamsMismatchWithoutParamsNotEnoughArguments() { var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async Task () => await _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithoutParamsTooManyArguments() { var commandContext = CreateCommandContext("Foo", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async Task () => await _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithParamsButNotEnoughArguments() { var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary()); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async Task () => await _handler.ExecuteAsync(commandContext)); } } diff --git a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs index 613e237d6d6..748fa03cdd8 100644 --- a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs +++ b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs @@ -59,7 +59,7 @@ public async Task CultureScopeSetsOrginalCulturesOnException() var uiCulture = CultureInfo.CurrentUICulture; // Act & Assert - await Assert.ThrowsAsync(() => + await Assert.ThrowsAsync(Task () => { using var cultureScope = CultureScope.Create("FR"); throw new Exception("Something goes wrong!!");