test

package
v0.0.0-...-d2a67e6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Router *mux.Router
	DB     *gorm.DB
)

Functions

func AssertEqual

func AssertEqual(t *testing.T, name string, expected, got interface{})

func AssertResponseCode

func AssertResponseCode(t *testing.T, expected, actual int)

func ClearAllTables

func ClearAllTables(t *testing.T, tables []string)

func CreateNewEntity

func CreateNewEntity[T any](t *testing.T, url string, entity T)

func ExecuteHTTPRequest

func ExecuteHTTPRequest(req *http.Request) *httptest.ResponseRecorder

func InitDBAndRouter

func InitDBAndRouter(t *testing.T)

func NewHTTPRequest

func NewHTTPRequest(t *testing.T, method, url string, body interface{}) *http.Request

func ParseResponseData

func ParseResponseData[T any](t *testing.T, res *httptest.ResponseRecorder) []T

func UnmarshalResponse

func UnmarshalResponse(t *testing.T, res *httptest.ResponseRecorder) utils.Response

Types

This section is empty.

Jump to

Keyboard shortcuts

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