adding unit test for selection algorithm