cursor constructor and test