public async Task <GalleryRoot> GetGallery([FromQuery] GalleryViewRoot galleryRoot)
 {
     if (AdditionalData.LastPhotoUpdate < DateTime.Now.AddMinutes(-5) &&
         galleryRoot.LastPhotoId == 0)
     {
         AdditionalData.LastPhotoUpdate = DateTime.Now;
         await _flickrService.RefreshPhotos();
     }
     return(await _galleryService.GetPhotos(galleryRoot));
 }
示例#2
0
        public void GetPhotos_Should_Return_A_List()
        {
            var galleryRepositoryMock = new Mock <IGalleryRepository>();
            var service = new GalleryService(galleryRepositoryMock.Object);

            galleryRepositoryMock.Setup(x => x.Get()).Returns(_PhotoList);

            var photos = service.GetPhotos();

            Assert.NotNull(photos);
        }
        public override async Task PreRender()
        {
            Photos = await galleryService.GetPhotos(GalleryId);

            await base.PreRender();
        }