Exemplo n.º 1
0
        async Task CreateTestDirectoriesAsync(int dirMax, string dirName)
        {
            await Task.Delay(1);

            WriteLine($"{s_testFluentPath} {dirMax} {dirName}");
            for (int a = 1; a <= dirMax; a++)
            {
                var aDirectory = s_testFluentPath.Clone(dirName.Repeat(a)).EnsureExist();
                for (int b = 1; b <= dirMax; b++)
                {
                    var bDirectory = aDirectory.Clone(dirName.Repeat(b)).EnsureExist();
                    for (int c = 1; c <= dirMax; c++)
                    {
#pragma warning disable IDE0059 // Value assigned to symbol is never used
                        var cDirectory = bDirectory.Clone(dirName.Repeat(c)).EnsureExist();
#pragma warning restore IDE0059 // Value assigned to symbol is never used
                    }
                }
            }
        }
Exemplo n.º 2
0
        private FilePath[] GenerateFiles(DirectoryPath directory, int filesCount, int nestingCount)
        {
            directory.Touch();

            var files = new List <FilePath>();

            for (var i = 0; i < filesCount; i++)
            {
                var currentDirectory = directory.Clone();

                for (var j = 0; j < nestingCount; j++)
                {
                    var directoryName = Randomize.String(5, 10, directoryNameSettings);
                    currentDirectory = currentDirectory.CombineDirectory(directoryName);
                }

                var fileName = Randomize.String(5, 10, directoryNameSettings);
                currentDirectory.CombineFile(fileName);
            }

            return(files.ToArray());
        }