Add unit test for transaction