View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.UnitTesting

Helpers for unit tests, like test doubles for processors and responses, in small projects the developer picks from.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

The core service is free of technology, so its unit tests need no database. They replace the query and command processors with test doubles. Every service writes the same doubles again. A shared module saves that work and makes the tests look the same everywhere.

The module is a toolbox of small projects. A fake command processor lives in its own project, a fake query processor in another, and so on. A developer references only the ones they need, so a test project does not pull in fakes for modules it does not use.

What we already know

From the root readme:

From the demo:

From the repository:

From the existing modules:

Decisions and open questions

Decided

Topic Decision
Name Cat.UnitTesting, renamed from Cat.Testing.
Purpose Test doubles and helpers for unit tests, such as the core service tests.
Structure Many small projects, each with one fake or helper, such as the fake command processor and the fake query processor. The developer picks what they need.
Cat.NUnit tests/Cat.NUnit becomes part of this module in the end.
No database The unit tests never need a database.

Open

Questions before building

  1. Do you want one project per fake, or one project per CAT module?
  2. Should the framework neutral fakes live apart from the NUnit parts?
  3. Do you want one generic fake processor to replace the demo versions?
  4. Which doubles do you need first: processors, responses, user, event aggregator or time?
  5. Do we add assertion helpers for ICatResponse?
  6. When does tests/Cat.NUnit move into the module, and under which project name?
  7. Are integration test helpers out of scope for this module?
  8. Do we build this first from the demo test code, as the Aspire plan did for the API client?
  9. Do the fakes need to match the real behavior, such as filling ids, or stay dumb on purpose?
  10. Who is the audience: users of the toolkit, the repository tests, or both?