add tests to samples
add more tests to samples

fix #293
close #301