Class BaseTest
Base class for all tests.
Inheritance
System.Object
BaseTest
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Celerik.NetCore.Services
Assembly: cs.temp.dll.dll
Syntax
public class BaseTest
Constructors
BaseTest(String, Object)
Initializes a new instance of the class.
Declaration
protected BaseTest(string userClaimKey = null, object userClaimValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userClaimKey | The user claim key. |
| System.Object | userClaimValue | The user claim value. |
Methods
AddServices(IServiceCollection)
Adds services to the current service provider.
Declaration
protected virtual void AddServices(IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | List where we add the services to. |
GetService<TService>()
Gets a service of type TService from the IServiceProvider.
Declaration
protected TService GetService<TService>()
Returns
| Type | Description |
|---|---|
| TService | A service object of type TService. |
Type Parameters
| Name | Description |
|---|---|
| TService |
GetValidator<TPayload>(TPayload)
Gets the IValidator that validates the passed-in payload object.
Declaration
protected IValidator<TPayload> GetValidator<TPayload>(TPayload payload)
Parameters
| Type | Name | Description |
|---|---|---|
| TPayload | payload | The payload object to get its IValidator. |
Returns
| Type | Description |
|---|---|
| IValidator<TPayload> | IValidator that validates the passed-in payload object. |
Type Parameters
| Name | Description |
|---|---|
| TPayload |
SetUserClaims(String, Object)
Sets the current User Claims.
Declaration
protected void SetUserClaims(string userClaimKey, object userClaimValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userClaimKey | The user claim key. |
| System.Object | userClaimValue | The user claim value. |