public void DeserializeJson() { var typeMap = new GeneralPartitionableTypeMap(); var typekey = typeMap.GetTypeKey(typeof(string)); var envelope = new BinaryEnvelope { EventPayload = Encoding.UTF8.GetBytes(@"""A"""), PayloadId = "daf0be6e-da1e-5a6a-0d49-69782745c885", Protocol = "JSON" }; var typekey2 = typeMap.GetInputKey(envelope); Assert.AreEqual(typekey, typekey2); var result = typeMap.GetTransform(typeof(string))(envelope); Assert.AreEqual("A", result); }
public void DeserializeBondV1() { var typeMap = new GeneralPartitionableTypeMap(); var typekey = typeMap.GetTypeKey(typeof(TestBondClass)); var envelope = new BinaryEnvelope { EventPayload = new byte[] { 41, 1, 65, 0 }, PayloadId = "daf0be6e-da1e-5a6a-0d49-69782745c886", Protocol = "BOND_V1" }; var typekey2 = typeMap.GetInputKey(envelope); Assert.AreEqual(typekey, typekey2); var result = typeMap.GetTransform(typeof(TestBondClass))(envelope); }