Library Usage
The unit testing framework is exported as testlib library. To invoke Netrix you need to instantiate TestingServer as follows,
server := testlib.NewTestServer(
config,
parser,
[]*TestCase{
testCaseOne,
testCaseTwo,
...
}
)
configis an instance of the Configuration object.parseris an implementation of theMessageParserinterface- A list of
TestCaseobjects which represent the unit tests that one needs to run.
To run the unit tests, call server.Start(). server.Done() returns a channel which will close once all the unit tests are executed. server.Stop() will terminate the server.