mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
moved media file service
This commit is contained in:
parent
8900bbb3a1
commit
de5d5b76e8
46 changed files with 512 additions and 488 deletions
|
@ -4,6 +4,7 @@ using FizzWare.NBuilder;
|
|||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Core.Providers;
|
||||
|
@ -26,10 +27,10 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.TheFirst(1)
|
||||
.With(f => f.EpisodeFileId = 1)
|
||||
.With(f => f.Id = 1)
|
||||
.With(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.TheNext(1)
|
||||
.With(f => f.EpisodeFileId = 2)
|
||||
.With(f => f.Id = 2)
|
||||
.With(f => f.Path = @"C:\Test\Title2.avi")
|
||||
.Build();
|
||||
|
||||
|
@ -47,11 +48,11 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
Mocker.GetMock<IEpisodeService>()
|
||||
.Setup(c => c.EpisodesWithFiles()).Returns(episodes);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[0] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[0]))
|
||||
.Returns("Title1");
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[1] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[1]))
|
||||
.Returns("Title2");
|
||||
|
||||
|
@ -73,10 +74,10 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.TheFirst(1)
|
||||
.With(f => f.EpisodeFileId = 1)
|
||||
.With(f => f.Id = 1)
|
||||
.With(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.TheNext(1)
|
||||
.With(f => f.EpisodeFileId = 2)
|
||||
.With(f => f.Id = 2)
|
||||
.With(f => f.Path = @"C:\Test\Title2.avi")
|
||||
.Build();
|
||||
|
||||
|
@ -94,11 +95,11 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
Mocker.GetMock<IEpisodeService>()
|
||||
.Setup(c => c.EpisodesWithFiles()).Returns(episodes);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[0] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[0]))
|
||||
.Returns("New Title 1");
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[1] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[1]))
|
||||
.Returns("New Title 2");
|
||||
|
||||
|
@ -120,10 +121,10 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.TheFirst(1)
|
||||
.With(f => f.EpisodeFileId = 1)
|
||||
.With(f => f.Id = 1)
|
||||
.With(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.TheNext(1)
|
||||
.With(f => f.EpisodeFileId = 2)
|
||||
.With(f => f.Id = 2)
|
||||
.With(f => f.Path = @"C:\Test\Title2.avi")
|
||||
.Build();
|
||||
|
||||
|
@ -141,11 +142,11 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
Mocker.GetMock<IEpisodeService>()
|
||||
.Setup(c => c.EpisodesWithFiles()).Returns(episodes);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[0] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[0]))
|
||||
.Returns("New Title 1");
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[1] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[1]))
|
||||
.Returns("Title2");
|
||||
|
||||
|
@ -169,10 +170,10 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.TheFirst(1)
|
||||
.With(f => f.EpisodeFileId = 1)
|
||||
.With(f => f.Id = 1)
|
||||
.With(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.TheNext(1)
|
||||
.With(f => f.EpisodeFileId = 2)
|
||||
.With(f => f.Id = 2)
|
||||
.With(f => f.Path = @"C:\Test\Title2.avi")
|
||||
.Build();
|
||||
|
||||
|
@ -190,11 +191,11 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
Mocker.GetMock<IEpisodeService>()
|
||||
.Setup(c => c.EpisodesWithFiles()).Returns(episodes);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[0], episodes[1] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[0]))
|
||||
.Returns("New Title 1");
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[2] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[1]))
|
||||
.Returns("Title2");
|
||||
|
||||
|
@ -218,10 +219,10 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
|
||||
var episodeFiles = Builder<EpisodeFile>.CreateListOfSize(2)
|
||||
.TheFirst(1)
|
||||
.With(f => f.EpisodeFileId = 1)
|
||||
.With(f => f.Id = 1)
|
||||
.With(f => f.Path = @"C:\Test\Title1.avi")
|
||||
.TheNext(1)
|
||||
.With(f => f.EpisodeFileId = 2)
|
||||
.With(f => f.Id = 2)
|
||||
.With(f => f.Path = @"C:\Test\Title2.avi")
|
||||
.Build();
|
||||
|
||||
|
@ -239,11 +240,11 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
Mocker.GetMock<IEpisodeService>()
|
||||
.Setup(c => c.EpisodesWithFiles()).Returns(episodes);
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[0], episodes[1] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[0]))
|
||||
.Returns("Title1");
|
||||
|
||||
Mocker.GetMock<MediaFileProvider>()
|
||||
Mocker.GetMock<IMediaFileService>()
|
||||
.Setup(c => c.GetNewFilename(new List<Episode> { episodes[2] }, It.IsAny<Series>(), It.IsAny<Quality>(), It.IsAny<bool>(), episodeFiles[1]))
|
||||
.Returns("Title2");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue