Class ProtoTestUser

Namespace
ProtoTest.Http
Assembly
ProtoTest.Http.dll

The identity a test acts as: a name, roles and claims. Declare one per test with [SignedInAs("alice", "admin")] or during the test body with context.SignIn(user); the identity lives in the test's execution context only, so it can never leak into the next test.

public sealed record ProtoTestUser : IProtoContext, IEquatable<ProtoTestUser>
Inheritance
ProtoTestUser
Implements
Inherited Members
Extension Methods

Constructors

ProtoTestUser(string, IReadOnlyList<string>?, IReadOnlyList<ProtoTestUserClaim>?)

Creates an identity.

public ProtoTestUser(string name, IReadOnlyList<string>? roles = null, IReadOnlyList<ProtoTestUserClaim>? claims = null)

Parameters

name string
roles IReadOnlyList<string>
claims IReadOnlyList<ProtoTestUserClaim>

Properties

Claims

Gets the claims the application sees.

public IReadOnlyList<ProtoTestUserClaim> Claims { get; init; }

Property Value

IReadOnlyList<ProtoTestUserClaim>

Name

Gets the user name the application sees.

public string Name { get; init; }

Property Value

string

Roles

Gets the roles the application sees.

public IReadOnlyList<string> Roles { get; init; }

Property Value

IReadOnlyList<string>