<commit_before>﻿using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Wire.Tests
{
    [TestClass]
    public class DelegateTests
    {
        public class Dummy
        {
            public int Prop { get; set; }
        }
        [TestMethod]
        public void CanSerializeDeepCyclicReferences()
        {
            var stream = new MemoryStream();
            var serializer = new Serializer(new SerializerOptions(versionTolerance: true, preserveObjectReferences: true));

            Action<Dummy> a = dummy => dummy.Prop = 1;
            serializer.Serialize(a,stream);
            stream.Position = 0;
            var res = serializer.Deserialize<Action<Dummy>>(stream);
            Assert.IsNotNull(res);

            var d = new Dummy {Prop = 0};
            res(d);
            Assert.AreEqual(1,d.Prop);
        }
    }

}
<commit_msg>DelegateTests<commit_after>﻿using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Wire.Tests
{
    [TestClass]
    public class DelegateTests
    {
        public class Dummy
        {
            public int Prop { get; set; }
        }

        [TestMethod]
        public void CanSerializeDelegate()
        {
            var stream = new MemoryStream();
            var serializer = new Serializer(new SerializerOptions(versionTolerance: true, preserveObjectReferences: true));

            Action<Dummy> a = dummy => dummy.Prop = 1;
            serializer.Serialize(a,stream);
            stream.Position = 0;
            var res = serializer.Deserialize<Action<Dummy>>(stream);
            Assert.IsNotNull(res);

            var d = new Dummy {Prop = 0};
            res(d);
            Assert.AreEqual(1,d.Prop);
        }
    }
}

{'fraction_non_alphanumeric': 0.09728506787330317, 'fraction_numerical': 0.004524886877828055, 'mean_word_length': 1.9932318104906936, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6930076', 'n_tokens_mistral': 499, 'n_tokens_neox': 481, 'n_words': 112}