The backend half of the sweep RD-18 did for the front end. git blame holds the provenance and stays correct when the code moves; the comment names a closed ticket and tells the reader nothing the sentence around it does not. public/letter.css and LetterHtml.golden.html change together, because the renderer inlines the CSS and the golden file snapshots the result. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
44 lines
1.9 KiB
C#
44 lines
1.9 KiB
C#
using BigRegister.Domain.Intake;
|
|
|
|
namespace BigRegister.Tests.Domain;
|
|
|
|
public class IntakeRuleTests
|
|
{
|
|
// The arguments ARE the Given (bdd.mdx) — these degenerate to When/Then.
|
|
|
|
[Fact]
|
|
public void Below_threshold_with_no_answer_is_incomplete() =>
|
|
Assert.NotNull(IntakePolicy.RejectIncompleteScholing(999, aanvullendeScholing: null, scholingPunten: null));
|
|
|
|
[Fact]
|
|
public void At_the_threshold_no_answer_is_required() =>
|
|
// Pins `<` vs `<=` — lageUren's own boundary.
|
|
Assert.Null(IntakePolicy.RejectIncompleteScholing(1000, aanvullendeScholing: null, scholingPunten: null));
|
|
|
|
[Fact]
|
|
public void Niet_gevolgd_is_a_complete_answer_below_threshold() =>
|
|
// "nee" is legal — this WP is completeness, not merit (§1's scope).
|
|
Assert.Null(IntakePolicy.RejectIncompleteScholing(500, aanvullendeScholing: false, scholingPunten: null));
|
|
|
|
[Fact]
|
|
public void Gevolgd_without_punten_is_incomplete() =>
|
|
Assert.NotNull(IntakePolicy.RejectIncompleteScholing(500, aanvullendeScholing: true, scholingPunten: null));
|
|
|
|
[Fact]
|
|
public void Gevolgd_with_zero_punten_is_valid() =>
|
|
Assert.Null(IntakePolicy.RejectIncompleteScholing(500, aanvullendeScholing: true, scholingPunten: 0));
|
|
|
|
[Fact]
|
|
public void Gevolgd_with_negative_punten_is_refused() =>
|
|
Assert.NotNull(IntakePolicy.RejectIncompleteScholing(500, aanvullendeScholing: true, scholingPunten: -1));
|
|
|
|
[Theory]
|
|
[InlineData(null)] // stale-punten shape (§6): raising uren above threshold left an unanswered
|
|
// question but punten still set from when it was visible
|
|
[InlineData(false)]
|
|
public void Punten_without_gevolgd_is_refused(bool? aanvullendeScholing) =>
|
|
// uren ABOVE threshold so the "missing answer" branch can't also explain the rejection —
|
|
// this row isolates the "stale punten" rule on its own.
|
|
Assert.NotNull(IntakePolicy.RejectIncompleteScholing(1500, aanvullendeScholing, scholingPunten: 150));
|
|
}
|