Created
December 2, 2010 12:20
-
-
Save AlfredoCasado/725201 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmailNotifierTest { | |
static final String TEST_BODY = "cuerpo de test"; | |
static final String TEST_SUBJECT = "asunto de test"; | |
final MailAdress alfredo = new MailAdress("[email protected]"); | |
final EmailNotifier emailNotifier = new EmailNotifier(); | |
@Test | |
public void shouldSendOneEmailToTheGivenEmailAdress() throws Exception { | |
Message aTestMessage = createATestMessage(); | |
emailNotifier.sendTo(alfredo, aTestMessage); | |
assertThat(inboxOf(alfredo), hasOneEmailWithSubject(TEST_SUBJECT)); | |
} | |
private Message createATestMessage() { | |
Message aTestMessage = mock(Message.class); | |
when(aTestMessage.subject()).thenReturn(TEST_SUBJECT); | |
when(aTestMessage.body()).thenReturn(TEST_BODY); | |
return aTestMessage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment