You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using Moq;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Blacklisting;
|
|
using NzbDrone.Core.Download;
|
|
using NzbDrone.Core.Qualities;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test.Blacklisting
|
|
{
|
|
[TestFixture]
|
|
public class BlacklistServiceFixture : CoreTest<BlacklistService>
|
|
{
|
|
private DownloadFailedEvent _event;
|
|
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
_event = new DownloadFailedEvent
|
|
{
|
|
SeriesId = 12345,
|
|
EpisodeIds = new List<int> {1},
|
|
Quality = new QualityModel(Quality.Bluray720p),
|
|
SourceTitle = "series.title.s01e01",
|
|
DownloadClient = "SabnzbdClient",
|
|
DownloadId = "Sabnzbd_nzo_2dfh73k"
|
|
};
|
|
|
|
_event.Data.Add("publishedDate", DateTime.UtcNow.ToString("s") + "Z");
|
|
}
|
|
|
|
|
|
[Test]
|
|
public void should_add_to_repository()
|
|
{
|
|
Subject.Handle(_event);
|
|
|
|
Mocker.GetMock<IBlacklistRepository>()
|
|
.Verify(v => v.Insert(It.Is<Blacklist>(b => b.EpisodeIds == _event.EpisodeIds)), Times.Once());
|
|
}
|
|
}
|
|
}
|