public static void CanRoundTripIntrinsics(Type dataType, object data) { var triple = new XunitSerializationTriple(Guid.NewGuid().ToString(), data, dataType); var serialized = XunitSerializationInfo.SerializeTriple(triple); var deserialized = XunitSerializationInfo.DeserializeTriple(serialized); Assert.Equal(triple.Key, deserialized.Key); Assert.Equal(triple.Type, deserialized.Type); Assert.Equal(triple.Value, deserialized.Value); }
public static void CanRoundTypeIXunitSerializable() { var data = new MySerializable { IntValue = 42, StringValue = "Hello\r\nworld!" }; var triple = new XunitSerializationTriple(Guid.NewGuid().ToString(), data, data.GetType()); var serialized = XunitSerializationInfo.SerializeTriple(triple); var deserialized = XunitSerializationInfo.DeserializeTriple(serialized); Assert.Equal(triple.Key, deserialized.Key); Assert.Equal(triple.Type, deserialized.Type); var deserializedInner = (MySerializable)deserialized.Value; Assert.Equal(42, deserializedInner.IntValue); Assert.Equal("Hello\r\nworld!", deserializedInner.StringValue); }
public static VsTestCaseBase DeserializeFromString(string value) { var triple = XunitSerializationInfo.DeserializeTriple(value); return((VsTestCaseBase)triple.Value); }