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(InvoiceSellDateSetEvent @event) { Date = @event.Date; }