Remove AwesomeAssertions, use TUnit built-in assertions#49
Merged
BenjaminMichaelis merged 2 commits intoMay 17, 2026
Conversation
Migrate all test assertions from AwesomeAssertions (.Should().Be() etc.) to TUnit's native async fluent API (await Assert.That(...).IsEqualTo(...)). - Remove AwesomeAssertions from Directory.Packages.props and TrxLib.Tests.csproj - Update TrxParserTests, TestResultTests, TrxParserRegressionTests to use Assert.That with IsEqualTo / Contains / HasCount / HasSingleItem / IsNull / IsNotNull; drop AssertionScope in favour of sequential awaits - Change affected void test methods to async Task
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the AwesomeAssertions package and migrates all test assertions to TUnit's built-in async fluent assertion API. Test methods that now await an assertion were converted from void to async Task.
Changes:
- Drops the
AwesomeAssertionspackage reference fromDirectory.Packages.propsandTrxLib.Tests.csproj. - Rewrites all
Should()-style assertions in three test files toawait Assert.That(...)form, including replacingAssertionScopeusage with sequential awaits. - Converts affected
voidtest methods toasync Tasksignatures.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Removes the centralized AwesomeAssertions package version entry. |
| TrxLib.Tests/TrxLib.Tests.csproj | Removes the AwesomeAssertions package reference. |
| TrxLib.Tests/TrxParserTests.cs | Migrates all assertions to TUnit; converts tests to async Task; replaces ContainEquivalentOf with Contains and drops a because reason on one assertion. |
| TrxLib.Tests/TrxParserRegressionTests.cs | Migrates assertions to TUnit and makes tests async Task. |
| TrxLib.Tests/TestResultTests.cs | Migrates assertions to TUnit, replaces AssertionScope with sequential awaits, and reduces the NotThrow<T>() assertion to a bare invocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace .HasCount() with .Count().IsEqualTo() (obsolete API) - Add .Because() to Parse_NoNamespaceTrx assertion - Use Assert.That(...).ThrowsNothing() in ToString_DoesNotThrow test
github-actions Bot
pushed a commit
to BenjaminMichaelis/VS.TestPlaylistTools
that referenced
this pull request
May 19, 2026
[//]: # (dependabot-start)⚠️ **Dependabot is rebasing this PR**⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Updated [TrxLib](https://github.com/BenjaminMichaelis/TrxLib) from 0.0.3 to 1.0.0. <details> <summary>Release notes</summary> _Sourced from [TrxLib's releases](https://github.com/BenjaminMichaelis/TrxLib/releases)._ ## 1.0.0 ## Features - Cleaned up some TRX file bugs - Now AOT compliant! - Cleaned up a lot of misc tech debt ## What's Changed * Bump actions/checkout from 5 to 6 by @dependabot[bot] in BenjaminMichaelis/TrxLib#20 * Bump actions/upload-artifact from 5 to 6 by @dependabot[bot] in BenjaminMichaelis/TrxLib#22 * Bump Microsoft.SourceLink.GitHub from 8.0.0 to 10.0.102 by @dependabot[bot] in BenjaminMichaelis/TrxLib#23 * Bump coverlet.collector from 6.0.4 to 8.0.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#24 * Bump Microsoft.SourceLink.GitHub from 10.0.102 to 10.0.103 by @dependabot[bot] in BenjaminMichaelis/TrxLib#25 * Bump AwesomeAssertions from 9.3.0 to 9.4.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#26 * Bump actions/download-artifact from 6 to 8 by @dependabot[bot] in BenjaminMichaelis/TrxLib#28 * Bump IntelliTect.Multitool from 1.5.3 to 2.0.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#29 * Bump Microsoft.NET.Test.Sdk from 18.0.1 to 18.3.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#30 * Bump Microsoft.SourceLink.GitHub from 10.0.103 to 10.0.201 by @dependabot[bot] in BenjaminMichaelis/TrxLib#31 * Bump coverlet.collector from 8.0.0 to 8.0.1 by @dependabot[bot] in BenjaminMichaelis/TrxLib#32 * Bump fastify/github-action-merge-dependabot from 3.11.2 to 3.12.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#33 * Bump Microsoft.NET.Test.Sdk from 18.3.0 to 18.4.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#34 * Bump Microsoft.SourceLink.GitHub from 10.0.201 to 10.0.202 by @dependabot[bot] in BenjaminMichaelis/TrxLib#36 * Bump coverlet.collector from 8.0.1 to 10.0.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#35 * Bump Microsoft.SourceLink.GitHub from 10.0.202 to 10.0.203 by @dependabot[bot] in BenjaminMichaelis/TrxLib#37 * Bump Microsoft.NET.Test.Sdk from 18.4.0 to 18.5.1 by @dependabot[bot] in BenjaminMichaelis/TrxLib#38 * feat: Migrate NuGet publish to trusted publishing (OIDC) by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#39 * Migrate to slnx solution file format by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#40 * fix: TRX parser data-loss bugs and FQTN derivation spec compliance by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#42 * fix: Refactor TestOutcome enum with updated summaries by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#43 * fix: add missing vstest outcomes and fix directory heuristic for RID paths by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#46 * fix: missing vstest outcomes, TestProjectDirectory heuristic, xmlns fallback by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#47 * Migrate from xUnit to TUnit and adopt Microsoft.Testing.Platform v2 by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#48 * Remove AwesomeAssertions, use TUnit built-in assertions by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#49 * Bump IntelliTect.Multitool from 2.0.0 to 2.1.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#50 * Bump TUnit from 1.44.39 to 1.45.0 by @dependabot[bot] in BenjaminMichaelis/TrxLib#52 * Bump Microsoft.SourceLink.GitHub from 10.0.203 to 10.0.300 by @dependabot[bot] in BenjaminMichaelis/TrxLib#51 * chore: align project configuration with NuGet library template best practices by @BenjaminMichaelis in BenjaminMichaelis/TrxLib#53 **Full Changelog**: BenjaminMichaelis/TrxLib@v0.0.3...v1.0.0 Commits viewable in [compare view](BenjaminMichaelis/TrxLib@v0.0.3...v1.0.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
TUnit ships its own async fluent assertion API so AwesomeAssertions is an unnecessary dependency that can be dropped.
What changed
AwesomeAssertionsfromDirectory.Packages.propsandTrxLib.Tests.csproj.x.Should().Be(y)->await Assert.That(x).IsEqualTo(y)x.Should().Contain(y)->await Assert.That(x).Contains(y)x.Should().HaveCount(n)->await Assert.That(x).HasCount(n)x.Should().ContainSingle(pred)->await Assert.That(x).HasSingleItem(pred)x.Should().NotBeNull()/.BeNull()->await Assert.That(x).IsNotNull()/.IsNull()act.Should().NotThrow<T>()-> direct invocation (TUnit surfaces exceptions automatically)AssertionScopeblocks -> sequentialawait Assert.That(...)callsvoidtest methods that now useawaitwere updated toasync Task.All 65 tests pass after the migration.