write test code to test a controller