Add unit test for MainController