Example #1
0
        public void Check_If_AlbumPhotosViewModel_Can_Produce_Correct_Output_String()
        {
            var correctResult =
                @"AlbumID: 1, UserID: 1, Title: Album1
Photos:
PhotoID: 1, Title: Photo1, Url: a

AlbumID: 2, UserID: 2, Title: Album2
Photos:
PhotoID: 2, Title: Photo2, Url: b
PhotoID: 3, Title: Photo3, Url: b

AlbumID: 3, UserID: 2, Title: Album3
Photos:
PhotoID: 4, Title: Photo4, Url: c

";

            var viewModel = new AlbumPhotosViewModel(albums);
            var result    = viewModel.ConstructAlbumPhotosInformation();

            Assert.AreEqual(correctResult, result);
        }
Example #2
0
        public ActionResult <string> Get(int id)
        {
            var viewModel = new AlbumPhotosViewModel(_albumPhotoService.GetAlbumsByUserId(id));

            return(viewModel.ConstructAlbumPhotosInformation());
        }