Skip to content

Add Atc.Rest.AwesomeAssertions and migrate tests off FluentAssertions#363

Merged
perkops merged 5 commits into
mainfrom
feat/atc-rest-awesomeassertions
Jun 24, 2026
Merged

Add Atc.Rest.AwesomeAssertions and migrate tests off FluentAssertions#363
perkops merged 5 commits into
mainfrom
feat/atc-rest-awesomeassertions

Conversation

@perkops

@perkops perkops commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Atc.Rest.AwesomeAssertions as the AwesomeAssertions twin
  • Adopt Atc.Test 3.0.0, which swaps FluentAssertions for AwesomeAssertions
  • Move the whole test suite to AwesomeAssertions
  • Keep Atc.Rest.FluentAssertions (and its tests) on FluentAssertions
  • Drop redundant ICSharpCode.Decompiler references

Changes

✨ Features

  • Add Atc.Rest.AwesomeAssertions library (net9.0;net10.0)
  • Port result assertions to the AwesomeAssertions 9.x AssertionChain API
  • Add Atc.Rest.AwesomeAssertions.Tests with chained-API coverage
  • Register both new projects in Atc.slnx

📦 Dependencies

  • Bump Atc.Test 2.0.17 to 3.0.0 (brings AwesomeAssertions 9.4.0)
  • Swap the solution-wide test global using to AwesomeAssertions

♻️ Refactoring

  • Rename HaveCountGreaterOrEqualTo to HaveCountGreaterThanOrEqualTo
  • Point Atc.XUnit.Tests global using at AwesomeAssertions
  • Opt Atc.Rest.FluentAssertions.Tests out of the AA global using

📝 Documentation

  • Recommend Atc.Rest.AwesomeAssertions in the FluentAssertions README
  • Add README and generated CodeDoc for the new library

🔥 Removal

  • Remove redundant ICSharpCode.Decompiler refs from test projects
  • It flows transitively from the Atc.XUnit project reference

Notes

  • Direct WithContentOfType messages now carry an AwesomeAssertions
    caller fragment (/return Subject.Value); behavior is unchanged.

Per Kops added 4 commits June 24, 2026 13:14
Atc.Test 3.0.0 swaps its transitive assertion dependency from FluentAssertions to
AwesomeAssertions (the Apache-2.0 fork of FluentAssertions 7.x), so the solution-wide
global using is switched accordingly.

- Bump Atc.Test 2.0.17 -> 3.0.0 and swap the global Using FluentAssertions -> AwesomeAssertions.
- Atc.Tests: rename HaveCountGreaterOrEqualTo -> HaveCountGreaterThanOrEqualTo (renamed in the fork).
- Atc.XUnit.Tests: switch the explicit FluentAssertions global using to AwesomeAssertions.
- Atc.Rest.FluentAssertions.Tests: opt out of the AwesomeAssertions global using and keep
  FluentAssertions, since it tests the FluentAssertions-based library; also drop the redundant
  ICSharpCode.Decompiler reference (it flows transitively from Atc.XUnit).
…pers

Adds Atc.Rest.AwesomeAssertions, the AwesomeAssertions counterpart of
Atc.Rest.FluentAssertions, providing expressive assertions for Atc REST domain handler
results (BeOkResult, BeNotFoundResult, WithContent, WithErrorMessage, etc.).

AwesomeAssertions is a general-purpose assertion library and has no built-in assertions for
Atc REST result types, so a dedicated package is warranted. The custom assertions are
rewritten against AwesomeAssertions 9.4.0's AssertionChain API (Execute.Assertion was removed
and ReferenceTypeAssertions now takes an AssertionChain), so it is not a verbatim copy.

- New library (multi-targets net9.0;net10.0) referencing AwesomeAssertions 9.4.0.
- New Atc.Rest.AwesomeAssertions.Tests project mirroring the FluentAssertions tests, with
  message expectations reconciled to AwesomeAssertions 9.x output plus chained-API coverage.
