add unit test for Memory