test: use helper method instead of custom assertion

Less the number of custom assertions is better because custom
assertion hides what is asserted.