httptest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertErrorMessage

func AssertErrorMessage(t *testing.T, res *http.Response, expectedMessage string)

AssertErrorMessage asserts that the given *http.Response contains the specified error message

func AssertFailedFiberGET

func AssertFailedFiberGET(t *testing.T, app *fiber.App, route string, status int, message string)

AssertFailedFiberGET asserts that the specified route, when handled by the given *fiber.App, renders the specified fiber.Error

func AssertFailedGET

func AssertFailedGET(t *testing.T, route string, expectedStatus int, expectedMessage string)

AssertFailedGET asserts that issuing a GET request to the specified route renders the given status and error message

func AssertFiberGET

func AssertFiberGET(t *testing.T, app *fiber.App, route string, status int, assertResponse func(*http.Response))

AssertFiberGET asserts that the specified route, when handled by the given *fiber.App, renders the specified status and satisfies the given assertResponse function

func AssertHeaderPages

func AssertHeaderPages(t *testing.T, res *http.Response, expectedPages int)

AssertHeaderPages asserts that the given *http.Response has the expected "x-pages" header value

func AssertJSONBattle

func AssertJSONBattle(t *testing.T, res *http.Response, expectedBattle battles.Battle)

AssertJSONBattle asserts that the given *http.Response contains the specified JSON-serialized battles.Battle

func AssertJSONBattles

func AssertJSONBattles(t *testing.T, res *http.Response, expectedBattles []battles.Battle)

AssertJSONBattles is like AssertJSONBattle, but for a slice of battles.Battle

func AssertJSONCommander

func AssertJSONCommander(t *testing.T, res *http.Response, expectedCommander commanders.Commander)

AssertJSONCommander asserts that the given *http.Response contains the specified JSON-serialized commanders.Commander

func AssertJSONCommanders

func AssertJSONCommanders(t *testing.T, res *http.Response, expectedCommanders []commanders.Commander)

AssertJSONCommanders is like AssertJSONCommander, but for a slice of commanders.Commander

func AssertJSONFaction

func AssertJSONFaction(t *testing.T, res *http.Response, expectedFaction factions.Faction)

AssertJSONFaction asserts that the given *http.Response contains the specified JSON-serialized factions.Faction

func AssertJSONFactions

func AssertJSONFactions(t *testing.T, res *http.Response, expectedFactions []factions.Faction)

AssertJSONFactions is like AssertJSONFaction, but for a slice of factions.Faction

Types

This section is empty.

Jump to

Keyboard shortcuts

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