--- applyTo: "Fuchs.Tests/**,**/*Tests/**,**/*Tests.cs" --- # Testing Instructions ## Framework - Tests use **xUnit** on **.NET 10** (e.g., `Fuchs.Tests`). - Run via Visual Studio Test Explorer or `dotnet test`. ## Conventions - One test class per unit under test; name it `Tests`. - Name test methods `Method_Scenario_ExpectedResult` (e.g., `ReadBalance_EmptyString_ThrowsInvalidDataException`). - Use `[Theory]` + `[InlineData]` for parameterized cases; `[Fact]` for single cases. - Arrange / Act / Assert structure; keep tests deterministic and independent (no shared mutable state, no real network/DB calls). ## What to Cover - Pure parsing/algorithmic helpers (MT940 parsing, date/decimal parsing, HTML cleanup, OData envelope handling, entity helpers) — these are the highest-value, side-effect-free targets. - For library classes that accept `ILogger?`, pass `NullLogger.Instance` (or a test logger) in tests. ## Workflow - After any code change, build the full solution and run the affected test project before concluding. - Treat a green run (e.g., `Fuchs.Tests` all passing) as the validation gate; never leave the suite red. - When fixing a bug, add or update a test that reproduces it where practical.