unit

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	// contains filtered or unexported fields
}

Assertion is an assertion library inspired by Truth. See http://google.github.io/truth/

func Assert

func Assert(t *testing.T) *Assertion

func (*Assertion) Bool

func (a *Assertion) Bool(value bool) *BoolSubject

func (*Assertion) Byte

func (a *Assertion) Byte(value byte) *ByteSubject

func (*Assertion) Bytes

func (a *Assertion) Bytes(value []byte) *BytesSubject

func (*Assertion) Error

func (a *Assertion) Error(value error) *ErrorSubject

func (*Assertion) Int

func (a *Assertion) Int(value int) *IntSubject

func (*Assertion) Int64

func (a *Assertion) Int64(value int64) *Int64Subject

func (*Assertion) Pointer

func (a *Assertion) Pointer(value interface{}) *PointerSubject

func (*Assertion) String

func (a *Assertion) String(value string) *StringSubject

func (*Assertion) Uint16

func (a *Assertion) Uint16(value uint16) *Uint16Subject

type BoolSubject

type BoolSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewBoolSubject

func NewBoolSubject(base *Subject, value bool) *BoolSubject

func (*BoolSubject) DisplayString

func (subject *BoolSubject) DisplayString() string

func (*BoolSubject) Equals

func (subject *BoolSubject) Equals(expectation bool)

func (*BoolSubject) Fail

func (subject *BoolSubject) Fail(verb string, other bool)

func (*BoolSubject) IsFalse

func (subject *BoolSubject) IsFalse()

func (*BoolSubject) IsTrue

func (subject *BoolSubject) IsTrue()

func (*BoolSubject) Named

func (subject *BoolSubject) Named(name string) *BoolSubject

type ByteSubject

type ByteSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewByteSubject

func NewByteSubject(base *Subject, value byte) *ByteSubject

func (*ByteSubject) DisplayString

func (subject *ByteSubject) DisplayString() string

func (*ByteSubject) Equals

func (subject *ByteSubject) Equals(expectation byte)

func (*ByteSubject) Fail

func (subject *ByteSubject) Fail(verb string, other byte)

func (*ByteSubject) GreaterThan

func (subject *ByteSubject) GreaterThan(expectation byte)

func (*ByteSubject) LessThan

func (subject *ByteSubject) LessThan(expectation byte)

func (*ByteSubject) Named

func (subject *ByteSubject) Named(name string) *ByteSubject

type BytesSubject

type BytesSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewBytesSubject

func NewBytesSubject(base *Subject, value []byte) *BytesSubject

func (*BytesSubject) DisplayString

func (subject *BytesSubject) DisplayString() string

func (*BytesSubject) Equals

func (subject *BytesSubject) Equals(expectation []byte)

func (*BytesSubject) Fail

func (subject *BytesSubject) Fail(verb string, other []byte)

func (*BytesSubject) Named

func (subject *BytesSubject) Named(name string) *BytesSubject

type ErrorSubject

type ErrorSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewErrorSubject

func NewErrorSubject(base *Subject, value error) *ErrorSubject

func (*ErrorSubject) DisplayString

func (subject *ErrorSubject) DisplayString() string

func (*ErrorSubject) Equals

func (subject *ErrorSubject) Equals(expectation error)

func (*ErrorSubject) Fail

func (subject *ErrorSubject) Fail(verb string, other error)

func (*ErrorSubject) IsNil

func (subject *ErrorSubject) IsNil()

func (*ErrorSubject) IsNotNil added in v0.9.1

func (subject *ErrorSubject) IsNotNil()

func (*ErrorSubject) Named

func (subject *ErrorSubject) Named(name string) *ErrorSubject

type Int64Subject

type Int64Subject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewInt64Subject

func NewInt64Subject(base *Subject, value int64) *Int64Subject

func (*Int64Subject) AtLeast

func (subject *Int64Subject) AtLeast(expectation int64)

func (*Int64Subject) AtMost

func (subject *Int64Subject) AtMost(expectation int64)

func (*Int64Subject) DisplayString

func (subject *Int64Subject) DisplayString() string

func (*Int64Subject) Equals

func (subject *Int64Subject) Equals(expectation int64)

func (*Int64Subject) Fail

func (subject *Int64Subject) Fail(verb string, other int64)

func (*Int64Subject) GreaterThan

func (subject *Int64Subject) GreaterThan(expectation int64)

func (*Int64Subject) Named

func (subject *Int64Subject) Named(name string) *Int64Subject

type IntSubject

type IntSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewIntSubject

func NewIntSubject(base *Subject, value int) *IntSubject

func (*IntSubject) DisplayString

func (subject *IntSubject) DisplayString() string

func (*IntSubject) Equals

func (subject *IntSubject) Equals(expectation int)

func (*IntSubject) Fail

func (subject *IntSubject) Fail(verb string, other int)

func (*IntSubject) GreaterThan

func (subject *IntSubject) GreaterThan(expectation int)

func (*IntSubject) LessThan

func (subject *IntSubject) LessThan(expectation int)

func (*IntSubject) Named

func (subject *IntSubject) Named(name string) *IntSubject

type PointerSubject

type PointerSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewPointerSubject

func NewPointerSubject(base *Subject, value interface{}) *PointerSubject

func (*PointerSubject) DisplayString

func (subject *PointerSubject) DisplayString() string

func (*PointerSubject) Equals

func (subject *PointerSubject) Equals(expectation interface{})

func (*PointerSubject) Fail

func (subject *PointerSubject) Fail(verb string, other interface{})

func (*PointerSubject) IsNil

func (subject *PointerSubject) IsNil()

func (*PointerSubject) IsNotNil

func (subject *PointerSubject) IsNotNil()

func (*PointerSubject) Named

func (subject *PointerSubject) Named(name string) *PointerSubject

type StringSubject

type StringSubject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewStringSubject

func NewStringSubject(base *Subject, value string) *StringSubject

func (*StringSubject) DisplayString

func (subject *StringSubject) DisplayString() string

func (*StringSubject) Equals

func (subject *StringSubject) Equals(expectation string)

func (*StringSubject) Fail

func (subject *StringSubject) Fail(verb string, other string)

func (*StringSubject) Named

func (subject *StringSubject) Named(name string) *StringSubject

type Subject

type Subject struct {
	// contains filtered or unexported fields
}

func NewSubject

func NewSubject(assert *Assertion) *Subject

func (*Subject) DisplayString

func (subject *Subject) DisplayString(value string) string

func (*Subject) FailWithMessage

func (subject *Subject) FailWithMessage(message string)

func (*Subject) Named

func (subject *Subject) Named(name string)

type Uint16Subject

type Uint16Subject struct {
	*Subject
	// contains filtered or unexported fields
}

func NewUint16Subject

func NewUint16Subject(base *Subject, value uint16) *Uint16Subject

func (*Uint16Subject) DisplayString

func (subject *Uint16Subject) DisplayString() string

func (*Uint16Subject) Equals

func (subject *Uint16Subject) Equals(expectation uint16)

func (*Uint16Subject) Fail

func (subject *Uint16Subject) Fail(verb string, other uint16)

func (*Uint16Subject) GreaterThan

func (subject *Uint16Subject) GreaterThan(expectation uint16)

func (*Uint16Subject) LessThan

func (subject *Uint16Subject) LessThan(expectation uint16)

func (*Uint16Subject) Named

func (subject *Uint16Subject) Named(name string) *Uint16Subject

func (*Uint16Subject) Positive

func (subject *Uint16Subject) Positive()

Jump to

Keyboard shortcuts

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