public void context()
 {
     repository = MockRepository.GenerateStub<ActivityRepository>();
     repository.Stub(x => x.GetActivities()).Return(new Activities());
     var controller = new ActivityController(repository);
     var viewResult = controller.SelectActivities() as ViewResult;
     model = viewResult.ViewData.Model as ShowActivitiesModel;
 }
        public void context()
        {
            siteVisitor = MockRepository.GenerateStub<SiteVisitor>();
            observe();

            activities = MockRepository.GenerateStub<Activities>();
            activityRepository = MockRepository.GenerateStub<ActivityRepository>();
            activityRepository.Stub(x => x.SaveActivities(siteVisitor, activities)).Return(new ActivitySaveResult(true));

            var controller = new ActivityController(activityRepository);
            var viewResult = controller.SaveActivities(siteVisitor, activities) as ViewResult;
            model = viewResult.ViewData.Model as SaveActivitiesViewModel;
        }
 public ActivityController(ActivityRepository repository)
 {
     this.repository = repository;
 }