- Add OrderBookDomain: in-memory order book with Pending → WaitingForPayment → Fulfilling → Delivered state machine, payment window based on passed-in timestamps, cancellation rules - Add OrderBookTests: 7 integration tests in given/when/then/when/then anti-pattern style as starting material for the exercise - Learning hour: add round 2 where participants create the example themselves before showing it to the agent (no refactored test given) - Fix sln: OrderTests Debug config was mapped to Release
26 lines
480 B
C#
26 lines
480 B
C#
namespace OrderBookDomain;
|
|
|
|
public enum OrderStatus
|
|
{
|
|
Pending,
|
|
WaitingForPayment,
|
|
Fulfilling,
|
|
Delivered,
|
|
Cancelled
|
|
}
|
|
|
|
public class Order
|
|
{
|
|
public int Id { get; }
|
|
public string Customer { get; }
|
|
public OrderStatus Status { get; internal set; }
|
|
public DateTimeOffset? FinalizedAt { get; internal set; }
|
|
|
|
internal Order(int id, string customer)
|
|
{
|
|
Id = id;
|
|
Customer = customer;
|
|
Status = OrderStatus.Pending;
|
|
}
|
|
}
|