diff --git a/CLAUDE.md b/CLAUDE.md index 0213087..1af19a1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,7 +49,11 @@ Novel Software: software for planning and writing a novel. ASP.NET Core 10, C#, - Don't write tests just for coverage. Call out missing coverage rather than cover stuff not valuable to end user. - Code not cleanly unit-testable → mark `[ExcludeFromCodeCoverage]` or exclude namespace from coverage in .runsettings file - BDD-style unit tests, end-to-end as possible. e.g. `Deleting_a_scene_leaves_its_beats_alone` -- xUnit + FluentAssertions +- NUnit. No FluentAssertions — assert with `Assert.That` and NUnit's constraint model: + `Assert.That(beat.SceneId, Is.Null)`, `Assert.That(listed, Has.Count.EqualTo(3))`, + `Assert.That(titles, Is.EqualTo(new[] { "First", "Second" }))` +- Grouping related asserts in `Assert.Multiple` beats a chain that stops at the first failure +- Expected exceptions: `Assert.That(() => service.Foo(), Throws.TypeOf())` - Tests run against real in-memory SQLite via `TestDatabase`, not the EF InMemory provider — cascade deletes and query translation must be exercised, and the InMemory provider fakes both - Model calls are faked at the `IAgentModelClient` seam (see `ScriptedModelClient`). Never hit the Anthropic API from a test. - No "Mock" in mocked object names