Modernize project targets and Docker test flow
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user