Ejemplo n.º 1
0
 static SerializationTestEx()
 {
     SystemJsonOptions = MemberwiseCloner.Invoke(SystemJsonSerializer.DefaultOptions);
     SystemJsonOptions.WriteIndented   = true;
     NewtonsoftJsonSettings            = MemberwiseCloner.Invoke(NewtonsoftJsonSerializer.DefaultSettings);
     NewtonsoftJsonSettings.Formatting = Formatting.Indented;
 }
        public void Test()
        {
            var i = 3;

            MemberwiseCloner.Invoke(i).Should().Be(i);

            var a = new [] { 1, 2, 3 };
            var b = MemberwiseCloner.Invoke(a);

            b.Should().NotBeSameAs(a);
            b.Should().Equal(a);
        }