|
|
@ -106,27 +106,27 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_not_blowup()
|
|
|
|
public void should_not_blowup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_call_diskprovider_writeAllText()
|
|
|
|
public void should_call_diskprovider_writeAllText()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<DiskProvider>().Verify(v => v.WriteAllText(Path.Combine(series.Path, "tvshow.nfo"), It.IsAny<string>()), Times.Once());
|
|
|
|
Mocker.GetMock<DiskProvider>().Verify(v => v.WriteAllText(Path.Combine(series.Path, "tvshow.nfo"), It.IsAny<string>()), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_download_fanart()
|
|
|
|
public void should_download_fanart()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.FanartPath, Path.Combine(series.Path, "fanart.jpg")), Times.Once());
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.FanartPath, Path.Combine(series.Path, "fanart.jpg")), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_download_poster_when_useBanners_is_false()
|
|
|
|
public void should_download_poster_when_useBanners_is_false()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.PosterPath, Path.Combine(series.Path, "folder.jpg")), Times.Once());
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.PosterPath, Path.Combine(series.Path, "folder.jpg")), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -134,14 +134,14 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|
|
|
public void should_download_banner_when_useBanners_is_true()
|
|
|
|
public void should_download_banner_when_useBanners_is_true()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WithUseBanners();
|
|
|
|
WithUseBanners();
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.BannerPath, Path.Combine(series.Path, "folder.jpg")), Times.Once());
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.BannerPath, Path.Combine(series.Path, "folder.jpg")), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_download_season_poster_when_useBanners_is_false()
|
|
|
|
public void should_download_season_poster_when_useBanners_is_false()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => !s.Contains("banners")), It.IsRegex(@"season\d{2}\.tbn")), Times.Exactly(2));
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => !s.Contains("banners")), It.IsRegex(@"season\d{2}\.tbn")), Times.Exactly(2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -149,7 +149,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|
|
|
public void should_download_season_banner_when_useBanners_is_true()
|
|
|
|
public void should_download_season_banner_when_useBanners_is_true()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WithUseBanners();
|
|
|
|
WithUseBanners();
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season\d{2}\.tbn")), Times.Exactly(2));
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season\d{2}\.tbn")), Times.Exactly(2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -158,7 +158,7 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WithUseBanners();
|
|
|
|
WithUseBanners();
|
|
|
|
WithSpecials();
|
|
|
|
WithSpecials();
|
|
|
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.Resolve<Core.Providers.Metadata.Xbmc>().CreateForSeries(series, tvdbSeries);
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season-specials.tbn")), Times.Exactly(1));
|
|
|
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season-specials.tbn")), Times.Exactly(1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|