Example #1
0
        public void ThankYouAction_Returns_View()
        {
            //Act
            var controller = new CharityController(_charityRepository, _notificationService);
            var result     = controller.ThankYou();

            //Assert
            result.AssertViewRendered();
        }
 public void CreateTest()
 {
     CharityController target = new CharityController(new FakeCharityRequirementRepository()); // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Create();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #3
0
        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();
        }
Example #4
0
        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();
        }