Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class ApproveInvoiceTests {
  2. private Invoice _invoice;
  3. private CommandResult _result;
  4.  
  5. public ApproveInvoiceTests(TestContext context) {
  6. var invoice = new Invoice("John Doe", 30m);
  7.  
  8. context.Save(invoice);
  9.  
  10. var message = new ApproveInvoice(invoice.Id);
  11.  
  12. _result = context.Send(invoice);
  13.  
  14. _invoice = context.Reload(invoice);
  15. }
  16.  
  17. public void ShouldApproveInvoice() {
  18. _invoice.Status.ShouldEqual(InvoiceStatus.Approved);
  19. }
  20.  
  21. public void ShouldRaiseApprovedEvent() {
  22. _result.Events.OfType<InvoiceApproved>().Count().ShouldEqual(1);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement