Esempio n. 1
0
 public static RoleBuilder Admin()
 {
     return(new RoleBuilder()
            .WithId(IdTestHelper.Next())
            .WithRolename(Role.ADMIN_ROLENAME)
            .WithCreatedAt(Feb29)
            .WithPermissions(Permissions.All.Except(Permissions.IgnoredByAdmins)));
 }
Esempio n. 2
0
 public static RoleBuilder RegisteredUser()
 {
     return(new RoleBuilder()
            .WithId(IdTestHelper.Next())
            .WithRolename(Role.REGISTERED_USER_ROLENAME)
            .WithCreatedAt(Feb29)
            .WithPermissions(Permissions.PlayGame));
 }
Esempio n. 3
0
 public static RoleBuilder PendingRegistration()
 {
     return(new RoleBuilder()
            .WithId(IdTestHelper.Next())
            .WithRolename(Role.PENDING_REGISTRATION_ROLENAME)
            .WithCreatedAt(Feb29)
            .WithPermissions(Permissions.PendingRegistration));
 }
Esempio n. 4
0
        public static GameBuilder PendingGame(GameSettings settings)
        {
            var gameId = new GameId(IdTestHelper.NextForGame());

            return(new GameBuilder()
                   .WithId(gameId)
                   .WithSettings(settings)
                   .WithCreatedAt(Feb29));
        }
Esempio n. 5
0
 public static UserBuilder User(string name = "user")
 {
     return(new UserBuilder()
            .WithId(IdTestHelper.NextForUser())
            .WithUsername(name)
            .WithRating(Rating.StartRating)
            .WithRank(Rank.Ranks.Private)
            .WithGamesPlayed(0)
            .WithCreatedAt(Feb29));
 }
Esempio n. 6
0
 public static PlayerBuilder FromUser(User user)
 {
     return(new PlayerBuilder()
            .WithId(IdTestHelper.Next())
            .WithUserId(user.Id)
            .WithUsername(user.Username)
            .WithRank(user.Rank)
            .WithColor(Color.Black)
            .WithCreatedAt(user.CreatedAt));
 }
Esempio n. 7
0
 public static PlayerBuilder Black()
 {
     return(new PlayerBuilder()
            .WithId(IdTestHelper.Next())
            .WithUserId(IdTestHelper.Next())
            .WithUsername("Black player")
            .WithRank(Rank.Ranks.Private)
            .WithColor(Color.Black)
            .WithCreatedAt(Feb29));
 }
Esempio n. 8
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));
        }