using System.IO.Abstractions; using Autofac; using Recyclarr.Platform; using Recyclarr.TestLibrary; using Recyclarr.TestLibrary.Autofac; using Recyclarr.TrashLib.Compatibility; using Recyclarr.VersionControl; namespace Recyclarr.TrashLib.TestLibrary; [FixtureLifeCycle(LifeCycle.InstancePerTestCase)] public abstract class TrashLibIntegrationFixture : IntegrationTestFixture { protected IAppPaths Paths { get; } protected TrashLibIntegrationFixture() { Paths = new AppPaths(Fs.CurrentDirectory().SubDirectory("test").SubDirectory("recyclarr")); } protected override void RegisterTypes(ContainerBuilder builder) { base.RegisterTypes(builder); builder.RegisterModule(); } protected override void RegisterStubsAndMocks(ContainerBuilder builder) { base.RegisterStubsAndMocks(builder); builder.RegisterInstance(Paths).As(); builder.RegisterMockFor(); builder.RegisterMockFor(); builder.RegisterMockFor(m => { // By default, choose some extremely high number so that all the newest features are enabled. m.GetVersion(default!).ReturnsForAnyArgs(_ => new Version("99.0.0.0")); }); } }