Exemple #1
0
    public async Task SearchPath(string path)
    {
        if (!await _fileSystemServices.DirectoryExists(path))
        {
            Output.WriteError($"[{path}] does not exists");
            return;
        }

        Output.WriteError($"[{path}] Task Added on thread {Environment.CurrentManagedThreadId}");

        await _fileWalker.RecursePath(path);

        Output.WriteError($"[{path}] Task Done");
    }
Exemple #2
0
    public async Task SearchAll()
    {
        // Given
        const string path1 = "/";
        const string path2 = "/tmp";

        _fileWalker.RecursePath(Arg.Any <string>()).Returns(Task.CompletedTask);

        _fileSystemService.GetLogicalDrives().Returns(new[] { path1, path2 });

        _fileSystemService.DirectoryExists(path1).Returns(true);
        _fileSystemService.DirectoryExists(path2).Returns(true);

        // When
        await _duplicateFinder.SearchAll();

        // Then
        await _fileWalker.Received(1).RecursePath(path1);

        await _fileWalker.Received(1).RecursePath(path2);
    }