add test and add new constructor for ViewModel