helpers

package
v0.0.0-...-e8b8226 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCasingPermutations

func AllCasingPermutations(word string) []string

func NewMockDependencies

func NewMockDependencies() *types.Dependencies

func RootConn

func RootConn(dbSettings config.DatabaseSettings)

func SampleStudentFactory

func SampleStudentFactory() (models.User, string)

func SampleStudentJSONFactory

func SampleStudentJSONFactory(sampleStudent models.User, rawPassword string) *map[string]interface{}

func StringToPointer

func StringToPointer(s string) *string

Types

type ErrorWithTester

type ErrorWithTester struct {
	Error  errors.Error
	Tester Tester
}

type ExistingAppAssert

type ExistingAppAssert struct {
	App    TestApp
	Assert *assert.A
}

func InitTest

func InitTest(t *testing.T, configurators ...TestAppConfigurator) ExistingAppAssert

func (ExistingAppAssert) Close

func (eaa ExistingAppAssert) Close()

func (ExistingAppAssert) TestOnError

func (existingAppAssert ExistingAppAssert) TestOnError(request TestRequest, expectedError errors.Error) ExistingAppAssert

func (ExistingAppAssert) TestOnErrorAndTester

func (existingAppAssert ExistingAppAssert) TestOnErrorAndTester(request TestRequest, errorWithTester ErrorWithTester) ExistingAppAssert

func (ExistingAppAssert) TestOnMessage

func (existingAppAssert ExistingAppAssert) TestOnMessage(request TestRequest, status int, message string) ExistingAppAssert

func (ExistingAppAssert) TestOnMessageAndTester

func (existingAppAssert ExistingAppAssert) TestOnMessageAndTester(request TestRequest, status int, message string, tester Tester) ExistingAppAssert

func (ExistingAppAssert) TestOnStatus

func (existingAppAssert ExistingAppAssert) TestOnStatus(request TestRequest, status int) ExistingAppAssert

func (ExistingAppAssert) TestOnStatusAndTester

func (existingAppAssert ExistingAppAssert) TestOnStatusAndTester(request TestRequest, testerStatus TesterWithStatus) ExistingAppAssert

type TestApp

type TestApp struct {
	App      *fiber.App
	Address  string
	Conn     *gorm.DB
	Settings config.Settings
	TestUser *TestUser
}

func (*TestApp) Auth

func (app *TestApp) Auth(role models.UserRole)

func (TestApp) Send

func (app TestApp) Send(request TestRequest) (*http.Response, error)

type TestAppConfigurator

type TestAppConfigurator func(*TestApp)

func WithScrapedData

func WithScrapedData() TestAppConfigurator

type TestRequest

type TestRequest struct {
	Method             string
	Path               string
	Body               *map[string]interface{}
	Headers            *map[string]string
	Role               *models.UserRole
	TestUserIDReplaces *string
}

type TestUser

type TestUser struct {
	UUID         uuid.UUID
	Email        string
	Password     string
	AccessToken  string
	RefreshToken string
}

type Tester

type Tester func(eaa ExistingAppAssert, resp *http.Response)

type TesterWithStatus

type TesterWithStatus struct {
	Status int
	Tester
}

Jump to

Keyboard shortcuts

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