mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 01:01:10 +00:00
Merge branch 'master' of https://github.com/BinaryAlley/Lumina into feature/add-media-items-location-options
This commit is contained in:
commit
e218d04bdc
1 file changed
+9
-3
+9
-3
@@ -98,12 +98,18 @@ public class DirectoryFixture
|
||||
private Directory CreateNestedDirectory(int currentDepth, int maxDepth, int maxChildrenPerDirectory)
|
||||
{
|
||||
List<FileSystemItem> childItems = [];
|
||||
|
||||
// ensure we create at least one child if we haven't reached max depth
|
||||
if (currentDepth < maxDepth)
|
||||
{
|
||||
int childCount = _faker.Random.Int(0, maxChildrenPerDirectory);
|
||||
// force at least 1 child, up to maxChildrenPerDirectory
|
||||
int childCount = _faker.Random.Int(1, maxChildrenPerDirectory);
|
||||
for (int i = 0; i < childCount; i++)
|
||||
childItems.Add(CreateNestedDirectory(currentDepth + 1, maxDepth, maxChildrenPerDirectory));
|
||||
{
|
||||
Directory childDirectory = CreateNestedDirectory(currentDepth + 1, maxDepth, maxChildrenPerDirectory);
|
||||
ErrorOr<Updated> addResult = childDirectory.SetParent(childDirectory);
|
||||
if (!addResult.IsError)
|
||||
childItems.Add(childDirectory);
|
||||
}
|
||||
}
|
||||
return CreateDirectory(childItems: childItems);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user