Skip to content

Commit a5e49f5

Browse files
committed
docs(readme): add value proposition (Why Atc.Test) and adjust wording
1 parent b59a611 commit a5e49f5

File tree

1 file changed

+61
-30
lines changed

1 file changed

+61
-30
lines changed

README.md

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,62 @@
44

55
`Atc.Test` is a .NET helper library that streamlines authoring tests with xUnit v3, AutoFixture, NSubstitute, and FluentAssertions. It provides rich data attributes, automatic specimen customization, and ergonomic frozen value reuse to reduce ceremony and improve test readability.
66

7+
## Why Atc.Test
8+
9+
> You can “just wire everything manually” with plain xUnit and hand‑rolled mocks—so why use this instead?
10+
11+
| Problem Without | What You Gain With `Atc.Test` | Why It Matters Over Time |
12+
|-----------------|-------------------------------|--------------------------|
13+
| Repeating constructor/mocker boilerplate in every test | Parameter-only intent: you list just what the test cares about | Lower cognitive load; faster review – noise removed |
14+
| Fragile refactors (add a ctor param ⇒ touch many files) | Fixture-driven auto‑supply of new dependencies | Constructor churn becomes O(1) instead of O(N tests) |
15+
| Divergent ad‑hoc mock styles (naming, setup order) | Central factory + consistent frozen reuse semantics | Suite stays uniform; easier large-scale edits / audits |
16+
| Accidental duplicate substitutes for logically single collaborator | `[Frozen]` exact-type reuse + early supplied promotion (member data) | Prevents subtle mismatch bugs & expectation gaps |
17+
| Manual re-creation of “shared conventions” (recursion handling, generators) | One-time customization via `[AutoRegister]` | New test inherits standards automatically |
18+
| AI-generated setup drifts over time | Declarative attributes act as a stable policy layer | Reduces maintenance & future prompt dependency |
19+
20+
### When It Delivers the Most Value
21+
22+
* Mid/large test suites (hundreds+ of theory cases).
23+
* Domain services with evolving constructor graphs / dependencies.
24+
* Teams that value refactor safety and consistent test style.
25+
* Situations where only a few parameters per test truly matter.
26+
27+
### When Bare xUnit (+ manual mocks) May Be Enough
28+
29+
* Very small or short‑lived codebases.
30+
* Highly bespoke object graphs where you override almost every generated value anyway.
31+
* Educational contexts emphasizing explicit wiring for learning.
32+
33+
### Summary
34+
35+
`Atc.Test` trades a tiny amount of initial abstraction for compounding savings in refactors, readability, and consistency. AI can quickly generate boilerplate; this library’s value is eliminating the need for that boilerplate in the first place—and giving you a single, policy‑driven locus for customization and reuse.
36+
737
## Table of Content
838

