|
|
@ -5,11 +5,11 @@ using Autofac;
|
|
|
|
using Autofac.Features.ResolveAnything;
|
|
|
|
using Autofac.Features.ResolveAnything;
|
|
|
|
using CliFx.Infrastructure;
|
|
|
|
using CliFx.Infrastructure;
|
|
|
|
using Common.TestLibrary;
|
|
|
|
using Common.TestLibrary;
|
|
|
|
using NSubstitute;
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using Recyclarr.Command;
|
|
|
|
using Recyclarr.Command;
|
|
|
|
using Serilog;
|
|
|
|
using Serilog;
|
|
|
|
using Serilog.Events;
|
|
|
|
using Serilog.Events;
|
|
|
|
|
|
|
|
using TestLibrary;
|
|
|
|
using TrashLib;
|
|
|
|
using TrashLib;
|
|
|
|
using TrashLib.Repo.VersionControl;
|
|
|
|
using TrashLib.Repo.VersionControl;
|
|
|
|
using TrashLib.Startup;
|
|
|
|
using TrashLib.Startup;
|
|
|
@ -31,9 +31,9 @@ public abstract class IntegrationFixture : IDisposable
|
|
|
|
builder.RegisterInstance(Console).As<IConsole>();
|
|
|
|
builder.RegisterInstance(Console).As<IConsole>();
|
|
|
|
builder.RegisterInstance(Logger).As<ILogger>().SingleInstance();
|
|
|
|
builder.RegisterInstance(Logger).As<ILogger>().SingleInstance();
|
|
|
|
|
|
|
|
|
|
|
|
RegisterMockFor<IServiceCommand>(builder);
|
|
|
|
builder.RegisterMockFor<IServiceCommand>();
|
|
|
|
RegisterMockFor<IGitRepository>(builder);
|
|
|
|
builder.RegisterMockFor<IGitRepository>();
|
|
|
|
RegisterMockFor<IGitRepositoryFactory>(builder);
|
|
|
|
builder.RegisterMockFor<IGitRepositoryFactory>();
|
|
|
|
|
|
|
|
|
|
|
|
RegisterExtraTypes(builder);
|
|
|
|
RegisterExtraTypes(builder);
|
|
|
|
|
|
|
|
|
|
|
@ -73,11 +73,6 @@ public abstract class IntegrationFixture : IDisposable
|
|
|
|
|
|
|
|
|
|
|
|
// ReSharper restore MemberCanBePrivate.Global
|
|
|
|
// ReSharper restore MemberCanBePrivate.Global
|
|
|
|
|
|
|
|
|
|
|
|
private static void RegisterMockFor<T>(ContainerBuilder builder) where T : class
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
builder.RegisterInstance(Substitute.For<T>()).As<T>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected T Resolve<T>() where T : notnull
|
|
|
|
protected T Resolve<T>() where T : notnull
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Container.Resolve<T>();
|
|
|
|
return Container.Resolve<T>();
|
|
|
|