-
-
Save GraemeF/780316 to your computer and use it in GitHub Desktop.
Now more readable :P
This file contains 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
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