public void SignUpAction_Returns_View() { //Act var controller = new CharityController(_charityRepository, _notificationService); var result = controller.SignUp(); //Assert result.AssertViewRendered(); }
public void SignUpAction_Post_Redirects() { //Arrange var model = new SignUpViewModel(); _charityRepository.Save(new Charity()); _notificationService.SendNotification(string.Empty, VolunteerNotificationTemplate.WelcomeVolunteer).Returns(true); //Act var controller = new CharityController(_charityRepository, _notificationService); var result = controller.SignUp(model); //Assert result.AssertActionRedirect(); }
public void SignUpAction_Post__With_ModelError_Returns_View() { //Arrange var model = new SignUpViewModel(); _charityRepository.Save(new Charity()); _notificationService.SendNotification(string.Empty, VolunteerNotificationTemplate.WelcomeVolunteer).Returns(true); //Act var controller = new CharityController(_charityRepository, _notificationService); controller.ModelState.AddModelError("An Error", "Message"); var result = controller.SignUp(model); //Assert result.AssertViewRendered(); }