added unit tests for mainController