Initial curated itworx-knowledge-hub source from 3b1751d0d9dee551aa6994eee0093704dc334817
This commit is contained in:
commit
ad8ad252a9
825 files changed
+124216
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using ItWorx.KnowledgeHub.Domain.Infrastructure;
|
||||
|
||||
namespace ItWorx.KnowledgeHub.Domain.Tests;
|
||||
|
||||
public sealed class FileSystemPathBoundaryTests
|
||||
{
|
||||
[Fact]
|
||||
public void Contains_accepts_the_root_and_descendants()
|
||||
{
|
||||
var root = Path.Combine(Path.GetTempPath(), "knowledge-imports");
|
||||
|
||||
Assert.True(FileSystemPathBoundary.Contains(root, root));
|
||||
Assert.True(FileSystemPathBoundary.Contains(root, Path.Combine(root, "nested", "source")));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Contains_rejects_parent_and_prefix_sibling_paths()
|
||||
{
|
||||
var parent = Path.Combine(Path.GetTempPath(), $"knowledge-parent-{Guid.NewGuid():N}");
|
||||
var root = Path.Combine(parent, "imports");
|
||||
|
||||
Assert.False(FileSystemPathBoundary.Contains(root, parent));
|
||||
Assert.False(FileSystemPathBoundary.Contains(root, Path.Combine(parent, "imports-private")));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user