public void ShouldReturnTourLandmarksFromRepository() { int id = 1; ICollection <LandmarkDto> retrieved = service.GetLandmarksOfTour(id); landmarks.Verify(l => l.GetTourLandmarks(id), Times.Once); Assert.AreEqual(GetFakeLandmarks().Count, retrieved.Count); }
public IActionResult GetByTour(int id) { IActionResult result; try { ICollection <LandmarkDto> retrieved = landmarks.GetLandmarksOfTour(id); result = Ok(retrieved); } catch (ServiceException e) { result = errorFactory.GenerateError(e); } return(result); }