Class TmpDirectoryFixture
- Namespace
- FEFF.TestFixtures
- Assembly
- FEFF.TestFixtures.dll
Returns a unique directory for each scope where the fixture is requested.
The directory is deleted after every scope finishes.
public sealed class TmpDirectoryFixture : IDisposable, IFixtureRegistrar
- Inheritance
-
TmpDirectoryFixture
- Implements
- Inherited Members
Remarks
Every call to the fixture within the same scope returns the same fixture instance.
Constructors
TmpDirectoryFixture(IOptions<Options>)
Creates a unique temporary subdirectory for the current test scope.
public TmpDirectoryFixture(IOptions<TmpDirectoryFixture.Options> opts)
Parameters
optsIOptions<TmpDirectoryFixture.Options>The configured options for directory creation and disposal.
Properties
Path
Gets the full path of the temporary directory created for this scope.
public string Path { get; }
Property Value
Methods
Dispose()
Deletes the temporary directory if DisposeType is set to Delete. Safe to call multiple times; ignores missing directories.
public void Dispose()
RegisterFixture(IServiceCollection)
Registers TmpDirectoryFixture configuration options with the service collection,
binding from the TmpDirectoryFixture configuration section.
public static void RegisterFixture(IServiceCollection services)
Parameters
servicesIServiceCollectionThe IServiceCollection to register with.