2013-11-13 20:08:37 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NLog;
|
2013-11-12 03:25:54 +00:00
|
|
|
|
using NzbDrone.Test.Common;
|
2016-04-04 17:40:51 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using System.IO;
|
2013-04-22 03:18:08 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Integration.Test
|
|
|
|
|
{
|
2016-04-04 17:40:51 +00:00
|
|
|
|
public abstract class IntegrationTest : IntegrationTestBase
|
2013-04-22 03:18:08 +00:00
|
|
|
|
{
|
2016-07-31 21:40:07 +00:00
|
|
|
|
protected NzbDroneRunner _runner;
|
2013-11-13 20:08:37 +00:00
|
|
|
|
|
2016-12-09 06:54:15 +00:00
|
|
|
|
public override string SeriesRootFolder => GetTempDirectory("SeriesRootFolder");
|
2013-08-14 03:22:28 +00:00
|
|
|
|
|
2016-12-09 06:54:15 +00:00
|
|
|
|
protected override string RootUrl => "http://localhost:8989/";
|
2013-08-14 05:02:25 +00:00
|
|
|
|
|
2016-12-09 06:54:15 +00:00
|
|
|
|
protected override string ApiKey => _runner.ApiKey;
|
2013-08-14 05:02:25 +00:00
|
|
|
|
|
2016-04-04 17:40:51 +00:00
|
|
|
|
protected override void StartTestTarget()
|
2013-04-22 03:18:08 +00:00
|
|
|
|
{
|
2014-12-17 07:12:26 +00:00
|
|
|
|
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger());
|
2013-08-14 03:22:28 +00:00
|
|
|
|
_runner.KillAll();
|
2013-04-22 03:18:08 +00:00
|
|
|
|
|
2013-08-14 03:22:28 +00:00
|
|
|
|
_runner.Start();
|
2016-04-04 17:40:51 +00:00
|
|
|
|
}
|
2014-04-19 15:09:22 +00:00
|
|
|
|
|
2016-04-04 17:40:51 +00:00
|
|
|
|
protected override void InitializeTestTarget()
|
|
|
|
|
{
|
2014-04-19 15:09:22 +00:00
|
|
|
|
// Add Wombles
|
|
|
|
|
var wombles = Indexers.Post(new Api.Indexers.IndexerResource
|
|
|
|
|
{
|
2014-08-18 02:25:00 +00:00
|
|
|
|
EnableRss = true,
|
2014-04-19 15:09:22 +00:00
|
|
|
|
ConfigContract = "NullConfig",
|
|
|
|
|
Implementation = "Wombles",
|
|
|
|
|
Name = "Wombles",
|
|
|
|
|
Protocol = Core.Indexers.DownloadProtocol.Usenet,
|
|
|
|
|
Fields = new List<Api.ClientSchema.Field>()
|
|
|
|
|
});
|
2013-08-13 05:08:37 +00:00
|
|
|
|
}
|
2013-04-22 03:18:08 +00:00
|
|
|
|
|
2016-04-04 17:40:51 +00:00
|
|
|
|
protected override void StopTestTarget()
|
2013-04-22 03:18:08 +00:00
|
|
|
|
{
|
2013-08-14 03:22:28 +00:00
|
|
|
|
_runner.KillAll();
|
2013-04-22 03:18:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|