FakeHost Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Unit testing friendly configured host.
public ref class FakeHost sealed : IDisposable, Microsoft::Extensions::Hosting::IHost
public sealed class FakeHost : IDisposable, Microsoft.Extensions.Hosting.IHost
type FakeHost = class
interface IHost
interface IDisposable
Public NotInheritable Class FakeHost
Implements IDisposable, IHost
- Inheritance
-
FakeHost
- Implements
Services |
Gets the program's configured services. |
Create |
Creates an instance of IHostBuilder to configure and build the host. |
Create |
Creates an instance of IHostBuilder to configure and build the host. |
Create |
Creates an instance of IHostBuilder to configure and build the host. |
Dispose() |
Disposes the IHost instance. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Start |
Starts the program. |
Stop |
Attempts to gracefully stop the program. |
To |
Returns a string that represents the current object. (Inherited from Object) |
Get |
Gets the object that collects log records sent to the fake logger. |
Get |
Gets the object reporting all redactions performed. |
Run(IHost) |
Runs an application and blocks the calling thread until host shutdown is triggered and all IHostedService instances are stopped. |
Run |
Runs an application and returns a Task that only completes when the token is triggered or shutdown is triggered.
The |
Start(IHost) |
Starts the host synchronously. |
Stop |
Attempts to gracefully stop the host with the given timeout. |
Wait |
Blocks the calling thread until shutdown is triggered via Ctrl+C or SIGTERM. |
Wait |
Returns a Task that completes when shutdown is triggered via the given token. |
Өнім | Нұсқалар |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET кері байланысы
.NET — бастапқы коды ашық жоба. Пікір қалдыру үшін сілтемені таңдаңыз: