public void TestExecuteShouldEmailInvoiceIfEmailing() { _invoice.EmailAddress = EmailAddress; _command.Execute(InvoiceId, true); _mocker.GetMock <IInvoiceEmailer>() .Verify(p => p.Email(_invoice), Times.Once); }
public void TestExecuteForEmailingInvoiceWithNoEmailAddressShouldThrowException() { _invoice.EmailAddress = string.Empty; Assert.That(() => _command.Execute(InvoiceId, true), Throws.TypeOf <EmailAddressIsBlankException>()); }