mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
f4376065f3
Add powered, fixture-backed evals with public API, multi-targeting, generated-code, and friend-assembly coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8c45529b-2515-483d-9e51-e6c0b7cb6852
34 lines
983 B
Diff
34 lines
983 B
Diff
diff --git a/src/Billing/OrderProcessor.cs b/src/Billing/OrderProcessor.cs
|
|
index 449ef77..84199df 100644
|
|
--- a/src/Billing/OrderProcessor.cs
|
|
+++ b/src/Billing/OrderProcessor.cs
|
|
@@ -10,11 +10,7 @@ internal sealed class OrderProcessor
|
|
{
|
|
public Invoice DoStuff(IReadOnlyList<OrderLine> lines, string tier)
|
|
{
|
|
- decimal subtotal = 0m;
|
|
- foreach (var line in lines)
|
|
- {
|
|
- subtotal += line.UnitPrice * line.Quantity;
|
|
- }
|
|
+ decimal subtotal = CalculateSubtotal(lines);
|
|
|
|
decimal shipping = subtotal >= 100m ? 0m : 9.99m;
|
|
|
|
@@ -33,4 +29,15 @@ internal sealed class OrderProcessor
|
|
Math.Round(quoteWithTax, 2),
|
|
shipping);
|
|
}
|
|
+
|
|
+ private static decimal CalculateSubtotal(IReadOnlyList<OrderLine> lines)
|
|
+ {
|
|
+ decimal subtotal = 0m;
|
|
+ foreach (var line in lines)
|
|
+ {
|
|
+ subtotal += line.UnitPrice * line.Quantity;
|
|
+ }
|
|
+
|
|
+ return subtotal;
|
|
+ }
|
|
}
|