You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
namespace CommanderApp.Services;
|
|
|
|
public class MockFileOperations : IFileOperations
|
|
{
|
|
public List<string> CopiedFiles { get; } = new();
|
|
public List<string> MovedFiles { get; } = new();
|
|
public List<string> DeletedItems { get; } = new();
|
|
public List<string> CreatedDirectories { get; } = new();
|
|
public List<string> OpenedFiles { get; } = new();
|
|
|
|
public Task<bool> CopyAsync(string sourcePath, string targetPath, bool overwrite = true)
|
|
{
|
|
CopiedFiles.Add($"{sourcePath} -> {targetPath}");
|
|
return Task.FromResult(true);
|
|
}
|
|
|
|
public Task<bool> MoveAsync(string sourcePath, string targetPath, bool overwrite = true)
|
|
{
|
|
MovedFiles.Add($"{sourcePath} -> {targetPath}");
|
|
return Task.FromResult(true);
|
|
}
|
|
|
|
public Task<bool> DeleteAsync(string path)
|
|
{
|
|
DeletedItems.Add(path);
|
|
return Task.FromResult(true);
|
|
}
|
|
|
|
public Task<bool> CreateDirectoryAsync(string path)
|
|
{
|
|
CreatedDirectories.Add(path);
|
|
return Task.FromResult(true);
|
|
}
|
|
|
|
public Task<bool> OpenFileAsync(string filePath)
|
|
{
|
|
OpenedFiles.Add(filePath);
|
|
return Task.FromResult(true);
|
|
}
|
|
|
|
public Task<bool> CopyDirectoryAsync(string sourceDir, string targetDir)
|
|
{
|
|
CopiedFiles.Add($"DIR: {sourceDir} -> {targetDir}");
|
|
return Task.FromResult(true);
|
|
}
|
|
} |