unitest

package
v0.0.0-...-16ef530 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package unitest provides support for excuting unit test logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, table []Table, testName string)

Run performs the actual test logic based on the table data.

Types

type SeedData

type SeedData struct {
	Users             []User
	Admins            []User
	AssetConditions   []assetconditionbus.AssetCondition
	Assets            []assetbus.Asset
	Countries         []countrybus.Country
	Regions           []regionbus.Region
	Cities            []citybus.City
	Streets           []streetbus.Street
	ApprovalStatus    []approvalstatusbus.ApprovalStatus
	FulfillmentStatus []fulfillmentstatusbus.FulfillmentStatus
	AssetCondition    []assetconditionbus.AssetCondition
	AssetTypes        []assettypebus.AssetType
	Tags              []tagbus.Tag
	AssetTags         []assettagbus.AssetTag
	Title             []titlebus.Title
	ReportsTo         []reportstobus.ReportsTo
}

SeedData represents data that was seeded for the test.

type Table

type Table struct {
	Name    string
	ExpResp any
	ExcFunc func(ctx context.Context) any
	CmpFunc func(got any, exp any) string
}

type User

type User struct {
	userbus.User
	Products []productbus.Product
	Homes    []homebus.Home
}

User represents an app user specified for the test.

Jump to

Keyboard shortcuts

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