testing

package
v0.2.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTest

func RunTest(t *testing.T, fun TestFunction, cases ...TestCase)

func TTA

func TTA(args ...interface{}) []interface{}

func ToTestArgs

func ToTestArgs(args ...interface{}) []interface{}

Types

type MockTestFunction

type MockTestFunction func(ctrl *gomock.Controller) []interface{}

type TestCase

type TestCase struct {
	Name      string
	Args      []interface{}
	Expected  TestExpected
	InitMocks MockTestFunction
}

type TestCasesSuite

type TestCasesSuite struct {
	suite.Suite
}

func (*TestCasesSuite) RunTest

func (s *TestCasesSuite) RunTest(fun TestFunction, cases ...TestCase)

type TestErrorExpected

type TestErrorExpected struct {
	CheckError bool // mean only check error without compare
	Error      error
}

type TestExpected

type TestExpected struct {
	PanicError      *TestPanicErrorExpected
	Error           *TestErrorExpected
	ExpectedReturns []interface{}
}

func TTCEE

func TTCEE() TestExpected

func TTE

func TTE(checkError bool, err error, withPanic bool, panicMsg string,
	expedites ...interface{},
) TestExpected

func TTEE

func TTEE(err error) TestExpected

func TTPEE

func TTPEE(msg interface{}) TestExpected

func TTVE

func TTVE(expedites ...interface{}) TestExpected

func ToTestCheckErrorExpected

func ToTestCheckErrorExpected() TestExpected

func ToTestErrorExpected

func ToTestErrorExpected(err error) TestExpected

func ToTestExpected

func ToTestExpected(checkError bool, err error, withPanic bool, panicMsg interface{},
	expedites ...interface{},
) TestExpected

func ToTestPanicErrorExpected

func ToTestPanicErrorExpected(msg interface{}) TestExpected

func ToTestValuesExpected

func ToTestValuesExpected(expedites ...interface{}) TestExpected

func (*TestExpected) HaveError

func (te *TestExpected) HaveError() bool

func (*TestExpected) HavePanicError

func (te *TestExpected) HavePanicError() bool

func (*TestExpected) MustErrorExpected

func (te *TestExpected) MustErrorExpected() TestErrorExpected

func (*TestExpected) MustPanicErrorExpected

func (te *TestExpected) MustPanicErrorExpected() TestPanicErrorExpected

type TestFunction

type TestFunction func(args ...interface{}) []interface{}

type TestPanicErrorExpected

type TestPanicErrorExpected struct {
	Msg interface{}
}

Jump to

Keyboard shortcuts

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