Skip to content

Instantly share code, notes, and snippets.

@robashton
Created August 4, 2011 13:13
Show Gist options
  • Select an option

  • Save robashton/1125120 to your computer and use it in GitHub Desktop.

Select an option

Save robashton/1125120 to your computer and use it in GitHub Desktop.
Re-work of the contrived example, too hurried
[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