- Register both projects in Atc.slnx and add generated CodeDoc.
Add a callout pointing users to the new Atc.Rest.AwesomeAssertions package, which offers the
same helpers on the actively maintained Apache-2.0 fork, and note why this package stays pinned
to FluentAssertions 7.2.1.
ICSharpCode.Decompiler flows transitively from the Atc.XUnit project reference (it is declared
there without PrivateAssets), so the explicit per-project PackageReference and its ItemGroup are
redundant. Remove them from the remaining test projects.
davidkallesen
davidkallesen previously approved these changes Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Atc.Rest.AwesomeAssertions library (an AwesomeAssertions-based counterpart to Atc.Rest.FluentAssertions) and migrates the solution-wide test suite to use AwesomeAssertions via Atc.Test 3.0.0, while explicitly keeping Atc.Rest.FluentAssertions (and its tests) on FluentAssertions.

Changes:

  • Added Atc.Rest.AwesomeAssertions (net9.0/net10.0) and a new dedicated test project with chained-API coverage and generated CodeDoc output.
  • Migrated test global usings from FluentAssertions to AwesomeAssertions and updated assertion helper naming (HaveCountGreaterOrEqualToHaveCountGreaterThanOrEqualTo).
  • Removed redundant ICSharpCode.Decompiler package references from test projects and registered new projects in Atc.slnx.

Reviewed changes

Copilot reviewed 54 out of 54 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
test/Directory.Build.props Bumps Atc.Test to 3.0.0 and switches test global using to AwesomeAssertions.
test/Atc.XUnit.Tests/GlobalUsings.cs Switches test project global using from FluentAssertions to AwesomeAssertions.
test/Atc.XUnit.Tests/Atc.XUnit.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Tests/Helpers/CultureHelperTests.cs Updates renamed collection-count assertion helper.
test/Atc.Tests/Extensions/Reflection/AssemblyExtensionsTests.cs Updates renamed collection-count assertion helper.
test/Atc.Tests/Atc.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Rest.Tests/Atc.Rest.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Rest.HealthChecks.Tests/Atc.Rest.HealthChecks.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Rest.FluentAssertions.Tests/Atc.Rest.FluentAssertions.Tests.csproj Opts out of AwesomeAssertions global using and restores FluentAssertions for this project.
test/Atc.Rest.Extended.Tests/Atc.Rest.Extended.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Rest.AwesomeAssertions.Tests/XUnitTestData/TestJsonSerializer.cs Adds test helper for consistent JSON serialization in new AA test project.
test/Atc.Rest.AwesomeAssertions.Tests/XUnitTestData/TestDataAssertions.cs Adds shared MemberData for error-message content scenarios.
test/Atc.Rest.AwesomeAssertions.Tests/GlobalUsings.cs Adds global usings needed by the new AA test project.
test/Atc.Rest.AwesomeAssertions.Tests/Extensions/ResultBaseExtensionsTests.cs Adds tests for ResultBase.Should() chaining behavior with AA.
test/Atc.Rest.AwesomeAssertions.Tests/CodeDocumentationTests.cs Adds Markdown CodeDoc generator “test” for new library docs output.
test/Atc.Rest.AwesomeAssertions.Tests/CodeComplianceTests.cs Adds code compliance checks for the new library.
test/Atc.Rest.AwesomeAssertions.Tests/Atc.Rest.AwesomeAssertions.Tests.csproj Introduces the new AA test project and references required projects.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ResultAssertionsTests.cs Adds assertion tests for ResultAssertions (type/status-code behaviors).
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/OkResultAssertionsTests.cs Adds assertion tests for OK result content/type assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/NotFoundResultAssertionsTests.cs Adds assertion tests for 404 result content and error-message assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/NoContentResultAssertionsTests.cs Adds assertion tests for 204 content assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/CreatedResultAssertionsTests.cs Adds assertion tests for 201 created result content assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ContentResultAssertionsTests.cs Adds assertion tests for generic content result assertions and status-code checks.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ContentResultAssertionsBaseFixture.cs Adds shared fixture for constructing JSON ContentResult test subjects.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ConflictResultAssertionsTests.cs Adds assertion tests for 409 result content and error-message assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/BadRequestResultAssertionsTests.cs Adds assertion tests for 400 result content and error-message assertions.
test/Atc.Rest.AwesomeAssertions.Tests/Assertions/AcceptedResultAssertionsTests.cs Adds assertion tests for 202 accepted result content assertions.
test/Atc.OpenApi.Tests/Atc.OpenApi.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.DotNet.Tests/Atc.DotNet.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.Console.Spectre.Tests/Atc.Console.Spectre.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.CodeDocumentation.Tests/Atc.CodeDocumentation.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
test/Atc.CodeAnalysis.CSharp.Tests/Atc.CodeAnalysis.CSharp.Tests.csproj Removes redundant ICSharpCode.Decompiler package reference.
src/Atc.Rest.FluentAssertions/README.md Recommends the new AA package and explains FluentAssertions licensing constraints.
src/Atc.Rest.AwesomeAssertions/README.md Adds documentation for the new AA assertion library.
src/Atc.Rest.AwesomeAssertions/GlobalUsings.cs Adds global usings for AA-based assertion implementation.
src/Atc.Rest.AwesomeAssertions/Extensions/ResultBaseExtensions.cs Adds ResultBase.Should() extension that returns ResultAssertions using AssertionChain.
src/Atc.Rest.AwesomeAssertions/AtcRestAwesomeAssertionsAssemblyTypeInitializer.cs Adds assembly type initializer marker for CodeDoc/compliance tooling.
src/Atc.Rest.AwesomeAssertions/Atc.Rest.AwesomeAssertions.csproj Adds new multi-targeted package project referencing AwesomeAssertions 9.4.0 and Atc.Rest.
src/Atc.Rest.AwesomeAssertions/Assertions/ResultAssertions.cs Implements AA-style assertions for ActionResult and derived result-type helpers.
src/Atc.Rest.AwesomeAssertions/Assertions/OkResultAssertions.cs Implements AA-style assertions for OkObjectResult content/type checks.
src/Atc.Rest.AwesomeAssertions/Assertions/NotFoundResultAssertions.cs Implements AA-style assertions for 404 content result + error-message checks.
src/Atc.Rest.AwesomeAssertions/Assertions/NoContentResultAssertions.cs Implements AA-style assertions for 204 content result.
src/Atc.Rest.AwesomeAssertions/Assertions/ForbiddenResultAssertions.cs Implements AA-style assertions for 403 content result + error-message checks.
src/Atc.Rest.AwesomeAssertions/Assertions/ErrorContentResultAssertions.cs Adds shared error-message assertion logic for error result types.
src/Atc.Rest.AwesomeAssertions/Assertions/CreatedResultAssertions.cs Implements AA-style assertions for 201 content result.
src/Atc.Rest.AwesomeAssertions/Assertions/ContentResultAssertionsBase.cs Implements shared JSON content parsing and typed-content assertions for ContentResult.
src/Atc.Rest.AwesomeAssertions/Assertions/ContentResultAssertions.cs Implements status-code assertions for ContentResult.
src/Atc.Rest.AwesomeAssertions/Assertions/ConflictResultAssertions.cs Implements AA-style assertions for 409 content result + error-message checks.
src/Atc.Rest.AwesomeAssertions/Assertions/BadRequestResultAssertions.cs Implements AA-style assertions for 400 content result + error-message checks.
src/Atc.Rest.AwesomeAssertions/Assertions/AcceptedResultAssertions.cs Implements AA-style assertions for 202 content result.
docs/CodeDoc/Atc.Rest.AwesomeAssertions/IndexExtended.md Adds generated CodeDoc index (extended) for the new AA library.
docs/CodeDoc/Atc.Rest.AwesomeAssertions/Index.md Adds generated CodeDoc index for the new AA library.
docs/CodeDoc/Atc.Rest.AwesomeAssertions/Atc.Rest.AwesomeAssertions.md Adds generated CodeDoc content for the new AA library.
Atc.slnx Registers the new AA library and its test project in the solution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ContentResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/NotFoundResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ConflictResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/CreatedResultAssertionsTests.cs Outdated
Comment thread test/Atc.Rest.AwesomeAssertions.Tests/Assertions/ContentResultAssertionsTests.cs Outdated
Fix pre-existing naming issues carried into both the AwesomeAssertions and FluentAssertions
REST assertion test suites (flagged in review):

- Doenst -> Doesnt in WithErrorMessage test names.
- Does_Not_Throws -> Does_Not_Throw grammar fix.
- 'Github' -> 'GitHub' in TODO comments.
- BeCreatedResult status-code test names 202 -> 201 (Created is 201).
- BeConflictResult passes test name 404 -> 409 (Conflict is 409).
@perkops perkops merged commit c3b6cd0 into main Jun 24, 2026
4 checks passed
@perkops perkops deleted the feat/atc-rest-awesomeassertions branch June 24, 2026 11:44
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.

3 participants