Пример #1
0
        public static AuthUserBuilder User(string name = "user")
        {
            var registeredUserRole = RoleTestHelper.RegisteredUser().Build();

            return(new AuthUserBuilder()
                   .WithId(IdTestHelper.NextForUser())
                   .WithUsername(new Username(name))
                   .WithEmail($"{name}@example.com")
                   .WithPasswordHash(name)
                   .WithCreatedAt(Feb29)
                   .WithRoles(registeredUserRole));
        }
Пример #2
0
        public static AuthUserBuilder FromUser(User user)
        {
            var registeredUserRole = RoleTestHelper.RegisteredUser().Build();

            return(FromUserAndRoles(user, registeredUserRole));
        }