public static RoleBuilder Admin() { return(new RoleBuilder() .WithId(IdTestHelper.Next()) .WithRolename(Role.ADMIN_ROLENAME) .WithCreatedAt(Feb29) .WithPermissions(Permissions.All.Except(Permissions.IgnoredByAdmins))); }
public static RoleBuilder RegisteredUser() { return(new RoleBuilder() .WithId(IdTestHelper.Next()) .WithRolename(Role.REGISTERED_USER_ROLENAME) .WithCreatedAt(Feb29) .WithPermissions(Permissions.PlayGame)); }
public static RoleBuilder PendingRegistration() { return(new RoleBuilder() .WithId(IdTestHelper.Next()) .WithRolename(Role.PENDING_REGISTRATION_ROLENAME) .WithCreatedAt(Feb29) .WithPermissions(Permissions.PendingRegistration)); }
public static GameBuilder PendingGame(GameSettings settings) { var gameId = new GameId(IdTestHelper.NextForGame()); return(new GameBuilder() .WithId(gameId) .WithSettings(settings) .WithCreatedAt(Feb29)); }
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)); }
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)); }
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)); }
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)); }