unit test for sample creation