Documentation ¶
Overview ¶
Suite of testing-oriented commands that will trigger errors or failures if they aren't satistifed.
Index ¶
- type AssertArgs
- type BinaryComparison
- type Commands
- func (self *Commands) Compare(have interface{}, args *BinaryComparison) error
- func (self *Commands) Contains(have interface{}, args *BinaryComparison) error
- func (self *Commands) Empty(value interface{}, args *AssertArgs) error
- func (self *Commands) Equal(have interface{}, args *BinaryComparison) error
- func (self *Commands) Exists(value interface{}, args *AssertArgs) error
- func (self *Commands) False(value interface{}, args *AssertArgs) error
- func (self *Commands) Gt(have interface{}, args *BinaryComparison) error
- func (self *Commands) Gte(have interface{}, args *BinaryComparison) error
- func (self *Commands) IsArray(value interface{}, args *AssertArgs) error
- func (self *Commands) IsBoolean(value interface{}, args *AssertArgs) error
- func (self *Commands) IsDuration(value interface{}, args *AssertArgs) error
- func (self *Commands) IsNumeric(value interface{}, args *AssertArgs) error
- func (self *Commands) IsObject(value interface{}, args *AssertArgs) error
- func (self *Commands) IsScalar(value interface{}, args *AssertArgs) error
- func (self *Commands) IsString(value interface{}, args *AssertArgs) error
- func (self *Commands) IsTime(value interface{}, args *AssertArgs) error
- func (self *Commands) Lt(have interface{}, args *BinaryComparison) error
- func (self *Commands) Lte(have interface{}, args *BinaryComparison) error
- func (self *Commands) NotContains(have interface{}, args *BinaryComparison) error
- func (self *Commands) NotEqual(have interface{}, args *BinaryComparison) error
- func (self *Commands) NotNull(value interface{}, args *AssertArgs) error
- func (self *Commands) Null(value interface{}, args *AssertArgs) error
- func (self *Commands) True(value interface{}, args *AssertArgs) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertArgs ¶ added in v0.8.2
type AssertArgs struct { Message string `json:"message"` // contains filtered or unexported fields }
func (*AssertArgs) Error ¶ added in v0.8.2
func (self *AssertArgs) Error() string
type BinaryComparison ¶
type BinaryComparison struct { AssertArgs Value interface{} `json:"value"` Test string `json:"test"` }
type Commands ¶
func (*Commands) Compare ¶
func (self *Commands) Compare(have interface{}, args *BinaryComparison) error
Return an error if the given value is not equal to the other value.
func (*Commands) Contains ¶
func (self *Commands) Contains(have interface{}, args *BinaryComparison) error
Return an error if the given value does not contain another value.
func (*Commands) Empty ¶
func (self *Commands) Empty(value interface{}, args *AssertArgs) error
Return an error if the given value not empty.
func (*Commands) Equal ¶
func (self *Commands) Equal(have interface{}, args *BinaryComparison) error
Return an error if the given value is not equal to the other value.
func (*Commands) Exists ¶
func (self *Commands) Exists(value interface{}, args *AssertArgs) error
Return an error if the given value is null or zero-length.
func (*Commands) False ¶
func (self *Commands) False(value interface{}, args *AssertArgs) error
Return an error if the given value is not false.
func (*Commands) Gt ¶
func (self *Commands) Gt(have interface{}, args *BinaryComparison) error
Return an error if the given value is not numerically greater than the second value.
func (*Commands) Gte ¶
func (self *Commands) Gte(have interface{}, args *BinaryComparison) error
Return an error if the given value is not numerically greater than or equal to the second value.
func (*Commands) IsArray ¶
func (self *Commands) IsArray(value interface{}, args *AssertArgs) error
Return an error if the given value is not an array.
func (*Commands) IsBoolean ¶
func (self *Commands) IsBoolean(value interface{}, args *AssertArgs) error
Return an error if the given value is not a boolean value.
func (*Commands) IsDuration ¶
func (self *Commands) IsDuration(value interface{}, args *AssertArgs) error
Return an error if the given value is not parsable as a duration.
func (*Commands) IsNumeric ¶
func (self *Commands) IsNumeric(value interface{}, args *AssertArgs) error
Return an error if the given value is not a numeric value.
func (*Commands) IsObject ¶
func (self *Commands) IsObject(value interface{}, args *AssertArgs) error
Return an error if the given value is not an object.
func (*Commands) IsScalar ¶
func (self *Commands) IsScalar(value interface{}, args *AssertArgs) error
Return an error if the given value is not a scalar value.
func (*Commands) IsString ¶
func (self *Commands) IsString(value interface{}, args *AssertArgs) error
Return an error if the given value is not a string.
func (*Commands) IsTime ¶
func (self *Commands) IsTime(value interface{}, args *AssertArgs) error
Return an error if the given value is not parsable as a time.
func (*Commands) Lt ¶
func (self *Commands) Lt(have interface{}, args *BinaryComparison) error
Return an error if the given value is not numerically less than the second value.
func (*Commands) Lte ¶
func (self *Commands) Lte(have interface{}, args *BinaryComparison) error
Return an error if the given value is not numerically less than or equal to the second value.
func (*Commands) NotContains ¶
func (self *Commands) NotContains(have interface{}, args *BinaryComparison) error
Return an error if the given value contains another value.
func (*Commands) NotEqual ¶
func (self *Commands) NotEqual(have interface{}, args *BinaryComparison) error
Return an error if the given value is equal to the other value.
func (*Commands) NotNull ¶
func (self *Commands) NotNull(value interface{}, args *AssertArgs) error
Return an error if the given value is null.
func (*Commands) Null ¶
func (self *Commands) Null(value interface{}, args *AssertArgs) error
Return an error if the given value is not null.
func (*Commands) True ¶
func (self *Commands) True(value interface{}, args *AssertArgs) error
Return an error if the given value is not true.