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

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

Public Methods

Method Description
ValidateHttpStatusCode ( HttpStatusCode expectedHttpStatusCode, int actualHttpStatusCode, Action failedValidationAction ) : void

Validates whether two HTTP status codes are the same.

ValidateHttpStatusCode ( dynamic result, HttpStatusCode expectedHttpStatusCode, Action failedValidationAction ) : void

Validates whether StatusCode is the same as the provided one from action result containing such property.

Method Details

ValidateHttpStatusCode() public static method

Validates whether two HTTP status codes are the same.
public static ValidateHttpStatusCode ( HttpStatusCode expectedHttpStatusCode, int actualHttpStatusCode, Action failedValidationAction ) : void
expectedHttpStatusCode HttpStatusCode Expected HTTP status code.
actualHttpStatusCode int Actual HTTP status code.
failedValidationAction Action Action to call in case of failed validation.
return void

ValidateHttpStatusCode() public static method

Validates whether StatusCode is the same as the provided one from action result containing such property.
public static ValidateHttpStatusCode ( dynamic result, HttpStatusCode expectedHttpStatusCode, Action failedValidationAction ) : void
result dynamic Component result with StatusCode.
expectedHttpStatusCode HttpStatusCode Expected HTTP status code.
failedValidationAction Action Action to call in case of failed validation.
return void