Class AppServicesFixture<TEntryPoint>
- Namespace
- FEFF.TestFixtures.AspNetCore
- Assembly
- FEFF.TestFixtures.AspNetCore.dll
Allows retrieving services from the application under test, including scoped services.
public sealed class AppServicesFixture<TEntryPoint> : IAsyncDisposable, IAppServicesFixture where TEntryPoint : class
Type Parameters
TEntryPointThe application entry point type.
- Inheritance
-
AppServicesFixture<TEntryPoint>
- Implements
- Inherited Members
Constructors
AppServicesFixture(AppManagerFixture<TEntryPoint>)
Initializes a new instance of AppServicesFixture<TEntryPoint> that will create an async service scope when LazyServiceProvider is first accessed.
public AppServicesFixture(AppManagerFixture<TEntryPoint> app)
Parameters
appAppManagerFixture<TEntryPoint>The application manager fixture.
Properties
LazyServiceProvider
Gets the service provider from a IServiceScope of the application under test.
public IServiceProvider LazyServiceProvider { get; }
Property Value
Remarks
Starts the application under test if not already running.
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.