Link Search Menu Expand Document

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,
        ...
    }
)
  • config is an instance of the Configuration object.
  • parser is an implementation of the MessageParser interface
  • A list of TestCase objects 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.