Add test for register function