testutil

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExcludeOperations

func ExcludeOperations(ops ...Operation) testOption

func IgnorePostAssertForOperations

func IgnorePostAssertForOperations(ops ...Operation) testOption

func JSONComparer

func JSONComparer(comparer func(t require.TestingT, operation Operation, firstValue, secondValue string)) testOption

func RemoveFieldFromJSONResource

func RemoveFieldFromJSONResource(field, jsonResource string) string

func TestResourceType

func TestResourceType(t *testing.T, rt ResourceTypeTest, opts ...testOption)

func TestResourceTypeOperations

func TestResourceTypeOperations(t *testing.T, rt ResourceTypeTest, operations []operationTester)

func TestResourceTypeWithErrorOperations

func TestResourceTypeWithErrorOperations(t *testing.T, rt ResourceTypeTest)

Types

type Operation

type Operation string
const (
	OperationProvisioningSuccess          Operation = "ProvisioningSuccess"
	OperationProvisioningError            Operation = "ProvisioningError"
	OperationProvisioningTypeNotSupported Operation = "ProvisioningTypeNotSupported"
)
const OperationCreateInternalError Operation = "CreateInternalError"
const OperationCreateNoID Operation = "CreateNoID"
const OperationCreateSuccess Operation = "CreateSuccess"
const OperationDeleteInternalError Operation = "DeleteInternalError"
const OperationDeleteNotFound Operation = "DeleteNotFound"
const OperationDeleteSuccess Operation = "DeleteSuccess"
const OperationGetAugmentedSuccess Operation = "GetAugmentedSuccess"
const OperationGetInternalError Operation = "GetInternalError"
const OperationGetNotFound Operation = "GetNotFound"
const OperationGetSuccess Operation = "GetSuccess"
const OperationListAugmentedSuccess Operation = "ListAugmentedSuccess"
const OperationListInternalError Operation = "ListInternalError"
const OperationListNoResults Operation = "ListNoResults"
const OperationListSortSuccess Operation = "ListSortSuccess"
const OperationListSuccess Operation = "ListSuccess"
const OperationListWithInvalidSortField Operation = "ListWithInvalidSortField"
const OperationUpdateInternalError Operation = "UpdateInternalError"
const OperationUpdateNotFound Operation = "UpdateNotFound"
const OperationUpdateSuccess Operation = "UpdateSuccess"

type ResourceTypeTest

type ResourceTypeTest struct {
	ResourceTypeSingular string
	ResourceTypePlural   string
	RegisterManagerFn    func(*mux.Router, *sql.DB) rm.Manager
	Prepare              func(t *testing.T, operation Operation, manager rm.Manager)

	SampleJSON          string
	SampleJSONUpdated   string
	SampleJSONAugmented string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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