public void DeleteFile(string fileName, string currentDirectory) { var folderPath = _fileHandler.GetAbsolutePath(currentDirectory); var fileFullPaths = _fileHandler.EnumerateFiles(folderPath, "*", false); foreach (var fullPath in fileFullPaths) { if (_fileHandler.GetFileName(fullPath) == fileName) { _fileHandler.DeleteFile(fullPath); } } }