Ejemplo n.º 1
0
        public async Task <IActionResult> Search(string artistName)
        {
            var artists = await _albumifyService.SearchArtistsByNameAsync(artistName);

            var viewModels = artists
                             .Select(a => new SearchArtistViewModel(a))
                             .ToList();

            return(View(viewModels));
        }
Ejemplo n.º 2
0
        public static async Task TestInitialize(TestContext _)
        {
            thirdPartyMusicService = new Mock <I3rdPartyMusicService>();
            myCollection           = new Mock <IMyCollectionRepository>();

            StubTheArtistsReturnedByTheThirdPartyMusicService();
            StubWhichArtistsAreInMyCollection();

            var logger = new NullLogger <AlbumifyService>();
            var sut    = new AlbumifyService(logger, thirdPartyMusicService.Object, myCollection.Object);

            result = await sut.SearchArtistsByNameAsync(ArtistName);
        }