test

package
v1.32.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: BSD-2-Clause Imports: 18 Imported by: 20

Documentation

Index

Constants

View Source
const (
	CharsetLowercase            = "abcdefghijklmnopqrstuvwxyz"
	CharsetUppercase            = "ABCDEFGHIJKLMNOPQRSTUVWYXZ"
	CharsetNumeric              = "1234567890"
	CharsetWhitespace           = " "
	CharsetSymbols              = "!\"#$%&'()*+,-./:;<=>@\\]^_`{|}~"
	CharsetUnicode              = "" /* 146-byte string literal not displayed */
	CharsetEmoji                = "😀🤣🤩😈👻😼💔💯💣👏💪🧠🧚🏄👣🐥🦖🥨🍕🍩🌎"
	CharsetAlpha                = CharsetUppercase + CharsetLowercase
	CharsetAlphaNumeric         = CharsetAlpha + CharsetNumeric
	CharsetText                 = CharsetAlphaNumeric + CharsetWhitespace + CharsetSymbols + CharsetUnicode + CharsetEmoji
	CharsetHexidecimalLowercase = CharsetNumeric + "abcdef"
)

Variables

This section is empty.

Functions

func ExpectSerializedObjectBSON added in v1.31.0

func ExpectSerializedObjectBSON(object interface{}, expected interface{})

func ExpectSerializedObjectJSON added in v1.31.0

func ExpectSerializedObjectJSON(object interface{}, expected interface{})

func FutureFarTime added in v1.31.0

func FutureFarTime() time.Time

func FutureNearTime added in v1.31.0

func FutureNearTime() time.Time

func MarshalRequestBody added in v1.29.0

func MarshalRequestBody(object interface{}) []byte

func MarshalResponseBody added in v1.30.0

func MarshalResponseBody(object interface{}) []byte

func MatchArray added in v1.31.0

func MatchArray(elements ...interface{}) gomegaTypes.GomegaMatcher

func MatchTime added in v1.31.0

func MatchTime(datum *time.Time) gomegaTypes.GomegaMatcher

func MustBool added in v1.31.0

func MustBool(value bool, err error) bool

func MustBytes added in v1.29.0

func MustBytes(value []byte, err error) []byte

func MustDuration added in v1.31.0

func MustDuration(value time.Duration, err error) time.Duration

func MustFloat64 added in v1.31.0

func MustFloat64(value float64, err error) float64

func MustInt added in v1.31.0

func MustInt(value int, err error) int

func MustString added in v1.31.0

func MustString(value string, err error) string

func MustStringArray added in v1.31.0

func MustStringArray(value []string, err error) []string

func MustTime added in v1.31.0

func MustTime(value time.Time, err error) time.Time

func NewObjectFromBool added in v1.27.0

func NewObjectFromBool(value bool, objectFormat ObjectFormat) interface{}

func NewObjectFromDuration added in v1.27.0

func NewObjectFromDuration(value time.Duration, objectFormat ObjectFormat) interface{}

func NewObjectFromFloat64 added in v1.27.0

func NewObjectFromFloat64(value float64, objectFormat ObjectFormat) interface{}

func NewObjectFromInt added in v1.27.0

func NewObjectFromInt(value int, objectFormat ObjectFormat) interface{}

func NewObjectFromString added in v1.27.0

func NewObjectFromString(value string, objectFormat ObjectFormat) interface{}

func NewObjectFromStringArray added in v1.27.0

func NewObjectFromStringArray(value []string, objectFormat ObjectFormat) interface{}

func NewObjectFromTime added in v1.27.0

func NewObjectFromTime(value time.Time, objectFormat ObjectFormat) interface{}

func PastFarTime added in v1.31.0

func PastFarTime() time.Time

func PastNearTime added in v1.31.0

func PastNearTime() time.Time

func RandomBool added in v1.26.0

func RandomBool() bool

func RandomBytes added in v1.27.0

func RandomBytes() []byte

func RandomBytesFromRange added in v1.27.0

func RandomBytesFromRange(minimumLength int, maximumLength int) []byte

func RandomBytesLengthMaximum added in v1.27.0

func RandomBytesLengthMaximum() int

func RandomBytesLengthMinimum added in v1.27.0

func RandomBytesLengthMinimum() int

func RandomDuration added in v1.27.0

func RandomDuration() time.Duration

func RandomDurationFromArray added in v1.27.0

func RandomDurationFromArray(array []time.Duration) time.Duration

func RandomDurationFromRange added in v1.27.0

func RandomDurationFromRange(minimum time.Duration, maximum time.Duration) time.Duration

func RandomDurationMaximum added in v1.27.0

func RandomDurationMaximum() time.Duration

func RandomDurationMinimum added in v1.27.0

func RandomDurationMinimum() time.Duration

func RandomFloat64 added in v1.27.0

func RandomFloat64() float64

func RandomFloat64FromArray added in v1.26.0

func RandomFloat64FromArray(array []float64) float64

func RandomFloat64FromRange added in v1.24.0

func RandomFloat64FromRange(minimum float64, maximum float64) float64

func RandomFloat64Maximum added in v1.27.0

func RandomFloat64Maximum() float64

func RandomFloat64Minimum added in v1.27.0

