Further unit tests

Have added unit tests for the refresh functionality