test

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowerLetterCasedString = "abcdefghijklmnopqrstuvwxyz"
	UpperLetterCasedString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Symbols                = "*/-+$¤£%ù*μ!§~#{'([-|`_\\]°)}´®†‹><²"
	NumberOnlyString       = "0123456789"
	LettersOnlyString      = LowerLetterCasedString + UpperLetterCasedString
	LowerCasedString       = LowerLetterCasedString + Symbols + NumberOnlyString
	UpperCasedString       = UpperLetterCasedString + Symbols + NumberOnlyString
	String                 = LowerLetterCasedString + UpperLetterCasedString + Symbols + NumberOnlyString + LettersOnlyString
)

nolint:lll

Variables

This section is empty.

Functions

func AssertMockFullFilled

func AssertMockFullFilled(t *testing.T, mocks ...*mock.Mock) bool

AssertMockFullFilled check list of mock to ensure all defined expectations are meet

func ExecInBasePath

func ExecInBasePath(baseName string)

ExecInBasePath move path up to first matching part ex: in path /usr/test/gitlab/platform/goCore/test ExecInBasePath(goCore) will move to /usr/test/gitlab/platform/goCore ExecInBasePath(test) will move to /usr/test

func GetStringOfLength

func GetStringOfLength(containChars string, length int) string

Get random string of asked length Provided character list to use to generate string

Provided charsets:

	LowerLetterCasedString = "abcdefghijklmnopqrstuvwxyz"
	UpperLetterCasedString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Symbols                = "*/-+$¤£%ù*μ!§~#{'([-|`_\\]°)}´®†‹><²"
	NumberOnlyString       = "0123456789"
	LettersOnlyString      = LowerLetterCasedString + UpperLetterCasedString
	LowerCasedString       = LowerLetterCasedString + Symbols + NumberOnlyString
	UpperCasedString       = UpperLetterCasedString + Symbols + NumberOnlyString
	String                 = LowerLetterCasedString + UpperLetterCasedString + Symbols
                     	+ NumberOnlyString + LettersOnlyString

func NewSQLXMocked

func NewSQLXMocked() (sqlmock.Sqlmock, *sqlx.DB)

New mocked sqlx db

func ResetMock

func ResetMock(m *mock.Mock)

ResetMock reset assertion for provided mock

func ResetMocks

func ResetMocks(mocks ...*mock.Mock)

ResetMocks reset assertions for provided mock list

func ShouldBeEquivalent

func ShouldBeEquivalent(actual interface{}, expected ...interface{}) string

nolint: gomnd

func ShouldBeFullFilled

func ShouldBeFullFilled(actual interface{}, _ ...interface{}) string

Assert provided DB/testify mock is full filled

func ShouldBeLikeError

func ShouldBeLikeError(actual interface{}, expected ...interface{}) string

Assert errors looks alike using goerrors.Is method

Types

This section is empty.

Jump to

Keyboard shortcuts

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