コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: Invoice.cs プロジェクト: psowinski/Sample
 public void Handle(InvoiceSellDateSetEvent @event)
 {
     Date = @event.Date;
 }