mocks

package
v0.0.0-...-39a8fbd Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockBag

func MockBag(t *testing.T, db *gorm.DB, chainID, userID uint, o MockBagOptions) *models.Bag

func MockChainAndUser

func MockChainAndUser(t *testing.T, db *gorm.DB, o MockChainAndUserOptions) (chain *models.Chain, user *models.User, token string)

func MockEvent

func MockEvent(t *testing.T, db *gorm.DB, userID, chainID uint) (event *models.Event)

func MockGenders

func MockGenders(zeroOrMore bool) (genders []string)

func MockGinContext

func MockGinContext(db *gorm.DB, method string, url string, bodyJSON *gin.H, token string) (*gin.Context, func() mockGinContextResponse)

func MockMail

func MockMail(t *testing.T, db *gorm.DB, o MockMailOptions) (mail *models.Mail)

func MockSizes

func MockSizes(zeroOrMore bool) []string

func MockUser

func MockUser(t *testing.T, db *gorm.DB, chainID uint, o MockChainAndUserOptions) (user *models.User, token string)

Types

type Coordinates

type Coordinates struct {
	Latitude  float64
	Longitude float64
}

func FakeDutchCoordinates

func FakeDutchCoordinates() Coordinates

type MockBagOptions

type MockBagOptions struct {
	BagNameOverride string
}

type MockChainAndUserOptions

type MockChainAndUserOptions struct {
	IsNotEmailVerified bool
	IsNotTokenVerified bool
	IsNotApproved      bool
	IsRootAdmin        bool
	IsChainAdmin       bool
	IsNotPublished     bool
	IsOpenToNewMembers bool
	RoutePrivacy       *int
	RouteOrderIndex    int

	// for generating new members
	IsNotActive         bool
	OnlyEmailExampleCom bool
	OverrideLongitude   *float64
	OverrideLatitude    *float64
}

some options are negatives of the used value this is to keep the defaults to false when not specifically used

type MockEventOptions

type MockEventOptions struct {
	IsNotPublished bool
}

type MockMailOptions

type MockMailOptions struct {
	CreatedAt        time.Time
	IsErr            bool
	MaxRetryAttempts int
	NextRetryAttempt int
}

Jump to

Keyboard shortcuts

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