mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Naming config fixed, with integration tests
This commit is contained in:
parent
1e3a308917
commit
dd37713a10
7 changed files with 52 additions and 11 deletions
|
@ -55,6 +55,12 @@ namespace NzbDrone.Integration.Test.Client
|
|||
return Get<TResource>(request, statusCode);
|
||||
}
|
||||
|
||||
public TResource GetSingle(HttpStatusCode statusCode = HttpStatusCode.OK)
|
||||
{
|
||||
var request = BuildRequest();
|
||||
return Get<TResource>(request, statusCode);
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
{
|
||||
var request = BuildRequest(id.ToString());
|
||||
|
|
|
@ -11,7 +11,5 @@ namespace NzbDrone.Integration.Test
|
|||
{
|
||||
Commands.Post(new CommandResource {Command = "rsssync"});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ using NLog.Config;
|
|||
using NLog.Targets;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Api.Commands;
|
||||
using NzbDrone.Api.Episodes;
|
||||
using NzbDrone.Api.Config;
|
||||
using NzbDrone.Api.RootFolders;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Integration.Test.Client;
|
||||
|
@ -25,10 +25,10 @@ namespace NzbDrone.Integration.Test
|
|||
protected IndexerClient Indexers;
|
||||
protected EpisodeClient Episodes;
|
||||
protected SeasonClient Seasons;
|
||||
protected ClientBase<NamingConfigResource> NamingConfig;
|
||||
|
||||
private NzbDroneRunner _runner;
|
||||
|
||||
|
||||
public IntegrationTest()
|
||||
{
|
||||
new StartupArguments();
|
||||
|
@ -42,7 +42,6 @@ namespace NzbDrone.Integration.Test
|
|||
[SetUp]
|
||||
public void SmokeTestSetup()
|
||||
{
|
||||
|
||||
_runner = new NzbDroneRunner();
|
||||
_runner.KillAll();
|
||||
|
||||
|
@ -51,7 +50,6 @@ namespace NzbDrone.Integration.Test
|
|||
_runner.Start();
|
||||
}
|
||||
|
||||
|
||||
private void InitRestClients()
|
||||
{
|
||||
RestClient = new RestClient("http://localhost:8989/api");
|
||||
|
@ -62,6 +60,7 @@ namespace NzbDrone.Integration.Test
|
|||
Indexers = new IndexerClient(RestClient);
|
||||
Episodes = new EpisodeClient(RestClient);
|
||||
Seasons = new SeasonClient(RestClient);
|
||||
NamingConfig = new ClientBase<NamingConfigResource>(RestClient, "config/naming");
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
|
|
35
NzbDrone.Integration.Test/NamingConfigTests.cs
Normal file
35
NzbDrone.Integration.Test/NamingConfigTests.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace NzbDrone.Integration.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class NamingConfigTests : IntegrationTest
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get()
|
||||
{
|
||||
NamingConfig.GetSingle().Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_by_id()
|
||||
{
|
||||
var config = NamingConfig.GetSingle();
|
||||
NamingConfig.Get(config.Id).Should().NotBeNull();
|
||||
NamingConfig.Get(config.Id).Id.Should().Be(config.Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_update()
|
||||
{
|
||||
var config = NamingConfig.GetSingle();
|
||||
config.RenameEpisodes = false;
|
||||
|
||||
NamingConfig.Put(config).RenameEpisodes.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -99,6 +99,7 @@
|
|||
<Compile Include="Client\ReleaseClient.cs" />
|
||||
<Compile Include="Client\SeriesClient.cs" />
|
||||
<Compile Include="CommandIntegerationTests.cs" />
|
||||
<Compile Include="NamingConfigTests.cs" />
|
||||
<Compile Include="SeasonIntegrationTests.cs" />
|
||||
<Compile Include="EpisodeIntegrationTests.cs" />
|
||||
<Compile Include="IndexerIntegrationFixture.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue