Example #1
0
        private Buyer CreateClosedBuyer(int maximumPrice = 5)
        {
            var buyer = new Buyer("Buyer", maximumPrice, 1);

            buyer.Process(StockEvent.Close());
            return(buyer);
        }
Example #2
0
        public void Close_method_returns_a_close_event()
        {
            StockEvent stockEvent = StockEvent.Close();

            stockEvent.Type.ShouldEqual(StockEventType.Close);
            stockEvent.ToString().ShouldEqual("Event: CLOSE;");
        }
Example #3
0
        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);
        }