2012-10-07 19:16:43 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using Moq;
|
|
|
|
|
using NUnit.Framework;
|
2013-02-24 06:48:52 +00:00
|
|
|
|
using NzbDrone.Core.Configuration;
|
2012-10-07 19:16:43 +00:00
|
|
|
|
using NzbDrone.Core.Jobs;
|
2013-03-05 05:51:07 +00:00
|
|
|
|
using NzbDrone.Core.Jobs.Implementations;
|
2012-10-07 19:16:43 +00:00
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.JobTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-03-28 22:07:09 +00:00
|
|
|
|
|
2013-02-17 05:44:06 +00:00
|
|
|
|
public class RssSyncJobTest : CoreTest
|
2012-10-07 19:16:43 +00:00
|
|
|
|
{
|
|
|
|
|
public void WithMinutes(int minutes)
|
|
|
|
|
{
|
2013-02-24 19:39:31 +00:00
|
|
|
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RssSyncInterval).Returns(minutes);
|
2012-10-07 19:16:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase(10)]
|
|
|
|
|
[TestCase(15)]
|
|
|
|
|
[TestCase(25)]
|
|
|
|
|
[TestCase(60)]
|
|
|
|
|
[TestCase(120)]
|
|
|
|
|
public void should_use_value_from_config_provider(int minutes)
|
|
|
|
|
{
|
|
|
|
|
WithMinutes(minutes);
|
|
|
|
|
Mocker.Resolve<RssSyncJob>().DefaultInterval.Should().Be(TimeSpan.FromMinutes(minutes));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|