Skip to content

Instantly share code, notes, and snippets.

@johnnonolan
Created January 14, 2011 21:44
Show Gist options
  • Save johnnonolan/780312 to your computer and use it in GitHub Desktop.
Save johnnonolan/780312 to your computer and use it in GitHub Desktop.
namespace iDoc.specs.When
{
[Subject("AcccountManagement")]
public class CreatingAUserAccount : BaseContext<AccountController>
{
const string EmailAddress = @"1@2.com";
Establish context = () =>
{
model = new RegistrationModel {
email = EmailAddress,
password = @"OMG4his_is_very_Secret!" };
};
Because of = () => result = mockedType.CreateNewAccount(model);
It should_send_an_email = () =>
mocker.Get<IEmailProvider>().AssertWasCalled(
emailProvider => emailProvider.Send(null, new MailAddress(EmailAddress), null, null),
o => o.IgnoreArguments());
It should_return_the_successful_view = () =>
result.ShouldBeOfType<ViewResult>();
It should_show_a_signed_in_successfully_message = () =>
result.is_a_view_result_and().ViewData["message"].ShouldEqual("Sign-up successful");
static ActionResult result;
static RegistrationModel model;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment