Lidarr/NzbDrone.Integration.Test/IntegrationTest.cs

62 lines
1.6 KiB
C#
Raw Normal View History

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Threading;
using NUnit.Framework;
using NzbDrone.Api.Commands;
using NzbDrone.Api.RootFolders;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Integration.Test.Client;
2013-05-22 05:32:25 +00:00
using NzbDrone.Test.Common.Categories;
using RestSharp;
namespace NzbDrone.Integration.Test
{
[TestFixture]
2013-05-22 05:32:25 +00:00
[IntegrationTest]
public abstract class IntegrationTest
{
protected RestClient RestClient { get; private set; }
protected SeriesClient Series;
protected ClientBase<RootFolderResource> RootFolders;
protected ClientBase<CommandResource> Commands;
protected ReleaseClient Releases;
2013-05-03 05:24:52 +00:00
protected IndexerClient Indexers;
2013-08-14 03:22:28 +00:00
private NzbDroneRunner _runner;
[SetUp]
public void SmokeTestSetup()
{
new StartupArguments();
2013-08-14 03:22:28 +00:00
_runner = new NzbDroneRunner();
_runner.KillAll();
InitRestClients();
2013-08-14 03:22:28 +00:00
_runner.Start();
}
private void InitRestClients()
{
RestClient = new RestClient("http://localhost:8989/api");
Series = new SeriesClient(RestClient);
Releases = new ReleaseClient(RestClient);
RootFolders = new ClientBase<RootFolderResource>(RestClient);
Commands = new ClientBase<CommandResource>(RestClient);
2013-05-03 05:24:52 +00:00
Indexers = new IndexerClient(RestClient);
}
[TearDown]
public void SmokeTestTearDown()
{
2013-08-14 03:22:28 +00:00
_runner.KillAll();
}
}
}