webfmwktest

package
v4.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package webfmwktest implement wrapper around httptest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBody

func AssertBody(t *testing.T, rr *httptest.ResponseRecorder, expected string)

func AssertBodyDiffer

func AssertBodyDiffer(t *testing.T, rr *httptest.ResponseRecorder, expected string)

func AssertStatusCode

func AssertStatusCode(t *testing.T, rr *httptest.ResponseRecorder, expected int)

AssertStatusCode assert the status code of the response

func GetAndTest

func GetAndTest(t *testing.T, h webfmwk.HandlerFunc, e Expected)

GetAndTest perfome a get request on the webfmwk using the httptest package

Types

type Expected

type Expected struct {
	Code int
	Body string
}

Jump to

Keyboard shortcuts

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