Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 3.25 KB

File metadata and controls

53 lines (42 loc) · 3.25 KB
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   REPO OVERVIEW   |   DEMO   |   CAT.UNITTESTING   |

Code Reference

FakeUser Class

A user for unit tests. The test sets the id, the name, the login state and the roles. It starts as a logged in user without roles. Use CatUser when the user never changes during the test. Derive from it to add the properties of your own application, such as an email address.

public class FakeUser : Cat.Users.Abstractions.ICatUser

Inheritance System.Object → FakeUser

Implements ICatUser

Properties
IsAuthenticated Whether the user is logged in. It starts as true.
Name The display name of the user. It starts as Test User.
Roles The roles of the user. Add to it or remove from it during the test.
UserId The id of the user. It starts as test-user.
Methods
InRole(string[]) Gives the user these roles.
IsInRole(string) Tells whether the user has the role.