Пример #1
0
        public static void CanRoundTypeIXunitSerializable()
        {
            var data = new MySerializable { IntValue = 42, StringValue = "Hello\r\nworld!" };

            var deserialized = (MySerializable)XunitSerializationInfo.Deserialize(typeof(MySerializable), XunitSerializationInfo.Serialize(data));

            Assert.Equal(42, deserialized.IntValue);
            Assert.Equal("Hello\r\nworld!", deserialized.StringValue);
        }
Пример #2
0
        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 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);
        }