Summary
Represents a fake file.
- Namespace
- Cake
.Testing - Interfaces
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type-.->Interface0["IFile"]
click Interface0 "/api/Cake.Core.IO/IFile"
Type-.->Interface1["IFileSystemInfo"]
click Interface1 "/api/Cake.Core.IO/IFileSystemInfo"
Type["FakeFile"]
class Type type-node
Syntax
public sealed class FakeFile : IFile, IFileSystemInfo
Properties
| Name | Value | Summary |
|---|---|---|
| Attributes | FileAttributes |
Gets or sets the file attributes.
|
| Content | byte[] |
Gets the content.
|
| ContentLength | long |
Gets the length of the content.
|
| Exists | bool |
Gets a value indicating whether this
IFileSystemInfo exists.
|
| Hidden | bool |
Gets a value indicating whether this
IFileSystemInfo is hidden.
|
| LastWriteTime | DateTime |
Gets the time when this
IFileSystemInfo was last written to.
|
| Length | long |
Gets the length of the file.
|
| Path | FilePath |
Gets the path to the file.
|
Methods
| Name | Value | Summary |
|---|---|---|
| Copy |
void |
Copies the file to the specified destination path.
|
| Delete |
void |
Deletes the file.
|
| Move |
void |
Moves the file to the specified destination path.
|
| Open |
Stream |
Opens the file using the specified options.
|
| Resize |
void |
Resizes the file.
|
| SetCreationTime |
IFile |
Sets the date and time that the file was created.
|
| SetCreationTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the file was created.
|
| SetLastAccessTime |
IFile |
Sets the date and time that the specified file or directory was last accessed.
|
| SetLastAccessTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last accessed.
|
| SetLastWriteTime |
IFile |
Sets the date and time that the specified file or directory was last written to.
|
| SetLastWriteTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last written to.
|
Extension Methods
| Name | Value | Summary |
|---|---|---|
| Dump |
string |
Get a basic string representation of specified object.
From LoggingExtensions
Requires the Cake.Incubator addin
|
| GetBinaryContent |
byte[] |
Gets the binary content of the specified file.
From FakeFileExtensions
|
| GetTextContent |
string |
Gets the text content of the file.
From FakeFileExtensions
|
| GetTextContent |
string |
Gets the text content of the file.
From FakeFileExtensions
|
| HasUTF8BOM |
bool |
Determines if a specified file has a UTF-8 BOM.
From FakeFileExtensions
|
| Hide |
FakeFile |
Hides the specified file.
From FakeFileExtensions
|
| IsClrAssembly |
bool |
Checks if file has CLR PE Header.
From FileExtensions
|
| IsIn |
bool |
Checks if the source is contained in a list
From EnumerableExtensions
Requires the Cake.Incubator addin
|
| NotNull |
void |
Throws an exception if the specified parameter's value is null.
From Extensions
Requires the Cake.Ftp addin
|
| NotNull |
void |
Throws an exception if the specified parameter's value is null.
From IssuesArgumentChecks
Requires the Cake.Issues addin
|
| Open |
Stream |
Opens the file using the specified options.
From FileExtensions
|
| Open |
Stream |
Opens the file using the specified options.
From FileExtensions
|
| OpenRead |
Stream |
Opens the file for reading.
From FileExtensions
|
| OpenWrite |
Stream |
Opens the file for writing.
If the file already exists, it will be overwritten.
From FileExtensions
|
| ReadLines |
IEnumerable |
Enumerates line in file.
From FileExtensions
|
| SetContent |
FakeFile |
Sets the content of the provided file.
From FakeFileExtensions
|
| ThrowIfNull |
T |
Throws a
System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
| ThrowIfNull |
T |
Throws a
System.ArgumentNullException if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
| ToDictionary |
IDictionary |
From ObjectHelpers
Requires the Cake.DeployParams addin
|
| To |
string |
Returns the string value or a
Not set> markup suitable for Spectre.Console.
From StringExtensions
Requires the Cake.Issues addin
|
