CgiTester

A helper test class for request handler unittests.

Constructors

this
this(void function(Cgi) requestHandler)

Pass a reference to your request handler when creating the tester.

Members

Functions

GET
Response GET(string url, string[] args = null)
POST
Response POST(string url, string[] args = null)
executeTest
Response executeTest(string method, string url, string[] args)

Executes a test request on your request handler, and returns the response.

getSessionObject
Session!Data getSessionObject()

Gets (and creates if necessary) a mock session object for this test. Note it will be the same one used for any test operations through this CgiTester instance.

Structs

Response
struct Response

You can check response information with these methods after you call the request handler.

Meta