Skip to content

Instantly share code, notes, and snippets.

@GraemeF
Forked from johnnonolan/readable.cs
Created January 14, 2011 21:45
Show Gist options
  • Save GraemeF/780316 to your computer and use it in GitHub Desktop.
Save GraemeF/780316 to your computer and use it in GitHub Desktop.
Now more readable :P
namespace iDoc.specs.When
{
[Subject("AccountManagement")]
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