Some unit tests for nominal and error cases