Documentation
¶
Index ¶
Constants ¶
View Source
const (
// EmptyMessage not show message for assert
EmptyMessage = ""
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoUnit ¶
type GoUnit interface {
// AssertArrayHasKey Reports an error identified by "message" if "array" does
// not have the "key".
AssertArrayHasKey(key interface{}, array interface{}, message string)
// AssertContains Reports an error identified by "message" if "needle" is not
// an element of "array".
AssertContains(value interface{}, array interface{}, message string)
// Reports an error identified by "message" if the number of elements in "array"
// is not "expectedCount".
AssertCount(count int, array interface{}, message string)
// AssertDirectoryExists Reports an error identified by "message" if the
// directory specified by "dir" does not exist.
AssertDirectoryExists(dir string, message string)
// AssertFileExists Reports an error identified by "message" if the file specified
// by "file" does not exist.
AssertFileExists(file string, message string)
// AssertEmpty Reports an error identified by "message" if "actual" is not empty.
AssertEmpty(actual interface{}, message string)
// AssertEquals Reports an error identified by "message" if the two variables
// "expected" and "actual" are not equal.
AssertEquals(expected interface{}, actual interface{}, message string)
// AssertTrue Reports an error identified by "message" if "cond" is false.
AssertTrue(cond bool, message string)
// AssertFalse Reports an error identified by "message" if "cond" is true.
AssertFalse(cond bool, message string)
// AssertFileEquals Reports an error identified by "message: if the file specified
// by "expected" does not have the same contents as the file specified by "actual".
AssertFileEquals(expected string, actual string, message string)
// AssertGreaterThan Reports an error identified by "message" if the value of
// "actual" is not greater than the value of "expected".
AssertGreaterThan(expected, actual int, message string)
// AssertGreaterThanOrEqual Reports an error identified by "message" if the
// value of "actual" is not greater than or equal to the value of "expected".
AssertGreaterThanOrEqual(expected, actual int, message string)
// AssertLessThan Reports an error identified by "message" if the value of
// "actual" is not less than the value of "expected".
AssertLessThan(expected, actual int, message string)
// AssertLessThanOrEqual Reports an error identified by "message" if the value of
// "actual" is not less than or equal to the value of "expected".
AssertLessThanOrEqual(expected, actual int, message string)
//// AssertError Reports an error identified by "message" if "err" is error type
AssertError(err error, message string)
// AssertNotError Reports an error identified by "message" if "err" is not error type
AssertNotError(err error, message string)
// AssertIsNil Reports an error identified by "message" if "cond" is not nil.
AssertNil(cond interface{}, message string)
// AssertIsNotNil Reports an error identified by "message" if "cond" is nil.
AssertNotNil(cond interface{}, message string)
// TestCase
TestCase(x interface{}, fn TestCaseFunc)
}
GoUnit assert helper
type TestCaseFunc ¶ added in v1.0.4
type TestCaseFunc func(i interface{})
Click to show internal directories.
Click to hide internal directories.