Add round 2: split multi-step OrderBook tests (example created by participant)
- 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
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user