public void Should_be_able_to_retrieve_a_list_of_dinosaurs() { //arrange var dRepo = new DinosaurRepository(); var dcon = new DinosaurController(dRepo, new CategoryRepository()); //act var r = dcon.List("VAL") as ViewResult; //assert var model = r.ViewData.Model as IList<Dinosaur>; Assert.IsNotNull(model, "Model should be of type IList<Dinosaur>"); }
public void Should_be_able_to_retrieve_a_single_dinosaur() { //arrange var dRepo = new DinosaurRepository(); var dino = dRepo.GetDinosaurByName("Brontosaurus"); var dcon = new DinosaurController(dRepo, new CategoryRepository()); //act var r = dcon.Details(dino.DinosaurId.ToInt()) as ViewResult; //assert var model = r.ViewData.Model as Dinosaur; Assert.IsNotNull(model, "Model should be of type Dinosaur"); }