public void When(IEvent @event) { var cmd = ShippingPolicy.When((dynamic)@event); var state = history.Rehydrate <Order>(); history.AddRange(OrderBehavior.Handle(state, (dynamic)cmd)); }
public void PickedDoesntIssueShip() { //Given var state = new IEvent[] { }.Rehydrate <Order>(); //When var cmd = ShippingPolicy.When(new GoodsPicked(), state); //Then Assert.Null(cmd); }
public void PickedAndPayedIssueShip() { //Given var state = new IEvent[] { new GoodsPicked() }.Rehydrate <Order>(); //When var cmd = ShippingPolicy.When(new PaymentRecieved(), state); //Then Assert.NotNull(cmd); Assert.IsType <Ship>(cmd); }