private UserProfileController GetUserProfileController(int userProfileID = -1)
        {
            var causeRepository = mocks.DynamicMock<ICauseRepository>();
            Expect.Call(causeRepository.FindCausesByUserProfileID(userProfileID)).Return(new List<Cause>().AsQueryable());

            var mailer = mocks.DynamicMock<IUserProfileMailer>();
            //mocks.ReplayAll();

            MailerBase.IsTestModeEnabled = true;
            var upc = new UserProfileController(repository, causeRepository, mailer);
            TestHelpers.MockHttpContext(upc, mocks);
            return upc;
        }
 public void SetUp()
 {
     userProfile = EntityHelpers.GetValidUserProfile();
     repository = new FakeUserProfileRepository();
     repository.Add(userProfile);
     mocks = new MockRepository();
     controller = GetUserProfileController(userProfile.UserProfileID);
     Mapper.CreateMap<UserProfile, UserProfileDetailsModel>();
 }