Two different things here.
1) You can pull the breakaway if you just want to check that the brakes on the trailer function. This is assuming that your battery and associated breakaway wiring is in good order.
2) If you want to test whether or not the brakes work with the truck brake control, the trailer does not need to be hitched to the truck, just plugged in, if you have a good ground through your trailer plug. If the brakes won't work when plugged in, but do work when hitched up, then you need to look into making a better ground through your plug. Like Turbo Thom said, you don't want to rely on making your ground through the trailer hitch as it's not always reliable (grease on surfaces, rust, etc will limit the efficiency).
JM