Exercise baseline

This commit is contained in:
2026-09-17 20:42:49 +01:00
commit 863c7a6349
36 changed files with 3898 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
using Domain;
namespace TestData;
/// <summary>Test data builder for an <see cref="Order"/> (TestDataBuilder pattern); the only place tests touch an order's construction, so tests survive domain evolution.</summary>
public sealed class OrderBuilder
{
private readonly Order _order = new();
/// <summary>A valid, fresh order — the neutral starting point for tests.</summary>
public static OrderBuilder ValidOrder() => new();
public OrderBuilder WithId(Guid id)
{
_order.Id = id;
return this;
}
public OrderBuilder WithDescription(string description)
{
_order.Description = description;
return this;
}
/// <summary>Sets the total in cents (<c>150_00</c> = €150.00).</summary>
public OrderBuilder WithTotal(int totalInCents)
{
_order.TotalInCents = totalInCents;
return this;
}
public Order Build() => _order;
}