Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Equal = AssertMethod{AssertFunc: assertion.Equal, LongName: "Equal", ShortName: "EQ", Symbol: "==", IsEqualType: true} NotEqual = AssertMethod{AssertFunc: assertion.NotEqual, LongName: "NotEqual", ShortName: "NEQ", Symbol: "!=", IsEqualType: true} OrderedEqual = AssertMethod{AssertFunc: assertion.Equal, LongName: "OrderedEqual", ShortName: "OEQ", Symbol: "#==", IsEqualType: true, IsOrdered: true} Contain = AssertMethod{AssertFunc: assertion.Contains, LongName: "Contains", ShortName: "CTN", Symbol: "$$", IsContainType: true} LessThan = AssertMethod{AssertFunc: assertion.LessThan, LongName: "LessThan", ShortName: "LT", Symbol: "<", IsContainType: false, IsNumericType: true} GreaterThan = AssertMethod{AssertFunc: assertion.GreaterThan, LongName: "GreaterThan", ShortName: "GT", Symbol: ">", IsContainType: false, IsNumericType: true} LessThanOrEq = AssertMethod{AssertFunc: assertion.LessThanOrEq, LongName: "LessThanOrEqual", ShortName: "LTE", Symbol: "<=", IsContainType: false, IsNumericType: true} GreaterThanOrEq = AssertMethod{AssertFunc: assertion.GreaterThanOrEq, LongName: "GreaterThanOrEqual", ShortName: "GTE", Symbol: ">=", IsContainType: false, IsNumericType: true} )
View Source
var NewAliasAsserts = []*AssertMethod{ &Equal, &NotEqual, &OrderedEqual, &Contain, &LessThan, &GreaterThan, &LessThanOrEq, &GreaterThanOrEq, }
Functions ¶
func ApplyAssert ¶
func ApplyAssert(probeAnswer *probe.ProbeAnswer, tAssert *Assert) (assertRes bool, failCause string)
ApplyAssert find the corresponding value to assert in probeAnswer then asserts the probe value with the expected value.
Types ¶
type Assert ¶
type Assert struct { Key string // Key in wich to pick the value from a probe result Method AssertMethod // Assert method (equal, sup, contains ...) Value interface{} // value to assert Values []string // values to assert ResultStatus int8 //TODO: à typer en teststruct.Status like ResultAssert string // ok, or assert fail msg }
func GetCleanAsserts ¶
GetCleanAsserts returns a structured TestStep Assertion Slice from raw assert string. this assertion slice has been validate.
func (Assert) AssertConditionsLong ¶
func (Assert) ToAssertDesc ¶
func (a Assert) ToAssertDesc() AssertDesc
func (Assert) ToAssertJSON ¶
func (a Assert) ToAssertJSON() *AssertShortJSON
ToAssertJSON returns a struct with content easily readable
type AssertDesc ¶
type AssertMethod ¶
type AssertMethod struct { LongName string ShortName string Symbol string IsNumericType bool IsEqualType bool IsContainType bool IsOrdered bool IsDuration bool AssertFunc func(actualValue interface{}, actualValues []string, expectValue interface{}, expectValueValues []string) (bool, string) `hash:"ignore"` }
type AssertResult ¶
type AssertShortJSON ¶
type AssertionsApplied ¶
Click to show internal directories.
Click to hide internal directories.