Class ServiceCollectionExtensions
- Namespace
- Codebelt.Extensions.Xunit.Hosting.AspNetCore
- Assembly
- Codebelt.Extensions.Xunit.Hosting.AspNetCore.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddFakeHttpContextAccessor(IServiceCollection, ServiceLifetime)
Adds a unit test optimized implementation for the IHttpContextAccessor service.
public static IServiceCollection AddFakeHttpContextAccessor(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
lifetimeServiceLifetimeThe lifetime of the service. Default is Singleton.
Returns
- IServiceCollection
A reference to
servicesafter the operation has completed.