Serialize to memory in the unit test and compare the full objects