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:
parent
524a0c7885
commit
795c896abe
2 changed files with 10 additions and 4 deletions
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue