C# Class MyTested.AspNetCore.Mvc.Utilities.Validators.AuthenticationValidator

Validator class containing authentication validation logic.
Mostrar archivo Open project: ivaylokenov/MyTested.AspNetCore.Mvc

Public Methods

Method Description
ValidateAuthenticationProperties ( Action authenticationPropertiesBuilder, ControllerTestContext testContext ) : void

Validates whether Properties are the same as the provided ones from action result containing such property by using a builder.

ValidateAuthenticationProperties ( dynamic actionResult, AuthenticationProperties properties, Action failedValidationAction ) : void

Validates whether Properties are the same as the provided ones from action result containing such property.

ValidateAuthenticationScheme ( dynamic actionResult, string authenticationScheme, Action failedValidationAction ) : void

Validates whether AuthenticationSchemes contains specific scheme from action result containing one.

ValidateAuthenticationSchemes ( dynamic actionResult, IEnumerable authenticationSchemes, Action failedValidationAction ) : void

Validates whether AuthenticationSchemes contains the provided schemes from action result containing one.

Private Methods

Method Description
SortAuthenticationSchemes ( IEnumerable authenticationSchemes ) : IList
TryGetAuthenticationProperties ( dynamic actionResult ) : AuthenticationProperties
TryGetAuthenticationSchemes ( dynamic actionResult ) : IList

Method Details

ValidateAuthenticationProperties() public static method

Validates whether Properties are the same as the provided ones from action result containing such property by using a builder.
public static ValidateAuthenticationProperties ( Action authenticationPropertiesBuilder, ControllerTestContext testContext ) : void
authenticationPropertiesBuilder Action Authentication properties builder.
testContext ControllerTestContext containing data about the currently executed assertion chain.
return void

ValidateAuthenticationProperties() public static method

Validates whether Properties are the same as the provided ones from action result containing such property.
public static ValidateAuthenticationProperties ( dynamic actionResult, AuthenticationProperties properties, Action failedValidationAction ) : void
actionResult dynamic Action result with Properties.
properties AuthenticationProperties Expected authentication properties.
failedValidationAction Action Action to call in case of failed validation.
return void

ValidateAuthenticationScheme() public static method

Validates whether AuthenticationSchemes contains specific scheme from action result containing one.
public static ValidateAuthenticationScheme ( dynamic actionResult, string authenticationScheme, Action failedValidationAction ) : void
actionResult dynamic Action result with AuthenticationSchemes.
authenticationScheme string Expected authentication scheme.
failedValidationAction Action Action to call in case of failed validation.
return void

ValidateAuthenticationSchemes() public static method

Validates whether AuthenticationSchemes contains the provided schemes from action result containing one.
public static ValidateAuthenticationSchemes ( dynamic actionResult, IEnumerable authenticationSchemes, Action failedValidationAction ) : void
actionResult dynamic Action result with AuthenticationSchemes.
authenticationSchemes IEnumerable Expected authentication schemes.
failedValidationAction Action Action to call in case of failed validation.
return void