2012-10-07 22:16:43 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using FluentAssertions;
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
2013-02-24 09:48:52 +03:00
|
|
|
using NzbDrone.Core.Configuration;
|
2012-10-07 22:16:43 +03:00
|
|
|
using NzbDrone.Core.Jobs;
|
|
|
|
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]
|
|
|
|
// ReSharper disable InconsistentNaming
|
2013-02-17 08:44:06 +03:00
|
|
|
public class RssSyncJobTest : CoreTest
|
2012-10-07 22:16:43 +03:00
|
|
|
{
|
|
|
|
public void WithMinutes(int minutes)
|
|
|
|
{
|
2013-02-24 22:39:31 +03:00
|
|
|
Mocker.GetMock<IConfigService>().SetupGet(s => s.RssSyncInterval).Returns(minutes);
|
2012-10-07 22:16:43 +03: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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|