-
Notifications
You must be signed in to change notification settings - Fork 261
/
Copy pathIMockFileDataAccessor.cs
113 lines (93 loc) · 3.57 KB
/
IMockFileDataAccessor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using System.Collections.Generic;
using System.Reflection;
namespace System.IO.Abstractions.TestingHelpers;
/// <summary>
/// Provides access to the file system storage.
/// </summary>
public interface IMockFileDataAccessor : IFileSystem
{
/// <summary>
/// Adjust the times of the <paramref name="fileData"/>.
/// </summary>
/// <param name="fileData">The <see cref="MockFileData"/> for which the times should be adjusted.</param>
/// <param name="timeAdjustments">The adjustments to make on the <see cref="MockFileData"/>.</param>
/// <returns>The adjusted file.</returns>
MockFileData AdjustTimes(MockFileData fileData, TimeAdjustments timeAdjustments);
/// <summary>
/// Gets a file.
/// </summary>
/// <param name="path">The path of the file to get.</param>
/// <returns>The file. <see langword="null"/> if the file does not exist.</returns>
MockFileData GetFile(string path);
/// <summary>
/// Gets a drive.
/// </summary>
/// <param name="name">The name of the drive to get.</param>
/// <returns>The drive. <see langword="null"/> if the drive does not exist.</returns>
MockDriveData GetDrive(string name);
/// <summary>
/// Adds the file.
/// </summary>
/// <param name="path">The path of the file to add.</param>
/// <param name="mockFile">The file data to add.</param>
/// <param name="verifyAccess">Flag indicating if the access conditions should be verified.</param>
void AddFile(string path, MockFileData mockFile, bool verifyAccess = true);
/// <summary>
/// </summary>
void AddDirectory(string path);
/// <summary>
/// </summary>
void AddDrive(string name, MockDriveData mockDrive);
/// <summary>
/// </summary>
void AddFileFromEmbeddedResource(string path, Assembly resourceAssembly, string embeddedResourcePath);
/// <summary>
/// </summary>
void AddFilesFromEmbeddedNamespace(string path, Assembly resourceAssembly, string embeddedResourcePath);
/// <summary>
/// </summary>
void MoveDirectory(string sourcePath, string destPath);
/// <summary>
/// Removes the file.
/// </summary>
/// <param name="path">The file to remove.</param>
/// <param name="verifyAccess">Flag indicating if the access conditions should be verified.</param>
/// <remarks>
/// The file must not exist.
/// </remarks>
void RemoveFile(string path, bool verifyAccess = true);
/// <summary>
/// Determines whether the file exists.
/// </summary>
/// <param name="path">The file to check. </param>
/// <returns><see langword="true"/> if the file exists; otherwise, <see langword="false"/>.</returns>
bool FileExists(string path);
/// <summary>
/// Gets all unique paths of all files and directories.
/// </summary>
IEnumerable<string> AllPaths { get; }
/// <summary>
/// Gets the paths of all files.
/// </summary>
IEnumerable<string> AllFiles { get; }
/// <summary>
/// Gets the paths of all directories.
/// </summary>
IEnumerable<string> AllDirectories { get; }
/// <summary>
/// Gets the names of all drives.
/// </summary>
IEnumerable<string> AllDrives { get; }
/// <summary>
/// Gets a helper for string operations.
/// </summary>
StringOperations StringOperations { get; }
/// <summary>
/// Gets a helper for verifying file system paths.
/// </summary>
PathVerifier PathVerifier { get; }
/// <summary>
/// Gets a reference to the underlying file system.
/// </summary>
IFileSystem FileSystem { get; }
}