servicetestutil

package
v0.0.0-...-77c9f96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateNotificationParams

type CreateNotificationParams struct {
	Receiver     *models.UserID
	ReceiverRole *models.Role
}

type CreateTeamFixture

type CreateTeamFixture struct {
	*models.Team
}

type CreateTeamParams

type CreateTeamParams struct {
	Project models.ProjectName
}

type CreateUserFixture

type CreateUserFixture struct {
	*models.User
	APIKey *models.UserAPIKey
	Token  string
}

type CreateUserParams

type CreateUserParams struct {
	DeletedAt  *time.Time
	Role       models.Role
	Scopes     models.Scopes
	WithToken  bool // if true, an access token is created and returned
	WithAPIKey bool // if true, an api key is created and returned
	TeamIDs    []models.TeamID
}

type CreateWorkItemCommentFixture

type CreateWorkItemCommentFixture struct {
	*models.WorkItemComment
}

type CreateWorkItemCommentParams

type CreateWorkItemCommentParams struct {
	UserID     models.UserID
	WorkItemID models.WorkItemID
}

type CreateWorkItemFixture

type CreateWorkItemFixture struct {
	*models.WorkItem
}

type CreateWorkItemParams

type CreateWorkItemParams struct{}

type FixtureFactory

type FixtureFactory struct {
	// contains filtered or unexported fields
}

FixtureFactory provides fixtures to create randomized elements in the data store.

func NewFixtureFactory

func NewFixtureFactory(
	t *testing.T,
	d models.DBTX,
	svc *services.Services,
) *FixtureFactory

NewFixtureFactory returns a new FixtureFactory.

func (*FixtureFactory) CreateGlobalNotification

func (ff *FixtureFactory) CreateGlobalNotification(ctx context.Context, params CreateNotificationParams) *models.UserNotification

CreateGlobalNotification creates a new global notification with the given configuration. Returns a single user notification from the fan out.

func (*FixtureFactory) CreatePersonalNotification

func (ff *FixtureFactory) CreatePersonalNotification(ctx context.Context, params CreateNotificationParams) *models.UserNotification

CreatePersonalNotification creates a new notification with the given configuration.

func (*FixtureFactory) CreateTeam

func (ff *FixtureFactory) CreateTeam(ctx context.Context, params CreateTeamParams) *CreateTeamFixture

CreateTeam creates a new random work item comment with the given configuration.

func (*FixtureFactory) CreateUser

func (ff *FixtureFactory) CreateUser(ctx context.Context, params CreateUserParams) *CreateUserFixture

CreateUser creates a new random user with the given configuration.

func (*FixtureFactory) CreateWorkItem

func (ff *FixtureFactory) CreateWorkItem(ctx context.Context, project models.ProjectName, caller services.CtxUser, teamID models.TeamID) *CreateWorkItemFixture

CreateWorkItem creates a new random work item comment with the given configuration.

func (*FixtureFactory) CreateWorkItemComment

func (ff *FixtureFactory) CreateWorkItemComment(ctx context.Context, userID models.UserID, workItemID models.WorkItemID) *CreateWorkItemCommentFixture

CreateWorkItemComment creates a new random work item comment with the given configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL