public void AllShouldReturnNotFoundWithIdLessOrEqualToOne() { var lakesService = new Mock <ILakesService>(); var countriesService = new Mock <ICountriesService>(); var controller = new LakesController( countriesService.Object, lakesService.Object); var result = controller.All(null, -1); Assert.IsType <NotFoundResult>(result); }
public void AllShouldReturnLakeInListViewModelWithPaidType() { var lakesService = new Mock <ILakesService>(); lakesService .Setup(l => l.GetAll <LakeInListViewModel>("Paid", 1, 6)) .Returns(new List <LakeInListViewModel>()); var countriesService = new Mock <ICountriesService>(); var controller = new LakesController( countriesService.Object, lakesService.Object); var result = controller.All("Paid", 1); Assert.IsType <ViewResult>(result); var viewResult = result as ViewResult; Assert.IsType <LakesListViewModel>(viewResult.Model); }