Ejemplo n.º 1
0
        public void GetFlickrPhotoInvalidPageNumber2()
        {
            // Arrange
            FlickrPhotoController controller = new FlickrPhotoController(_mockLocationRepository.Object, _mockFlickrPhotoRepository.Object, _FourSquareService, _FlickrService);

            controller.ControllerContext = mockControllerContext.Object;

            // Act
            var result = controller.GetFlickrPhoto(50, "123456", 10);

            Assert.AreEqual(0, result.FlickrsPhotos.Count());
        }
Ejemplo n.º 2
0
        public void GetFlickrPhotoInvalidPageNumber()
        {
            try
            {
                // Arrange
                FlickrPhotoController controller = new FlickrPhotoController(_mockLocationRepository.Object, _mockFlickrPhotoRepository.Object, _FourSquareService, _FlickrService);
                controller.ControllerContext = mockControllerContext.Object;

                // Act
                var result = controller.GetFlickrPhoto(0, "123456", 10);

                Assert.Fail("An Exception should have been thrown");
            }
            catch (Exception ex)
            {
                Assert.AreEqual("PageNumber cannot be below 1.\r\nParameter name: pageNumber\r\nActual value was 0.", ex.Message);
            }
        }