Added unit test for invoke