test_unit_utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToMockedRequestRecords

func AddToMockedRequestRecords(state *unitTestState, fullRoute, method string, headers [][]string, body []byte)

func AssertOptionsWithData

func AssertOptionsWithData(assertType AssertType, data map[string]interface{}) *AssertOptions

func AssertOptionsWithKeyValue

func AssertOptionsWithKeyValue(assertType AssertType, key, value string) *AssertOptions

func AssertOptionsWithKeyValues

func AssertOptionsWithKeyValues(assertType AssertType, keyValues map[string]interface{}) *AssertOptions

func AssertOptionsWithValue

func AssertOptionsWithValue(assertType AssertType, value string) *AssertOptions

func ExpectZeroValidationErrors

func ExpectZeroValidationErrors(t *testing.T, state *unitTestState)

func RemoveValidationErrors

func RemoveValidationErrors(t *testing.T, state *unitTestState)

func Reset

func Reset(state *unitTestState)

func RunUnitTest

func RunUnitTest(t *testing.T, funcs ...TestOperationFunc)

Types

type TestOperationFunc

type TestOperationFunc func(t *testing.T, state *unitTestState)

func AddGetRequestRecord

func AddGetRequestRecord(route string) TestOperationFunc

func AddGetRequestRecordWithHeaders

func AddGetRequestRecordWithHeaders(route string, headers [][]string) TestOperationFunc

func AddPostRequestRecordWithPayload

func AddPostRequestRecordWithPayload(route string, payload string) TestOperationFunc

func ExpectOneValidationError

func ExpectOneValidationError(errorCode ValidationErrorCode, errorMetadata map[string]string) TestOperationFunc

func ExpectValidationErrorNth

func ExpectValidationErrorNth(index int, errorCode ValidationErrorCode, errorMetadata map[string]string) TestOperationFunc

func ExpectValidationErrorsCount

func ExpectValidationErrorsCount(count int) TestOperationFunc

func Validate

func Validate(route string, assertOptions *AssertOptions) TestOperationFunc

func ValidateNth

func ValidateNth(nth int, route string, assertOptions *AssertOptions) TestOperationFunc

Jump to

Keyboard shortcuts

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