-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various changes: documentation, test --viewResponse
- Loading branch information
Showing
9 changed files
with
195 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Netmockery is a simple system for simulating network services. | ||
|
||
The [documentation](netmockery/documentation.md) is a work in progress. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,108 @@ | ||
Directory structure | ||
=================== | ||
# Netmockery Documentation | ||
|
||
* [Running netmockery](#running) | ||
* [Configuring netmockery](#configuring) | ||
* [Writing tests](#tests) | ||
* [Misc](#misc) | ||
|
||
<a name="running"></a> | ||
# Running netmockery | ||
|
||
Command line: | ||
|
||
netmockery.exe p:\ath\to\endpoint\directory | ||
|
||
Netmockery starts and listens on port ``5000``. | ||
|
||
## Installing as windows service | ||
|
||
To install: | ||
|
||
sc create netmockery binPath= "p:\ath\to\netmockery.exe p:\ath\to\endpoint\directory service" | ||
|
||
If ``p:\ath\to\netmockery.exe`` or ``p:\ath\to\endpoint\directory`` contains spaces, they must be escaped using ``\"`` . Example: | ||
|
||
sc create netmockery binPath= "p:\ath\to\netmockery.exe \"p:\ath\to\endpoint\directory\with space\" service" | ||
|
||
Start/stop service: | ||
|
||
net start netmockery | ||
net stop netmockery | ||
|
||
To uninstall: | ||
|
||
sc delete netmockery | ||
|
||
<a name="configuring"></a> | ||
# Configuring netmockery | ||
|
||
## Directory structure | ||
|
||
TODO | ||
|
||
## Request matching | ||
|
||
Request matching | ||
================ | ||
TODO | ||
|
||
## Response creation | ||
|
||
TODO | ||
|
||
<a name="tests"></a> | ||
# Writing tests | ||
|
||
Within a endpoint directory, a ``tests`` directory with a ``tests.json`` file defines test cases for the endpoint directory. | ||
|
||
Example ``tests.json`` file: | ||
|
||
[ | ||
{ | ||
'name': 'My first test', | ||
'requestpath': '/somepath/', | ||
// optional request parameters: | ||
// querystring | ||
// requestbody | ||
|
||
// one or more test expectations: | ||
// expectedrequestmatcher | ||
// expectedresponsecreator | ||
// expectedresponsebody | ||
}, | ||
// More test cases | ||
] | ||
|
||
Specifying the request: | ||
|
||
* ``name``: display name for test (required) | ||
* ``requestpath``: request path (required) | ||
* ``querystring``: request query string | ||
* ``requestbody``: request body | ||
|
||
Specifying the expectations: | ||
|
||
* ``expectedrequestmatcher``: Display name of request matcher | ||
* ``expectedresponsecreator``: Display name of response creator | ||
* ``expectedresponsebody``: Expected response body contents. If specified as ``file:filename``, the expected response body is read from the specified file. | ||
|
||
## Running tests | ||
|
||
Command line: | ||
|
||
# run all tests | ||
netmockery.exe p:\ath\to\endpoint\directory test | ||
|
||
# run single test, numeric parameter N specifies which test (first test is test 0 (zero)) | ||
netmockery.exe p:\ath\to\endpoint\directory test --only N | ||
|
||
# execute request specified by test N, but display respons (do not check test expectations) | ||
netmockery.exe p:\ath\to\endpoint\directory test --only N --showResponse | ||
|
||
<a name="misc"></a> | ||
# Misc | ||
|
||
TODO: delay parameter | ||
|
||
Response creation | ||
================= | ||
TODO: index.md documentation | ||
|
||
TODO | ||
TODO: other commands, dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters