testing the yield in a method