TestFile Class

Summary

Represents a file. Not all implementations will support all available methods and may throw System.NotSupportedException.
Assembly
Wyam.Testing.dll
Namespace
Wyam.Testing.IO
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IFile"] click Interface0 "/api/Wyam.Common.IO/IFile" Type-.->Interface1["IFileSystemEntry"] click Interface1 "/api/Wyam.Common.IO/IFileSystemEntry" Type["TestFile"] class Type type-node

Syntax

public class TestFile : IFile, IFileSystemEntry

Constructors

Properties

Name Value Summary
Directory IDirectory
Gets the directory of the file.
Exists bool
Gets a value indicating whether this Wyam.Common.IO.IFileSystemEntry exists.
Length long
Gets the length of the file.
Path FilePath
Gets the path to the file.

Methods

Name Value Summary
CopyTo(IFile, bool, bool) void
Copies the file to the specified destination file.
Delete() void
Deletes the file.
MoveTo(IFile) void
Moves the file to the specified destination file.
Open(bool) Stream
Opens the file for reading and writing. This will either create the file if it doesn't exist or overwrite it if it does.
OpenAppend(bool) Stream
Opens the file for writing. This will either create the file if it doesn't exist or append to it if it does.
OpenRead() Stream
Opens the file for reading. If it does not exist, an exception will be thrown.
OpenWrite(bool) Stream
Opens the file for writing. This will either create the file if it doesn't exist or overwrite it if it does.
ReadAllText() string
Reads all text from the file.
WriteAllText(string, bool) void
Writes the specified text to a file.
GitHub