test

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: BSD-2-Clause Imports: 8 Imported by: 20

Documentation

Index

Constants

View Source
const (
	CharsetUppercase            = "ABCDEFGHIJKLMNOPQRSTUVWYXZ"
	CharsetLowercase            = "abcdefghijklmnopqrstuvwxyz"
	CharsetNumeric              = "1234567890"
	CharsetWhitespace           = " "
	CharsetSymbols              = "!\"#$%&'()*+,-./:;<=>@\\]^_`{|}~"
	CharsetAlpha                = CharsetUppercase + CharsetLowercase
	CharsetAlphaNumeric         = CharsetUppercase + CharsetLowercase + CharsetNumeric
	CharsetText                 = CharsetAlphaNumeric + CharsetWhitespace + CharsetSymbols
	CharsetHexidecimalLowercase = CharsetNumeric + "abcdef"
)
View Source
const TimeLimit = 365 * 24 * time.Hour

Variables

This section is empty.

Functions

func CloneBool added in v1.26.0

func CloneBool(datum *bool) *bool

func CloneFloat64 added in v1.24.0

func CloneFloat64(datum *float64) *float64

func CloneInt added in v1.24.0

func CloneInt(datum *int) *int

func CloneString added in v1.24.0

func CloneString(datum *string) *string

func CloneStringArray added in v1.24.0

func CloneStringArray(datum *[]string) *[]string

func CloneTime added in v1.26.0

func CloneTime(datum *time.Time) *time.Time

func ExpectSerializedBSON added in v1.27.0

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

func ExpectSerializedJSON added in v1.27.0

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

func NewObjectFromBool added in v1.27.0

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

func NewObjectFromDuration added in v1.27.0

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

func NewObjectFromFloat64 added in v1.27.0

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

func NewObjectFromInt added in v1.27.0

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

func NewObjectFromString added in v1.27.0

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

func NewObjectFromStringArray added in v1.27.0

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

func NewObjectFromTime added in v1.27.0

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

func NewString

func NewString(length int, charset string) string

func NewText

func NewText(minimumLength int, maximumLength int) string

func NewTime added in v1.24.0

func NewTime() time.Time

func NewTimeInRange added in v1.24.0

func NewTimeInRange(earliest time.Time, latest time.Time) time.Time

func NewVariableString

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

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 TimeMaximum added in v1.24.0

func TimeMaximum() time.Time

func TimeMinimum added in v1.24.0

func TimeMinimum() time.Time

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 Mock

type Mock struct {
	ID string
}

func NewMock

func NewMock() *Mock

func (*Mock) Expectations

func (m *Mock) Expectations()

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(bytes []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(bytes []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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