Modernize project targets and Docker test flow

This commit is contained in:
2026-02-28 17:27:20 +01:00
parent 02d95583e9
commit 654bcd8a1b
8 changed files with 161 additions and 122 deletions

View File

@@ -1,14 +1,31 @@
using VirtualFS.Physical;
namespace VirtualFS.Tests.Physical
namespace VirtualFS.Tests.Physical;
public sealed class PhysicalFileSystemTests : IDisposable
{
[TestClass]
public class PhysicalFileSystemTests
private readonly string _rootPath;
private readonly PhysicalFileSystem _fileSystem;
public PhysicalFileSystemTests()
{
[TestMethod]
public void TestEnumerate()
{
Assert.IsTrue(new PhysicalFileSystem(new DirectoryInfo("C:\\")).GetEntries("/").Count() > 0);
}
_rootPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "VirtualFS.Physical.Tests", Guid.NewGuid().ToString("N"));
System.IO.Directory.CreateDirectory(_rootPath);
System.IO.File.WriteAllText(System.IO.Path.Combine(_rootPath, "entry.txt"), "content");
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(_rootPath, "nested"));
_fileSystem = new PhysicalFileSystem(new DirectoryInfo(_rootPath));
}
}
[Fact]
public void EnumerateReturnsEntriesFromMountedDirectory()
{
Assert.True(_fileSystem.GetEntries("/").Count() > 0);
}
public void Dispose()
{
if (System.IO.Directory.Exists(_rootPath))
System.IO.Directory.Delete(_rootPath, recursive: true);
}
}