Updated method for testing initialization of class member with valid parameters