mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Added service integration tests.
This commit is contained in:
parent
2fc561f195
commit
02a3b38210
7 changed files with 88 additions and 13 deletions
|
@ -0,0 +1,56 @@
|
|||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using Ninject;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Test.Integeration
|
||||
{
|
||||
[TestFixture(Category = "ServiceIngeneration")]
|
||||
[Explicit]
|
||||
public class ServiceIntegerationFixture : CoreTest
|
||||
{
|
||||
private KernelBase _kernel;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
WithRealDb();
|
||||
_kernel = new StandardKernel();
|
||||
_kernel.Bind<IDatabase>().ToConstant(Db);
|
||||
|
||||
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.ServiceRootUrl)
|
||||
.Returns("http://stage.services.nzbdrone.com");
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_update_scene_mapping()
|
||||
{
|
||||
_kernel.Get<SceneMappingProvider>().UpdateMappings();
|
||||
var mappings = Db.Fetch<SceneMapping>();
|
||||
|
||||
mappings.Should().NotBeEmpty();
|
||||
|
||||
mappings.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.CleanTitle));
|
||||
mappings.Should().OnlyContain(c => !string.IsNullOrWhiteSpace(c.SceneName));
|
||||
mappings.Should().OnlyContain(c => c.SeriesId > 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_daily_series_ids()
|
||||
{
|
||||
var dailySeries = _kernel.Get<ReferenceDataProvider>().GetDailySeriesIds();
|
||||
|
||||
dailySeries.Should().NotBeEmpty();
|
||||
dailySeries.Should().OnlyContain(c => c > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue