Class ProtoTestUser
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
namestringrolesIReadOnlyList<string>claimsIReadOnlyList<ProtoTestUserClaim>
Properties
Claims
Gets the claims the application sees.
public IReadOnlyList<ProtoTestUserClaim> Claims { get; init; }
Property Value
Name
Gets the user name the application sees.
public string Name { get; init; }
Property Value
Roles
Gets the roles the application sees.
public IReadOnlyList<string> Roles { get; init; }