public void Execute()
 {
     var formatter = new DynamicIFormatter();
     using(var ms = new MemoryStream())
     {
         formatter.Serialize(ms, new Foo { Bar = 12345 });
         ms.Position = 0;
         Foo clone = (Foo) formatter.Deserialize(ms);
         Assert.AreEqual(12345, clone.Bar);
     }
 }
Beispiel #2
0
        public void Execute()
        {
            var formatter = new DynamicIFormatter();

            using var ms = new MemoryStream();
            formatter.Serialize(ms, new Foo {
                Bar = 12345
            });
            ms.Position = 0;
            Foo clone = (Foo)formatter.Deserialize(ms);

            Assert.Equal(12345, clone.Bar);
        }