Created
August 4, 2011 13:13
-
-
Save robashton/1125120 to your computer and use it in GitHub Desktop.
Re-work of the contrived example, too hurried
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
| [TestFixture] | |
| public class When_a_user_submits_a_form | |
| { | |
| [Test] | |
| public void An_email_is_sent_to_his_boss() | |
| { | |
| var form = new FormBuilder() | |
| .WhichFullyValidates() | |
| .ForUser(DefaultUser) | |
| .Build(); | |
| var emailEngine = new FakeEmailEngine(); | |
| var formService = new FormService(emailEngine); | |
| formService.Submit(form); | |
| emailEngine.ShouldHaveSentEmail(email => email | |
| .ToUser(DefaultBoss) | |
| .FromUser(DefaultUser); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment