Testing and Tooling

Read Testing and Tooling as a C# habit shift, with links to the Musi Book definition.

A C# reader brings habits from nullable flow analysis, records, LINQ, async tasks, extension methods, interfaces, namespaces, and attributes. That helps with domain code through named APIs and tooling feedback, but the Musi page asks a narrower question: what contract should this tests as domain promises example make visible?

csharp
[Fact]
public void AddsReceiptLines() {
    Assert.Equal(570, 450 + 120);
}

Reading Testing and Tooling from C#

On the Musi side, Musi tests should state the domain promise first, then check the function or value that proves it. Read the shared example through C# eyes: keep the useful instinct, then let Musi name shape, behavior, absence, and outside work in separate places.

False friend

Do not write a test that only proves syntax can be called. Make the receipt, route, badge, or parser claim visible. For a C# reader, the trap is mapping Musi classes to object classes or service containers; Musi class is a typeclass-style behavior contract, not a CLR class with fields, constructors, and inheritance.

When this pays off

Use this style when a future reader needs to know which behavior broke, not only which line failed. The C# instinct still helps here: Keep the C# habit of making api shape readable at the call site.

Keep close