コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }