1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-01-01 04:38:20 +00:00

Tests: Remove dependency on Jackett.dll

This commit is contained in:
flightlevel 2018-08-18 17:27:35 +10:00
parent 524a0c7885
commit 795c896abe
2 changed files with 10 additions and 4 deletions

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<IsPackable>false</IsPackable>
</PropertyGroup>
@ -22,6 +23,7 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="FluentAssertions" Version="5.4.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
@ -36,7 +38,7 @@
<ItemGroup>
<ProjectReference Include="..\Jackett.Common\Jackett.Common.csproj" />
<ProjectReference Include="..\Jackett\Jackett.csproj" />
<ProjectReference Include="..\Jackett.Server\Jackett.Server.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -7,21 +7,25 @@ using Jackett.Common.Plumbing;
using Jackett.Common.Models.Config;
using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients;
using Microsoft.AspNetCore.DataProtection;
namespace Jackett.Test
{
class TestUtil
static class TestUtil
{
private static IContainer testContainer = null;
private static IContainer testContainer;
public static void SetupContainer()
{
IDataProtectionProvider dataProtectionProvider = new EphemeralDataProtectionProvider();
var builder = new ContainerBuilder();
builder.RegisterModule(new JackettModule(new RuntimeSettings()));
builder.RegisterType<Jackett.Services.ProtectionService>().As<IProtectionService>();
builder.RegisterType<Jackett.Server.Services.ProtectionService>().As<IProtectionService>();
builder.RegisterType<TestWebClient>().As<WebClient>().SingleInstance();
builder.RegisterInstance(LogManager.GetCurrentClassLogger()).SingleInstance();
builder.RegisterType<TestIndexerManagerServiceHelper>().As<IIndexerManagerService>().SingleInstance();
builder.RegisterInstance(dataProtectionProvider).SingleInstance();
testContainer = builder.Build();
}