Table of Contents

Class ServiceCollectionExtensions

Namespace
Cuemon.Extensions.Xunit.Hosting.AspNetCore
Assembly
Cuemon.Extensions.Xunit.Hosting.AspNetCore.dll

Extension methods for the Microsoft.Extensions.DependencyInjection.IServiceCollection interface.

public static class ServiceCollectionExtensions
Inheritance
Object
ServiceCollectionExtensions

Methods

AddFakeHttpContextAccessor(IServiceCollection, ServiceLifetime)

Adds a unit test optimized implementation for the Microsoft.AspNetCore.Http.IHttpContextAccessor service.

public static IServiceCollection AddFakeHttpContextAccessor(this IServiceCollection services, ServiceLifetime lifetime)

Parameters

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to extend.

lifetime ServiceLifetime

The lifetime of the service.

Returns

IServiceCollection

A reference to services after the operation has completed.