finished porting unit tests