2012-10-07 21:16:43 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using Moq;
|
|
|
|
|
using NUnit.Framework;
|
2013-02-24 07:48:52 +01:00
|
|
|
|
using NzbDrone.Core.Configuration;
|
2012-10-07 21:16:43 +02:00
|
|
|
|
using NzbDrone.Core.Jobs;
|
|
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.JobTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
// ReSharper disable InconsistentNaming
|
2013-02-17 06:44:06 +01:00
|
|
|
|
public class RssSyncJobTest : CoreTest
|
2012-10-07 21:16:43 +02:00
|
|
|
|
{
|
|
|
|
|
public void WithMinutes(int minutes)
|
|
|
|
|
{
|
2013-02-24 07:48:52 +01:00
|
|
|
|
Mocker.GetMock<ConfigService>().SetupGet(s => s.RssSyncInterval).Returns(minutes);
|
2012-10-07 21:16:43 +02: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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|