replace test functions with unittests