public void SetUp()
 {
     ForumId = Guid.Empty;
     Result = null;
     Controller = null;
     Forums = null;
     Forum = null;
     ForumRepository = null;
     
     _input = null;
 }
        public ActionResult Create(ForumInput input)
        {
            if (ModelState.IsValid)
            {
                var forum = new InputToForumMapper(_repository).Map(input);

                _repository.Save(forum);

                TempData["Message"] = string.Format("Forum {0} created successfully", forum.Name);

                return RedirectToAction("Details", new {forum.Id});
            }

            TempData["Message"] = "Failed to create forum";

            return View(new ForumInput());
        }
        private void _InputFor_Forum([BooleanParameterFormat("valid", "invalid")] bool valid,
            [BooleanParameterFormat("existing", "new")] bool exists)
        {
            if (valid)
            {
                Forum = ForumFixtures.ForumWithNoTopics(1);

                _input = new ForumInput {Name = Forum.Name};                
            }
            else
            {
                _input = new ForumInput {Name = string.Empty};

                Controller.ModelState.AddModelError("Name", "Name is required");
            }

            if (exists)
            {
                _input.Id = Guid.NewGuid();
            }
        }
        //
        // GET: /Forum/Create

        public ViewResult Create()
        {
            var input = new ForumInput();

            return View(input);
        }