Execute a strict Red-Green-Refactor TDD cycle — one requirement at a time — in any language or framework.
97
Quality
100%
Does it follow best practices?
Impact
94%
1.11xAverage score across 5 eval scenarios
You are using the behavioral-tdd skill.
Requirement: "When InvoiceService.GenerateInvoice() is called with a valid
order ID, it must return an Invoice object whose Total matches the sum of
the order's line items."
A developer on the team suggests the following approach:
"Let's mock
_calculateLineItemSubtotals, the private method onInvoiceService, and assert it was called once with the correct order ID."
Respond to this suggestion, then write the correct Phase 1 (RED) test in C# using NSubstitute for any injected dependencies.