added unit tests for Guard

Here they are. Sorry if some are a bit messy with duplicated code, but they work fine.