Table of Contents

Class UserFactory

Namespace
SEBT.Portal.Infrastructure.Helpers
Assembly
SEBT.Portal.Infrastructure.dll

Factory for creating UserEntity instances for testing. Uses the TestUtilities project's UserFactory to create domain models, then maps them to entities.

public static class UserFactory
Inheritance
object
UserFactory

Methods

CreateCoLoadedUser(Action<User>?)

Creates a User with co-loaded status set to true. Delegates to the TestUtilities project's UserFactory.

public static User CreateCoLoadedUser(Action<User>? customize = null)

Parameters

customize Action<User>

Returns

User

CreateCoLoadedUserEntity(Action<UserEntity>?)

Creates a UserEntity with co-loaded status set to true.

public static UserEntity CreateCoLoadedUserEntity(Action<UserEntity>? customize = null)

Parameters

customize Action<UserEntity>

Optional action to further customize the entity.

Returns

UserEntity

A UserEntity instance with IsCoLoaded = true.

CreateNonCoLoadedUser(Action<User>?)

Creates a User with non-co-loaded status (IsCoLoaded = false). Delegates to the TestUtilities project's UserFactory.

public static User CreateNonCoLoadedUser(Action<User>? customize = null)

Parameters

customize Action<User>

Returns

User

CreateNonCoLoadedUserEntity(Action<UserEntity>?)

Creates a UserEntity with co-loaded status set to false.

public static UserEntity CreateNonCoLoadedUserEntity(Action<UserEntity>? customize = null)

Parameters

customize Action<UserEntity>

Optional action to further customize the entity.

Returns

UserEntity

A UserEntity instance with IsCoLoaded = false.

CreateUser(Action<User>?)

Creates a new User instance with generated fake data. Delegates to the TestUtilities project's UserFactory.

public static User CreateUser(Action<User>? customize = null)

Parameters

customize Action<User>

Optional action to customize the generated user.

Returns

User

A new User instance.

CreateUserEntity(Action<UserEntity>?)

Creates a new UserEntity instance with realistic fake data.

public static UserEntity CreateUserEntity(Action<UserEntity>? customize = null)

Parameters

customize Action<UserEntity>

Optional action to customize the generated entity.

Returns

UserEntity

A new UserEntity instance.

CreateUserWithEmail(string, Action<User>?)

Creates a new User instance with a specific email address. Delegates to the TestUtilities project's UserFactory.

public static User CreateUserWithEmail(string email, Action<User>? customize = null)

Parameters

email string

The email address to use (may be empty/null for testing).

customize Action<User>

Optional action to further customize the user.

Returns

User

A new User instance with the specified email.