add unit test for engine