Add more unit test for preferences