public void ResendConfirmation_POST_With_Invalid_Email_Should_Show_Signup_View() { // Arrange _applicationSettings.UseWindowsAuthentication = false; SiteSettings siteSettings = _settingsService.GetSiteSettings(); ResetPasswordEmailStub resetEmail = new ResetPasswordEmailStub(_applicationSettings, _repository, _emailClientMock); UserController userController = new UserController(_applicationSettings, _userService, _userContext, _settingsService, null, resetEmail); userController.SetFakeControllerContext(); // Act ActionResult result = userController.ResendConfirmation("doesnt exist"); // Assert ViewResult viewResult = result.AssertResultIs<ViewResult>(); Assert.That(viewResult.ViewName, Is.EqualTo("Signup")); }
public void ResendConfirmation_POST_Should_SendEmail_And_Show_SignupComplete_View_And_Set_TempData() { // Arrange _applicationSettings.UseWindowsAuthentication = false; SiteSettings siteSettings = _settingsService.GetSiteSettings(); string email = "*****@*****.**"; _userService.AddUser(email, "test", "password", false, true); UserViewModel model = new UserViewModel(_userService.GetUser("*****@*****.**", false)); SignupEmailStub signupEmail = new SignupEmailStub(_applicationSettings, _repository, _emailClientMock); UserController userController = new UserController(_applicationSettings, _userService, _userContext, _settingsService, signupEmail, null); userController.SetFakeControllerContext(); // Act ActionResult result = userController.ResendConfirmation(email); // Assert ViewResult viewResult = result.AssertResultIs<ViewResult>(); Assert.That(viewResult.ViewName, Is.EqualTo("SignupComplete")); Assert.That(viewResult.TempData["resend"], Is.EqualTo(true)); Assert.That(signupEmail.IsSent, Is.EqualTo(true)); }