1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core.Test/TvTests/SeriesServiceFixture.cs

53 lines
2.3 KiB
C#
Raw Normal View History

using System.Linq;
2011-05-22 19:53:21 +03:00
using FizzWare.NBuilder;
2011-06-03 00:06:46 +03:00
using FluentAssertions;
using Moq;
2011-06-03 00:06:46 +03:00
using NUnit.Framework;
2013-02-24 09:48:52 +03:00
using NzbDrone.Core.Configuration;
using NzbDrone.Core.RootFolders;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv.Events;
2011-05-22 19:53:21 +03:00
namespace NzbDrone.Core.Test.TvTests
2011-05-22 19:53:21 +03:00
{
[TestFixture]
public class SeriesServiceFixture : CoreTest<SeriesService>
2011-05-22 19:53:21 +03:00
{
private Mock<ISeriesRepository> Repo;
private Series fakeSeries;
2012-10-14 03:54:46 +03:00
[SetUp]
public void Setup()
{
Repo = Mocker.GetMock<ISeriesRepository>();
fakeSeries = Builder<Series>.CreateNew().Build();
2012-10-14 03:54:46 +03:00
}
[Test]
public void series_added_event_should_have_proper_path()
2011-05-22 19:53:21 +03:00
{
Mocker.GetMock<IRootFolderService>().Setup(c => c.Get(It.IsAny<int>()))
.Returns(new RootFolder { Path = "c:\\root" });
var series = Subject.AddSeries(fakeSeries);
series.RootFolder.Should().NotBeNull();
series.RootFolder.Value.Should().NotBeNull();
VerifyEventPublished<SeriesAddedEvent>();
}
2011-05-22 19:53:21 +03:00
[Test]
public void is_monitored()
{
Repo.Setup(c => c.Get(12))
.Returns(fakeSeries);
fakeSeries.Monitored = true;
Subject.IsMonitored(12).Should().Be(true);
}
2011-05-22 19:53:21 +03:00
}
}