public void TestFanArtExtractAlbumArtistFolderFanArt() { //Arrange _fanArtCache.Clear(); Guid albumId = Guid.NewGuid(); Guid artist1Id = Guid.NewGuid(); Guid artist2Id = Guid.NewGuid(); IList <Tuple <Guid, string> > artists = new List <Tuple <Guid, string> > { new Tuple <Guid, string>(artist1Id, "Album Artist1"), new Tuple <Guid, string>(artist2Id, "Album Artist2") }; AudioFanArtHandlerForTests fh = new AudioFanArtHandlerForTests(); //Act fh.TestExtractAlbumFolderFanArt(albumId, ResourcePath.BuildBaseProviderPath(MockResourceProvider.PROVIDER_ID, "Audio/TestArtist/TestAlbum/"), artists).Wait(); //Assert List <string> fanart; Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(artist1Id, out fanart)); ICollection <string> fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Audio/TestArtist/TestAlbum/.artists/album_artist1-thumb.png"); Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(artist2Id, out fanart)); fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Audio/TestArtist/TestAlbum/.artists/album_artist2-thumb.png"); }
public void TestFanArtExtractAlbumFolderFanArt() { //Arrange _fanArtCache.Clear(); Guid albumId = Guid.NewGuid(); AudioFanArtHandlerForTests fh = new AudioFanArtHandlerForTests(); //Act fh.TestExtractAlbumFolderFanArt(albumId, ResourcePath.BuildBaseProviderPath(MockResourceProvider.PROVIDER_ID, "Audio/TestArtist/TestAlbum/")).Wait(); //Assert List <string> fanart; Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(albumId, out fanart)); ICollection <string> fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Audio/TestArtist/TestAlbum/cover.png"); CollectionAssert.Contains(fanartBasePaths, "Audio/TestArtist/TestAlbum/ExtraFanArt/fanart.png"); }