public void TrackPassedDate() { var date = DateTime.Now; var command = new SetInvoiceSellDateCommand(date); Assert.Equal(date, command.Date); }
public void AllowToSetInvoiceSellDate() { var date = DateTime.Now; var command = new SetInvoiceSellDateCommand(date); InvoiceSellDateSetEvent invoiceEvent = null; using (this.invoiceRoot .Where(x => x is InvoiceSellDateSetEvent) .Select(x => x as InvoiceSellDateSetEvent) .Subscribe(x => invoiceEvent = x)) { this.invoice.SetupGet(x => x.IsOpen).Returns(true); this.invoiceRoot.Execute(this.invoice.Object, command); Assert.Equal(date, invoiceEvent.Date); } }
public void Handle(IInvoice state, SetInvoiceSellDateCommand command) { RequireOpenInvoice(state); Publish(new InvoiceSellDateSetEvent(command.Date)); }