Interface IFile
Wrapper class over File operations. This change was done for testability.
public interface IFile
Methods
Exists(string)
bool Exists(string path)
Parameters
path
string
Returns
ReadAllText(string)
string ReadAllText(string path)
Parameters
path
string
Returns
ReadAllTextAsync(string, CancellationToken)
Task<string> ReadAllTextAsync(string path, CancellationToken token = default)
Parameters
path
stringtoken
CancellationToken
Returns
WriteAllText(string, string)
void WriteAllText(string path, string contents)
Parameters
WriteAllTextAsync(string, string, CancellationToken)
Task WriteAllTextAsync(string path, string contents, CancellationToken token = default)
Parameters
path
stringcontents
stringtoken
CancellationToken