private void CheckPresentation(Presentation obj) { if (obj == null) { throw new HttpException(404, "Presentation not found"); } }
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)); }