Table of Contents

Class FakeAuthorizationExtensions

Namespace
Bunit.TestDoubles
Assembly
Bunit.Web.dll

Helper methods for registering the Authentication/Authorization services with a TestServiceProvider.

public static class FakeAuthorizationExtensions
Inheritance
FakeAuthorizationExtensions
Inherited Members

Methods

AddTestAuthorization(TestContextBase)

Adds the appropriate Blazor authentication and authorization services to the TestServiceProvider to enable an authenticated user, as well as adding the CascadingAuthenticationState component to the test contexts render tree.

public static TestAuthorizationContext AddTestAuthorization(this TestContextBase context)

Parameters

context TestContextBase

Returns

TestAuthorizationContext
.NET Foundation

Supported by the .NET Foundation.