Skip to content

Use AwesomeAssertions instead of Verify(Throws) APIs#6509

Merged
Evangelink merged 9 commits intomainfrom
dev/amauryleve/drop-verify
Oct 29, 2025
Merged

Use AwesomeAssertions instead of Verify(Throws) APIs#6509
Evangelink merged 9 commits intomainfrom
dev/amauryleve/drop-verify

Conversation

@Evangelink
Copy link
Copy Markdown
Member

Fixes #6214

@Evangelink Evangelink enabled auto-merge (squash) September 3, 2025 19:17
# Conflicts:
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/AssemblyResolverTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/LogMessageListenerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestSettingsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/PlatformServiceProviderTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DiaSessionOperationsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/FileOperationsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestSourceHostTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ThreadSafeStringWriterTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TraceListenerManagerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TraceListenerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DesktopReflectionUtilityTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13ReflectionUtilityTests.cs
#	test/UnitTests/MSTestAdapter.UnitTests/MSTestDiscovererTests.cs
#	test/UnitTests/MSTestAdapter.UnitTests/MSTestExecutorTests.cs
# Conflicts:
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestSettingsTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/PlatformServiceProviderTests.cs
#	test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/FileOperationsTests.cs
@Youssef1313 Youssef1313 requested a review from Copilot October 29, 2025 15:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request migrates the test assertion framework from a custom Verify/VerifyThrows pattern to the AwesomeAssertions library (FluentAssertions style). The changes involve:

  • Removing custom assertion helper methods (Verify, VerifyThrows, VerifyThrowsAsync, Fail) from the TestContainer base class
  • Converting all test assertions to use FluentAssertions syntax (e.g., .Should().Be(), .Should().Throw<T>())
  • Adding the AwesomeAssertions package reference to test projects
  • Updating hundreds of test assertions across the MSTest adapter test suite

Reviewed Changes

Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/Utilities/TestFramework.ForTestingMSTest/TestContainer.cs Removes custom assertion methods (Verify, VerifyThrows, VerifyThrowsAsync, Fail) and the IsVerifyException constant
test/UnitTests/MSTestAdapter.UnitTests/MSTestAdapter.UnitTests.csproj Adds AwesomeAssertions package reference
test/UnitTests/MSTestAdapter.UnitTests/MSTestExecutorTests.cs Converts Verify assertions to FluentAssertions style
test/UnitTests/MSTestAdapter.UnitTests/MSTestDiscovererTests.cs Converts Verify and VerifyThrows assertions to FluentAssertions style
Multiple test files in MSTestAdapter.PlatformServices.UnitTests Systematically converts all custom assertions to FluentAssertions across numerous test classes

@Evangelink Evangelink merged commit 0e37d06 into main Oct 29, 2025
13 of 14 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/drop-verify branch October 29, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure all our unit tests are using AwesomeAssertions

3 participants