public void Initialize()
        {
            DbContextHelpers contextHelpers = new DbContextHelpers();
            search = new WorkoutSearch();

            db = contextHelpers.getDbContext();
            adminCon = new AdminWorkoutsController(db.Object)
            {
                // sign in as admin
                ControllerContext = MockContext.AuthenticationContext("admin")
            };
        }
 public void TestHomeControllerCreateNewWorkoutWithNoUserError()
 {
     adminCon = new AdminWorkoutsController(db.Object)
     {
         ControllerContext = MockContext.AuthenticationContext("not_a_real_user")
     };
     var workout = new workout();
     var workoutExercise = new workout_exercise();
     workout.workout_exercise.Add(workoutExercise);
     ViewResult result = adminCon.New(workout) as ViewResult;
     Assert.IsNotNull(result);
     Assert.AreEqual("DetailedError", result.ViewName);
     Assert.IsInstanceOfType(result.Model, typeof(HttpStatusCodeResult));
     var model = result.Model as HttpStatusCodeResult;
     Assert.AreEqual(500, model.StatusCode);
     Assert.AreEqual("No user could be associated with the workout being created", model.StatusDescription);
 }