Added additional test coverage and mock functionality.