public void TestDeserialize()
 {
     var subFormatter = new Mock<ICauterizeTypeFormatter>();
     var serializationStream = new MemoryStream();
     subFormatter.Setup(sf => sf.Deserialize(serializationStream, typeof (string))).Returns("hello world");
     var factory = new Mock<CauterizeTypeFormatterFactory>();
     factory.Setup(f => f.GetFormatter(typeof (string))).Returns(subFormatter.Object);
     var formatter = new CauterizeFormatter(factory.Object);
     Assert.AreEqual("hello world", formatter.Deserialize<string>(serializationStream));
 }
 public void TestSerialize()
 {
     var subFormatter = new Mock<ICauterizeTypeFormatter>();
     var serializationStream = new MemoryStream();
     subFormatter.Setup(sf => sf.Serialize(serializationStream, "hello world"));
     var factory = new Mock<CauterizeTypeFormatterFactory>();
     factory.Setup(f => f.GetFormatter(typeof (string))).Returns(subFormatter.Object);
     var formatter = new CauterizeFormatter(factory.Object);
     formatter.Serialize(serializationStream, "hello world");
     subFormatter.VerifyAll();
 }