Added unit test from test branch