Add a (mock based) test suite

Also avoid the use of a magic constant when an appropriately named constant
already exists.