There are a couple ways that they test you, but the most common one is the 1 meter stick test.
I was lucky enough to get tested on Lake George, NY last summer when I backed into the public docks adn my exhaust bouncing off the seawall triggered the rent-a-cops to come over. The guy explained how everything works and said that the test is done at idle and that you have to wait 30 seconds after starting up the boat to get all teh water cycling through. Then they take a meter stick, put it to the back of your transom and attach the DB meter at the end. I have a stock engine/exhaust but still pulled 95.1(limit is 90.0) on the DB meter and got a $50 ticket.