public void SimpleExampleWithSurrogate() { var typeMap = new SerializationTypeMap(context); typeMap.RegisterType(typeof(Explicit.Address), new Explicit.AddressSerializer()); var serializer = new FudgeSerializer(context, typeMap); var address = new Explicit.Address("Our House", "In the middle of our street", "MD1"); var msg = serializer.SerializeToMsg(address); var address2 = (Explicit.Address)serializer.Deserialize(msg); Assert.Equal(address.Line1, address2.Line1); Assert.Equal(address.Line2, address2.Line2); Assert.Equal(address.Zip, address2.Zip); }
public void SimpleExampleWithSurrogate() { var typeMap = new SerializationTypeMap(context); typeMap.RegisterType(typeof(Explicit.Address), new Explicit.AddressSerializer()); var serializer = new FudgeSerializer(context, typeMap); var address = new Explicit.Address("Our House", "In the middle of our street", "MD1"); var msg = serializer.SerializeToMsg(address); var address2 = (Explicit.Address)serializer.Deserialize(msg); Assert.Equal(address.Line1, address2.Line1); Assert.Equal(address.Line2, address2.Line2); Assert.Equal(address.Zip, address2.Zip); }