Use AwesomeAssertions instead of Verify(Throws) APIs#6509
Merged
Evangelink merged 9 commits intomainfrom Oct 29, 2025
Merged
Conversation
# 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
reviewed
Oct 29, 2025
...itTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
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 theTestContainerbase class - Converting all test assertions to use FluentAssertions syntax (e.g.,
.Should().Be(),.Should().Throw<T>()) - Adding the
AwesomeAssertionspackage 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 |
test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs
Show resolved
Hide resolved
test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs
Show resolved
Hide resolved
Youssef1313
approved these changes
Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6214