refactor: Upgrade FileSystem to remove hack

This version of `System.IO.Abstractions` adds constructor options to
`MockFileSystem` that allows the removal of a hack put in place to
remove the temp directory so it does not interfere with unit test
expectations.
pull/201/head
Robert Dailey 10 months ago
parent a6ceae65fc
commit def934ebeb

@ -32,9 +32,9 @@
<PackageVersion Include="System.Data.HashFunction.FNV" Version="2.0.0" /> <PackageVersion Include="System.Data.HashFunction.FNV" Version="2.0.0" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" /> <PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Reactive" Version="6.0.0" /> <PackageVersion Include="System.Reactive" Version="6.0.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions" Version="19.2.29" /> <PackageVersion Include="TestableIO.System.IO.Abstractions" Version="19.2.51" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Extensions" Version="1.0.42" /> <PackageVersion Include="TestableIO.System.IO.Abstractions.Extensions" Version="1.0.42" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="19.2.29" /> <PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="19.2.51" />
<PackageVersion Include="YamlDotNet" Version="13.1.1" /> <PackageVersion Include="YamlDotNet" Version="13.1.1" />
</ItemGroup> </ItemGroup>
<!-- Unit Test Packages --> <!-- Unit Test Packages -->
@ -58,7 +58,7 @@
<PackageVersion Include="Serilog.Sinks.NUnit" Version="1.0.3" /> <PackageVersion Include="Serilog.Sinks.NUnit" Version="1.0.3" />
<PackageVersion Include="Serilog.Sinks.TestCorrelator" Version="3.2.0" /> <PackageVersion Include="Serilog.Sinks.TestCorrelator" Version="3.2.0" />
<PackageVersion Include="Spectre.Console.Testing" Version="0.47.0" /> <PackageVersion Include="Spectre.Console.Testing" Version="0.47.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="19.2.29" /> <PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="19.2.51" />
</ItemGroup> </ItemGroup>
<!-- Following found during vulerabilities Code Scan --> <!-- Following found during vulerabilities Code Scan -->
<ItemGroup> <ItemGroup>

@ -18,9 +18,10 @@ public abstract class TrashLibIntegrationFixture : IDisposable
{ {
protected TrashLibIntegrationFixture() protected TrashLibIntegrationFixture()
{ {
// todo: Remove later. Needed because of this issue: Fs = new MockFileSystem(new MockFileSystemOptions
// https://github.com/TestableIO/System.IO.Abstractions/issues/983 {
Fs.Directory.Delete("temp", true); CreateDefaultTempDir = false
});
Paths = new AppPaths(Fs.CurrentDirectory().SubDirectory("test").SubDirectory("recyclarr")); Paths = new AppPaths(Fs.CurrentDirectory().SubDirectory("test").SubDirectory("recyclarr"));
Logger = CreateLogger(); Logger = CreateLogger();
@ -76,7 +77,7 @@ public abstract class TrashLibIntegrationFixture : IDisposable
private readonly Lazy<IContainer> _container; private readonly Lazy<IContainer> _container;
protected ILifetimeScope Container => _container.Value; protected ILifetimeScope Container => _container.Value;
protected MockFileSystem Fs { get; } = new(); protected MockFileSystem Fs { get; }
protected TestConsole Console { get; } = new(); protected TestConsole Console { get; } = new();
protected IAppPaths Paths { get; } protected IAppPaths Paths { get; }
protected ILogger Logger { get; } protected ILogger Logger { get; }

Loading…
Cancel
Save