Implement proper unit tests