Table of Contents

Class FakeAuthorizationPolicyProvider

Namespace
Bunit.TestDoubles
Assembly
Bunit.Web.dll

Test class that provides an implementation of IAuthorizationPolicyProvider that assists user in testing components that use authentication and authorization.

public class FakeAuthorizationPolicyProvider : IAuthorizationPolicyProvider
Inheritance
FakeAuthorizationPolicyProvider
Implements
Inherited Members
Extension Methods

Constructors

FakeAuthorizationPolicyProvider()

public FakeAuthorizationPolicyProvider()

Methods

GetDefaultPolicyAsync()

Gets the default authorization policy.

public Task<AuthorizationPolicy> GetDefaultPolicyAsync()

Returns

Task<AuthorizationPolicy>

Default policy.

GetFallbackPolicyAsync()

Gets the fallback authorization policy.

public Task<AuthorizationPolicy?> GetFallbackPolicyAsync()

Returns

Task<AuthorizationPolicy>

Fallback policy.

GetPolicyAsync(string)

Get the current policy, which in this implementation just returns a test policy.

public Task<AuthorizationPolicy?> GetPolicyAsync(string policyName)

Parameters

policyName string

Policy name.

Returns

Task<AuthorizationPolicy>

Test policy for the specified name.

SetPolicyScheme(string)

Sets the currently supported policies for this provider.

public void SetPolicyScheme(string policySchemeName)

Parameters

policySchemeName string

Policy scheme name to use.

Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.