9-
- [Introduction](#introduction)
10-
- [Table of Content](#table-of-content)
11-
- [Features](#features)
12-
- [Getting Started](#getting-started)
13-
- [Install Package](#install-package)
14-
- [Why xUnit Must Be Referenced Directly](#why-xunit-must-be-referenced-directly)
15-
- [First Test Examples](#first-test-examples)
16-
- [Advanced Usage](#advanced-usage)
17-
- [Frozen Reuse Scenarios](#frozen-reuse-scenarios)
18-
- [Auto Registration of Customizations](#auto-registration-of-customizations)
19-
- [Helper Extensions](#helper-extensions)
20-
- [Requirements](#requirements)
21-
- [How to Contribute](#how-to-contribute)
39+
* [Introduction](#introduction)
40+
* [Why Atc.Test](#why-atctest)
41+
* [Table of Content](#table-of-content)
42+
* [Features](#features)
43+
* [Getting Started](#getting-started)
44+
* [Install Package](#install-package)
45+
* [Why xUnit Must Be Referenced Directly](#why-xunit-must-be-referenced-directly)
46+
* [First Test Examples](#first-test-examples)
47+
* [Advanced Usage](#advanced-usage)
48+
* [Frozen Reuse Scenarios](#frozen-reuse-scenarios)
49+
* [Auto Registration of Customizations](#auto-registration-of-customizations)
50+
* [Helper Extensions](#helper-extensions)
51+
* [Requirements](#requirements)
52+
* [How to Contribute](#how-to-contribute)
2253

2354
## Features
2455

25-
- Data attributes integrating AutoFixture + NSubstitute: `AutoNSubstituteData`, `InlineAutoNSubstituteData`, `MemberAutoNSubstituteData`, `ClassAutoNSubstituteData`.
26-
- Automatic interface/abstract substitution via NSubstitute.
27-
- Exact-type frozen promotion for member data (reuse supplied instance across later `[Frozen]` parameters).
28-
- Deterministic fixture configuration with opt‑in auto-registration of custom `ICustomization` / `ISpecimenBuilder` via `[AutoRegister]`.
29-
- Convenience extensions: equivalency options, substitute inspection helpers, task timeout helpers, object protected member access.
30-
- Multi-targeted (netstandard2.1, net8.0, net9.0) for broad compatibility.
31-
- Clear separation of concerns: you own the xUnit runner/version.
56+
* Data attributes integrating AutoFixture + NSubstitute: `AutoNSubstituteData`, `InlineAutoNSubstituteData`, `MemberAutoNSubstituteData`, `ClassAutoNSubstituteData`.
57+
* Automatic interface/abstract substitution via NSubstitute.
58+
* Exact-type frozen promotion for member data (reuse supplied instance across later `[Frozen]` parameters).
59+
* Deterministic fixture configuration with opt‑in auto-registration of custom `ICustomization` / `ISpecimenBuilder` via `[AutoRegister]`.
60+
* Convenience extensions: equivalency options, substitute inspection helpers, task timeout helpers, object protected member access.
61+
* Multi-targeted (netstandard2.1, net8.0, net9.0) for broad compatibility.
62+
* Clear separation of concerns: you own the xUnit runner/version.
3263

3364
## Getting Started
3465

@@ -55,20 +86,20 @@ Add `Atc.Test` to your test project along with explicit references to xUnit and
5586

5687
`Atc.Test` depends on `xunit.v3.extensibility.core` (the extensibility surface) but intentionally does **not** bring in the `xunit.v3` meta-package:
5788

58-
- Avoid NU1701 warnings from runner assets not targeting `netstandard2.1`.
59-
- Let you pin or float the xUnit version independently.
60-
- Keep framework + runner decisions in your test project for predictable upgrades.
61-
- Preserve the library’s focus: providing attributes/utilities instead of prescribing test infrastructure.
89+
* Avoid NU1701 warnings from runner assets not targeting `netstandard2.1`.
90+
* Let you pin or float the xUnit version independently.
91+
* Keep framework + runner decisions in your test project for predictable upgrades.
92+
* Preserve the library’s focus: providing attributes/utilities instead of prescribing test infrastructure.
6293

6394
If you want a different xUnit patch/minor version, change the `<PackageReference Include="xunit.v3" ... />` line—no changes to `Atc.Test` required.
6495

6596
#### xUnit v3 Only (Incompatible With v2)
6697

6798
`Atc.Test` relies on xUnit v3 extensibility APIs:
6899

69-
- Async data attribute signature: `ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(...)`.
70-
- `ITheoryDataRow` & metadata (Label, Explicit, Timeout) preservation.
71-
- `DisposalTracker` parameter passed to data attributes.
100+
* Async data attribute signature: `ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(...)`.
101+
* `ITheoryDataRow` & metadata (Label, Explicit, Timeout) preservation.
102+
* `DisposalTracker` parameter passed to data attributes.
72103

73104
These do not exist in xUnit v2. Attempting to use a v2 framework or runner will result in discovery failures or compile errors.
74105

@@ -195,9 +226,9 @@ public void Different_Interface_Not_Promoted(
195226

196227
Design Rationale:
197228

198-
- Class data is usually fully positional—implicit promotion might hide mistakes.
199-
- Member data often supplies only a prefix—promotion reduces duplication while staying explicit.
200-
- Exact-type restriction avoids cross-interface bleed (e.g., dual implementations hijacking unrelated abstractions).
229+
* Class data is usually fully positional—implicit promotion might hide mistakes.
230+
* Member data often supplies only a prefix—promotion reduces duplication while staying explicit.
231+
* Exact-type restriction avoids cross-interface bleed (e.g., dual implementations hijacking unrelated abstractions).
201232

202233
### Auto Registration of Customizations
203234

0 commit comments

Comments
 (0)