public void TestFanArtExtractSeriesActorFolderFanArt() { //Arrange _fanArtCache.Clear(); Guid seriesId = Guid.NewGuid(); Guid actor1Id = Guid.NewGuid(); Guid actor2Id = Guid.NewGuid(); IList <Tuple <Guid, string> > actors = new List <Tuple <Guid, string> > { new Tuple <Guid, string>(actor1Id, "Series Actor1"), new Tuple <Guid, string>(actor2Id, "Series Actor2") }; SeriesFanArtHandlerForTests fh = new SeriesFanArtHandlerForTests(); //Act fh.TestExtractSeriesFolderFanArt(seriesId, ResourcePath.BuildBaseProviderPath(MockResourceProvider.PROVIDER_ID, "Series/TestSeries/Season 1/episode1.mkv"), actors).Wait(); //Assert List <string> fanart; Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(actor1Id, out fanart)); ICollection <string> fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Series/TestSeries/.actors/series_actor1-thumb.png"); Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(actor2Id, out fanart)); fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Series/TestSeries/.actors/series_actor2-thumb.png"); }
public void TestFanArtExtractSeriesFolderFanArt() { //Arrange _fanArtCache.Clear(); Guid seriesId = Guid.NewGuid(); SeriesFanArtHandlerForTests fh = new SeriesFanArtHandlerForTests(); //Act fh.TestExtractSeriesFolderFanArt(seriesId, ResourcePath.BuildBaseProviderPath(MockResourceProvider.PROVIDER_ID, "Series/TestSeries/Season 1/episode1.mkv")).Wait(); //Assert List <string> fanart; Assert.IsTrue(_fanArtCache.FanArt.TryGetValue(seriesId, out fanart)); ICollection <string> fanartBasePaths = fanart.Select(p => ResourcePath.Deserialize(p).BasePathSegment.Path).ToList(); CollectionAssert.Contains(fanartBasePaths, "Series/TestSeries/poster.png"); CollectionAssert.Contains(fanartBasePaths, "Series/TestSeries/ExtraFanArt/fanart.png"); }