Class TempFolder
Manages a temporary file system folder to be used for the duration of a unit test.
Namespace: Neon.IO
Assembly: Neon.Common.dll
Syntax
public sealed class TempFolder
Constructors
TempFolder(string, string, bool)
Creates a temporary folder.
Declaration
public TempFolder(string folder = null, string prefix = null, bool create = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | folder | Optionally overrides Root as the parent folder for this instance. |
| string | prefix | Optionally specifies a prefix to be added to the temporary directory name. |
| bool | create | Optionally controls whether the temporary folder should actually be created. This defaults to |
Properties
DisableDelete
Optionally used to disable folder deletion when the temporary folder is disposed.
Declaration
public bool DisableDelete { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Path
Returns the fully qualifed path to the temporary folder.
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| string |
Root
Optionally specifies the root directory where the temporary folders will
be created. This defaults to GetTempPath()
when this is null or empty.
Declaration
public static string Root { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Dispose()
Deletes the temporary folder and all of its contents.
Declaration
public void Dispose()
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |