add test cases for User class, integrated with demo