private void CheckCamp(CodeCamp obj)
 {
     if (obj == null)
     {
         throw new HttpException(404, "Code Camp not found");
     }
 }
        public int Add(CodeCamp camp)
        {
            camp.Id = GenerateNewId();

            camps.Add(camp);

            return camp.Id;
        }
        public void Setup()
        {
            camp = new CodeCamp();
            presentation = new Presentation()
            {
                Name = "Brian Hartsock",
                Abstract = "Intro to NHibernate, enough said",
                Level = AudienceLevel.L100
            };

            camp.Presentations.Add(presentation);
        }
        public void add_presentation()
        {
            var camp = new CodeCamp();

            var repo = new Mock<ICodeCampRepository>();
            repo.Setup(r => r.Get(1))
                .Returns(camp);
            var controller = new PresentationController(repo.Object);

            var presentation = new Presentation()
            {
                Name = "NHibernate",
                Abstract = "Really awesome",
                Level = AudienceLevel.L100
            };

            //Assert result?

            controller.Add(1, presentation);

            Assert.That(camp.Presentations, Has.Member(presentation));
        }
 private ActionResult RedirectToCamp(CodeCamp camp)
 {
     return RedirectToAction("Show", "CodeCamp", new { id = camp.Id });
 }
 public ActionResult Add(CodeCamp camp)
 {
     camps.Add(camp);
     return RedirectToAction("Index");
 }
 private void CheckCamp(CodeCamp camp)
 {
     if (camp == null)
     {
         throw new HttpException(404, "Camp not found");
     }
 }
 public void Delete(CodeCamp camp)
 {
     camps.Remove(camp);
 }
 public void Update(CodeCamp camp)
 {
 }
 public void Delete(CodeCamp camp)
 {
 }
 public int Add(CodeCamp camp)
 {
 }
        public virtual void Setup()
        {
            camp1 = new CodeCamp()
            {
                Name = "1",
                Date = DateTime.Now.AddDays(10),
                Address = new Address()
                {
                    City = "Richmond",
                    State = "VA"
                }
            };
            camp2 = new CodeCamp()
            {
                Name = "2",
                Date = DateTime.Now.AddDays(20),
                Address = new Address()
                {
                    City = "Roanoke",
                    State = "VA"
                }
            };
            camp3 = new CodeCamp()
            {
                Name = "3",
                Date = DateTime.Now.AddDays(0),
                Address = new Address()
                {
                    City = "San Francisco",
                    State = "CA"
                }
            };

            camps.Add(camp1);
            camps.Add(camp2);
            camps.Add(camp3);
        }