add tests of MemoryBuffer