Fixed tests
This commit is contained in:
parent
f56d504816
commit
0e6f858e65
|
@ -4,7 +4,9 @@ using FizzWare.NBuilder;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Download;
|
using NzbDrone.Core.Download;
|
||||||
|
using NzbDrone.Core.History;
|
||||||
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
|
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
|
||||||
using NzbDrone.Core.Parser.Model;
|
using NzbDrone.Core.Parser.Model;
|
||||||
using NzbDrone.Core.Test.Framework;
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
@ -48,8 +50,22 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
|
||||||
|
|
||||||
private void GivenHistoryForEpisodes(params Episode[] episodes)
|
private void GivenHistoryForEpisodes(params Episode[] episodes)
|
||||||
{
|
{
|
||||||
_localEpisode.Release = new GrabbedReleaseInfo();
|
if (episodes.Empty())
|
||||||
_localEpisode.Release.EpisodeIds = episodes.Select(e => e.Id).ToList();
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var grabbedHistories = Builder<EpisodeHistory>.CreateListOfSize(episodes.Length)
|
||||||
|
.All()
|
||||||
|
.With(h => h.EventType == EpisodeHistoryEventType.Grabbed)
|
||||||
|
.BuildList();
|
||||||
|
|
||||||
|
for (var i = 0; i < grabbedHistories.Count; i++)
|
||||||
|
{
|
||||||
|
grabbedHistories[i].EpisodeId = episodes[i].Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
_localEpisode.Release = new GrabbedReleaseInfo(grabbedHistories);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Reference in New Issue