Unit testing serialization pre-membase
I've recently come across a problem with a complex domain object where it's no longer being cached by membase, and I can't (looking through all the properties/sub properties) see a good reason for it not caching - other objects are, so there isn't a server problem.
What I'd love to do with my code is write simple unit tests against each of my objects that I plan to use within membase to ensure that they *are* serializable, and if not, the test fails with the 'why not'.
I'm using the default transcoder.
At the moment I have:
public void MyUser_ShouldBeSerializable()
MyUser user = new MyUser();
MemoryStream mem = new MemoryStream();
BinaryFormatter b = new BinaryFormatter();
catch (Exception ex)
now according to this, it serializes fine (the test passes) so I guess membase (and the enyim client) aren't using the binary formatter to serialize the object.
Can anyone shed any light on what type of serialization I should be testing against to ensure I'm testing my objects against the default transcoder/serializer within membase?