converted the samples to unit test form.