write unit tests