/// <summary> /// Checks if a file exists. /// </summary> /// <param name="fileSystem">The file system</param> /// <param name="filePath">The path to the file</param> /// <returns>A bool indicating if the file exists</returns> public static bool FileExists(this IFileSystem fileSystem, FileReference filePath) { return fileSystem.ListFilesInDirectory(filePath.GetDirectory()) .Contains(filePath.GetFileName().FileLocation); }