testdb

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: CC-BY-4.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppClientBuilder

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

AppClientBuilder has helper methods to create applications and clients.

func (*AppClientBuilder) App

func (ab *AppClientBuilder) App(id uint) *MessageBuilder

App creates an application and returns a message builder.

func (*AppClientBuilder) AppWithToken

func (ab *AppClientBuilder) AppWithToken(id uint, token string) *MessageBuilder

AppWithToken creates an application with a token and returns a message builder.

func (*AppClientBuilder) AppWithTokenAndDefaultPriority added in v2.3.0

func (ab *AppClientBuilder) AppWithTokenAndDefaultPriority(id uint, token string, defaultPriority int) *MessageBuilder

AppWithTokenAndDefaultPriority creates an application with a token and defaultPriority and returns a message builder.

func (*AppClientBuilder) AppWithTokenAndName

func (ab *AppClientBuilder) AppWithTokenAndName(id uint, token, name string) *MessageBuilder

AppWithTokenAndName creates an application with a token and name and returns a message builder.

func (*AppClientBuilder) Client

func (ab *AppClientBuilder) Client(id uint) *AppClientBuilder

Client creates a client and returns itself.

func (*AppClientBuilder) ClientWithToken

func (ab *AppClientBuilder) ClientWithToken(id uint, token string) *AppClientBuilder

ClientWithToken creates a client with a token and returns itself.

func (*AppClientBuilder) InternalApp

func (ab *AppClientBuilder) InternalApp(id uint) *MessageBuilder

InternalApp creates an internal application and returns a message builder.

func (*AppClientBuilder) InternalAppWithToken

func (ab *AppClientBuilder) InternalAppWithToken(id uint, token string) *MessageBuilder

InternalAppWithToken creates an internal application with a token and returns a message builder.

func (*AppClientBuilder) InternalAppWithTokenAndName

func (ab *AppClientBuilder) InternalAppWithTokenAndName(id uint, token, name string) *MessageBuilder

InternalAppWithTokenAndName creates an internal application with a token and name and returns a message builder.

func (*AppClientBuilder) NewAppWithToken

func (ab *AppClientBuilder) NewAppWithToken(id uint, token string) *model.Application

NewAppWithToken creates an application with a token and returns the app.

func (*AppClientBuilder) NewAppWithTokenAndName

func (ab *AppClientBuilder) NewAppWithTokenAndName(id uint, token, name string) *model.Application

NewAppWithTokenAndName creates an application with a token and name and returns the app.

func (*AppClientBuilder) NewClientWithToken

func (ab *AppClientBuilder) NewClientWithToken(id uint, token string) *model.Client

NewClientWithToken creates a client with a token and returns the client.

func (*AppClientBuilder) NewInternalAppWithToken

func (ab *AppClientBuilder) NewInternalAppWithToken(id uint, token string) *model.Application

NewInternalAppWithToken creates an internal application with a token and returns the app.

func (*AppClientBuilder) NewInternalAppWithTokenAndName

func (ab *AppClientBuilder) NewInternalAppWithTokenAndName(id uint, token, name string) *model.Application

NewInternalAppWithTokenAndName creates an internal application with a token and name and returns the app.

type Database

type Database struct {
	*database.GormDatabase
	// contains filtered or unexported fields
}

Database is the wrapper for the gorm database with sleek helper methods.

func NewDB

func NewDB(t *testing.T) *Database

NewDB creates a new test db instance.

func NewDBWithDefaultUser

func NewDBWithDefaultUser(t *testing.T) *Database

NewDBWithDefaultUser creates a new test db instance with the default user.

func (*Database) AssertAppExist

func (d *Database) AssertAppExist(id uint)

AssertAppExist asserts that the app does exist.

func (*Database) AssertAppNotExist

func (d *Database) AssertAppNotExist(id uint)

AssertAppNotExist asserts that the app does not exist.

func (*Database) AssertClientExist

func (d *Database) AssertClientExist(id uint)

AssertClientExist asserts that the client does exist.

func (*Database) AssertClientNotExist

func (d *Database) AssertClientNotExist(id uint)

AssertClientNotExist asserts that the client does not exist.

func (*Database) AssertMessageExist

func (d *Database) AssertMessageExist(id uint)

AssertMessageExist asserts that the message does exist.

func (*Database) AssertMessageNotExist

func (d *Database) AssertMessageNotExist(ids ...uint)

AssertMessageNotExist asserts that the messages does not exist.

func (*Database) AssertUserExist

func (d *Database) AssertUserExist(id uint)

AssertUserExist asserts that the user does exist.

func (*Database) AssertUserNotExist

func (d *Database) AssertUserNotExist(id uint)

AssertUserNotExist asserts that the user does not exist.

func (*Database) AssertUsernameNotExist added in v2.1.0

func (d *Database) AssertUsernameNotExist(name string)

AssertUsernameNotExist asserts that the user does not exist.

func (*Database) NewUser

func (d *Database) NewUser(id uint) *model.User

NewUser creates a user and returns the user.

func (*Database) NewUserWithName

func (d *Database) NewUserWithName(id uint, name string) *model.User

NewUserWithName creates a user with a name and returns the user.

func (*Database) User

func (d *Database) User(id uint) *AppClientBuilder

User creates a user and returns a builder for applications and clients.

type MessageBuilder

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

MessageBuilder has helper methods to create messages.

func (*MessageBuilder) Message

func (mb *MessageBuilder) Message(id uint) *MessageBuilder

Message creates a message and returns itself.

func (*MessageBuilder) NewMessage

func (mb *MessageBuilder) NewMessage(id uint) model.Message

NewMessage creates a message and returns the message.

Jump to

Keyboard shortcuts

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