mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
New: Use native dotnet host and DryIoc
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using DryIoc;
|
||||
using DryIoc.Microsoft.DependencyInjection;
|
||||
using FluentAssertions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Composition.Extensions;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Common.Instrumentation.Extensions;
|
||||
using NzbDrone.Core.Datastore.Extensions;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Host;
|
||||
@@ -16,12 +21,16 @@ namespace NzbDrone.Common.Test
|
||||
[Test]
|
||||
public void event_handlers_should_be_unique()
|
||||
{
|
||||
var container = MainAppContainerBuilder.BuildContainer(new StartupContext());
|
||||
container.Register<IMainDatabase>(new MainDatabase(null));
|
||||
container.Register<ICacheDatabase>(new CacheDatabase(null));
|
||||
container.Resolve<IAppFolderFactory>().Register();
|
||||
var container = new Container(rules => rules.WithNzbDroneRules())
|
||||
.AddNzbDroneLogger()
|
||||
.AutoAddServices(Bootstrap.ASSEMBLIES)
|
||||
.AddDummyDatabase()
|
||||
.AddStartupContext(new StartupContext("first", "second"))
|
||||
.GetServiceProvider();
|
||||
|
||||
Mocker.SetConstant(container);
|
||||
container.GetRequiredService<IAppFolderFactory>().Register();
|
||||
|
||||
Mocker.SetConstant<System.IServiceProvider>(container);
|
||||
|
||||
var handlers = Subject.BuildAll<IHandle<ApplicationStartedEvent>>()
|
||||
.Select(c => c.GetType().FullName);
|
||||
|
||||
Reference in New Issue
Block a user