mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Fixed QualityProfile mapping to Series, resulted in a large number of changed files referencing ProfileId instead of QualityProfileId
This commit is contained in:
parent
83ee068d45
commit
d3b7d199ab
18 changed files with 247 additions and 79 deletions
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FizzWare.NBuilder;
|
||||
using Gallio.Framework;
|
||||
|
@ -10,6 +11,8 @@ using Moq;
|
|||
using Ninject;
|
||||
using Ninject.Moq;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using SubSonic.Repository;
|
||||
using TvdbLib.Data;
|
||||
using SubSonic.Extensions;
|
||||
|
@ -52,5 +55,41 @@ namespace NzbDrone.Core.Test
|
|||
Assert.Count(episodeCount, kernel.Get<IEpisodeProvider>().GetEpisodeBySeries(seriesId));
|
||||
Console.WriteLine("Duration: " + sw.Elapsed.ToString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsNeededTrue()
|
||||
{
|
||||
//Setup
|
||||
var season = new Mock<ISeasonProvider>();
|
||||
var series = new Mock<ISeriesProvider>();
|
||||
var history = new Mock<IHistoryProvider>();
|
||||
var quality = new Mock<IQualityProvider>();
|
||||
var repo = new Mock<IRepository>();
|
||||
|
||||
var epInDb = new Episode
|
||||
{
|
||||
AirDate = DateTime.Today,
|
||||
EpisodeId = 55555,
|
||||
EpisodeNumber = 5,
|
||||
Language = "en",
|
||||
SeasonId = 4444,
|
||||
SeasonNumber = 1
|
||||
};
|
||||
|
||||
season.Setup(s => s.IsIgnored(12345, 1)).Returns(false);
|
||||
series.Setup(s => s.QualityWanted(12345, QualityTypes.TV)).Returns(true);
|
||||
repo.Setup(s => s.Single<Episode>(c => c.SeriesId == 12345 && c.SeasonNumber == 1 && c.EpisodeNumber == 5)).
|
||||
Returns(epInDb);
|
||||
|
||||
//repo.Setup(s => s.All<EpisodeFile>()).Returns();
|
||||
//repo.All<EpisodeFile>().Where(c => c.EpisodeId == episode.EpisodeId);
|
||||
|
||||
|
||||
|
||||
//Act
|
||||
|
||||
|
||||
//Assert
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue