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.Private.Uri" Version="4.3.2" />
<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.Wrappers" Version="19.2.29" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="19.2.51" />
<PackageVersion Include="YamlDotNet" Version="13.1.1" />
</ItemGroup>
<!-- Unit Test Packages -->
@ -58,7 +58,7 @@
<PackageVersion Include="Serilog.Sinks.NUnit" Version="1.0.3" />
<PackageVersion Include="Serilog.Sinks.TestCorrelator" Version="3.2.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>
<!-- Following found during vulerabilities Code Scan -->
<ItemGroup>

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

Loading…
Cancel
Save