unitest

package
v0.0.0-...-c91f421 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 5 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
}

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
}

Table represent fields needed for running an unit test.

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