Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiScenario ¶
type ApiScenario struct { Name string Method string Url string Body io.Reader RequestHeaders map[string]string // Delay adds a delay before checking the expectations usually // to ensure that all fired non-awaited go routines have finished Delay time.Duration // expectations // --- ExpectedStatus int ExpectedContent interface{} // test hooks // --- BeforeRequest func(req *http.Request, server *Server) AfterRequest func(res *http.Response, server *Server) }
ApiScenario defines a single api request test case/scenario.
type ApiTestCase ¶
type ApiTestCase struct { // test hooks // --- BeforeTestFunc func(t *testing.T, app *Server) AfterTestFunc func(t *testing.T, app *Server) // contains filtered or unexported fields }
func NewTestCase ¶
func NewTestCase(t testing.T, scenarios []ApiScenario, beforeTestFunc, afterTestFunc func(t *testing.T, app *Server)) ApiTestCase
func (*ApiTestCase) Test ¶
func (testCase *ApiTestCase) Test()
Test executes the test case/scenario.
Click to show internal directories.
Click to hide internal directories.