func RandomFloat64Minimum() float64

func RandomInt added in v1.27.0

func RandomInt() int

func RandomIntFromArray added in v1.26.0

func RandomIntFromArray(array []int) int

func RandomIntFromRange added in v1.24.0

func RandomIntFromRange(minimum int, maximum int) int

func RandomIntMaximum added in v1.27.0

func RandomIntMaximum() int

func RandomIntMinimum added in v1.27.0

func RandomIntMinimum() int

func RandomString added in v1.27.0

func RandomString() string

func RandomStringArray added in v1.27.0

func RandomStringArray() []string

func RandomStringArrayFromRange added in v1.27.0

func RandomStringArrayFromRange(minimumLength int, maximumLength int) []string

func RandomStringArrayFromRangeAndArrayWithDuplicates added in v1.27.0

func RandomStringArrayFromRangeAndArrayWithDuplicates(minimumLength int, maximumLength int, array []string) []string

func RandomStringArrayFromRangeAndArrayWithoutDuplicates added in v1.27.0

func RandomStringArrayFromRangeAndArrayWithoutDuplicates(minimumLength int, maximumLength int, array []string) []string

func RandomStringArrayFromRangeAndCharset added in v1.27.0

func RandomStringArrayFromRangeAndCharset(minimumLength int, maximumLength int, charset string) []string

func RandomStringArrayFromRangeAndGeneratorWithDuplicates added in v1.27.0

func RandomStringArrayFromRangeAndGeneratorWithDuplicates(minimumLength int, maximumLength int, generator func() string) []string

func RandomStringArrayFromRangeAndGeneratorWithoutDuplicates added in v1.27.0

func RandomStringArrayFromRangeAndGeneratorWithoutDuplicates(minimumLength int, maximumLength int, generator func() string) []string

func RandomStringArrayLengthMaximum added in v1.27.0

func RandomStringArrayLengthMaximum() int

func RandomStringArrayLengthMinimum added in v1.27.0

func RandomStringArrayLengthMinimum() int

func RandomStringFromArray added in v1.26.0

func RandomStringFromArray(array []string) string

func RandomStringFromCharset added in v1.27.0

func RandomStringFromCharset(charset string) string

func RandomStringFromRange added in v1.27.0

func RandomStringFromRange(minimumLength int, maximumLength int) string

func RandomStringFromRangeAndCharset added in v1.27.0

func RandomStringFromRangeAndCharset(minimumLength int, maximumLength int, charset string) string

func RandomStringLengthMaximum added in v1.27.0

func RandomStringLengthMaximum() int

func RandomStringLengthMinimum added in v1.27.0

func RandomStringLengthMinimum() int

func RandomTemporaryDirectory added in v1.27.0

func RandomTemporaryDirectory() string

func RandomTemporaryFile added in v1.27.0

func RandomTemporaryFile() *os.File

func RandomTime added in v1.27.0

func RandomTime() time.Time

func RandomTimeFromArray added in v1.27.0

func RandomTimeFromArray(array []time.Time) time.Time

func RandomTimeFromRange added in v1.27.0

func RandomTimeFromRange(minimum time.Time, maximum time.Time) time.Time

func RandomTimeMaximum added in v1.27.0

func RandomTimeMaximum() time.Time

func RandomTimeMinimum added in v1.27.0

func RandomTimeMinimum() time.Time

func Test added in v1.29.0

func Test(t *testing.T)

Types

type Closer added in v1.27.0

type Closer struct {
	CloseInvocations int
	CloseStub        func() error
	CloseOutputs     []error
	CloseOutput      *error
}

func NewCloser added in v1.27.0

func NewCloser() *Closer

func (*Closer) AssertOutputsEmpty added in v1.27.0

func (c *Closer) AssertOutputsEmpty()

func (*Closer) Close added in v1.27.0

func (c *Closer) Close() error

type MatchArrayMatcher added in v1.31.0

type MatchArrayMatcher struct {
	Elements []interface{}
}

func (*MatchArrayMatcher) FailureMessage added in v1.31.0

func (m *MatchArrayMatcher) FailureMessage(actual interface{}) (message string)

func (*MatchArrayMatcher) Match added in v1.31.0

func (m *MatchArrayMatcher) Match(actual interface{}) (bool, error)

func (*MatchArrayMatcher) NegatedFailureMessage added in v1.31.0

func (m *MatchArrayMatcher) NegatedFailureMessage(actual interface{}) (message string)

type ObjectFormat added in v1.27.0

type ObjectFormat int
const (
	ObjectFormatBSON ObjectFormat = iota
	ObjectFormatJSON
)

type ReadOutput added in v1.27.0

type ReadOutput struct {
	BytesRead int
	Error     error
}

type Reader added in v1.27.0

type Reader struct {
	ReadInvocations int
	ReadInputs      [][]byte
	ReadStub        func(bites []byte) (int, error)
	ReadOutputs     []ReadOutput
	ReadOutput      *ReadOutput
}

func NewReader added in v1.27.0

func NewReader() *Reader

func (*Reader) AssertOutputsEmpty added in v1.27.0

func (r *Reader) AssertOutputsEmpty()

func (*Reader) Read added in v1.27.0

func (r *Reader) Read(bites []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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