private Buyer CreateClosedBuyer(int maximumPrice = 5) { var buyer = new Buyer("Buyer", maximumPrice, 1); buyer.Process(StockEvent.Close()); return(buyer); }
public void Close_method_returns_a_close_event() { StockEvent stockEvent = StockEvent.Close(); stockEvent.Type.ShouldEqual(StockEventType.Close); stockEvent.ToString().ShouldEqual("Event: CLOSE;"); }
public void Closes_when_item_closes() { var buyer = CreateJoiningBuyer(); StockCommand command = buyer.Process(StockEvent.Close()); command.ShouldEqual(StockCommand.None()); buyer.SnapshotShouldEqual(BuyerState.Closed, 0, 0, 0); }