mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Rewrite of InventoryProvider
This commit is contained in:
parent
f62b02a36b
commit
1239da656e
31 changed files with 1009 additions and 677 deletions
|
@ -10,8 +10,10 @@ using Moq;
|
|||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace NzbDrone.Core.Test
|
||||
{
|
||||
[TestFixture]
|
||||
|
@ -23,10 +25,11 @@ namespace NzbDrone.Core.Test
|
|||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
var parseResult = Builder<EpisodeParseResult>.CreateNew()
|
||||
.With(e => e.Episodes = Builder<Episode>.CreateListOfSize(2)
|
||||
.WhereTheFirst(1).Has(s => s.EpisodeId = 12)
|
||||
.AndTheNext(1).Has(s => s.EpisodeId = 99)
|
||||
.Build())
|
||||
.Build();
|
||||
.WhereTheFirst(1).Has(s => s.EpisodeId = 12)
|
||||
.AndTheNext(1).Has(s => s.EpisodeId = 99)
|
||||
.Build())
|
||||
.With(c => c.Quality = new Quality(QualityTypes.DVD, false))
|
||||
.Build();
|
||||
|
||||
const string sabTitle = "My fake sab title";
|
||||
mocker.GetMock<SabProvider>()
|
||||
|
@ -38,18 +41,18 @@ namespace NzbDrone.Core.Test
|
|||
.Returns(true);
|
||||
|
||||
mocker.GetMock<SabProvider>()
|
||||
.Setup(s => s.GetSabTitle(parseResult))
|
||||
.Returns(sabTitle);
|
||||
.Setup(s => s.GetSabTitle(parseResult))
|
||||
.Returns(sabTitle);
|
||||
|
||||
mocker.GetMock<HistoryProvider>()
|
||||
.Setup(s => s.Add(It.Is<History>(h=>h.EpisodeId == 12)));
|
||||
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 12)));
|
||||
mocker.GetMock<HistoryProvider>()
|
||||
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 99)));
|
||||
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 99)));
|
||||
|
||||
mocker.Resolve<DownloadProvider>().DownloadReport(parseResult);
|
||||
|
||||
|
||||
|
||||
mocker.VerifyAllMocks();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue