예제 #1
0
 public static PagedPhotoConstraint CreatePagedPhotoRepositoryConstraint(this IPhotoListingService photoListingService, PhotoListingRequest plr)
 {
     return(new PagedPhotoConstraint()
     {
         Page = plr.Page,
         PageSize = plr.PageSize,
         SortOrder = plr.SortOrder,
         SearchKey = plr.SearchKey
     });
 }
예제 #2
0
        public static IReadOnlyList <Models.ServiceDTOs.Response.Photo> CreatePagedPhotoResponse(this IPhotoListingService photoListingService, IReadOnlyList <Album> albums, IReadOnlyList <Photo> photos)
        {
            var responsePhotos = new List <Models.ServiceDTOs.Response.Photo>();

            if (photos != null)
            {
                for (var i = 0; i < photos.Count; ++i)
                {
                    var photo = CreateAPhotoItem(photos[i], i + 1);
                    photo.AlbumName = GetAlbumName(albums, photos[i].AlbumId);
                    responsePhotos.Add(photo);
                }
            }

            return(responsePhotos);
        }
 public void SetUp()
 {
     _albumServiceMock    = new Mock <IAlbumService>();
     _photoRepositoryMock = new Mock <IPhotoRepository>();
     _photoListingService = new PhotoListingService(_albumServiceMock.Object, _photoRepositoryMock.Object);
 }
예제 #4
0
 public IndexModel(IPhotoListingService photoListingService)
 {
     _photoListingService = photoListingService;
 }