Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ApproveInvoiceTests {
- private Invoice _invoice;
- private CommandResult _result;
- public ApproveInvoiceTests(TestContext context) {
- var invoice = new Invoice("John Doe", 30m);
- context.Save(invoice);
- var message = new ApproveInvoice(invoice.Id);
- _result = context.Send(invoice);
- _invoice = context.Reload(invoice);
- }
- public void ShouldApproveInvoice() {
- _invoice.Status.ShouldEqual(InvoiceStatus.Approved);
- }
- public void ShouldRaiseApprovedEvent() {
- _result.Events.OfType<InvoiceApproved>().Count().ShouldEqual(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement