Refactor test for .sample