<commit_before>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;

namespace ChakraCore.NET.UnitTest
{
    [TestClass]
    public class ComplexProxyTest : UnitTestBase
    {
        protected override void SetupContext()
        {
            TestProxy.RegisterValueConverter(context);
            context.ValueConverter.RegisterArrayConverter<TestProxy>();
            runScript("ComplexProxy");
        }

        [TestMethod]
        public void MultiProxyTransfer()
        {
            int size = 10;
            TestProxy[] items = new TestProxy[size];
            string target = string.Empty;
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new TestProxy(i.ToString());
                target = target + i.ToString() + ",";
            }
            context.RootObject.WriteProperty<IEnumerable<TestProxy>>("proxies", items);
            string result=context.RootObject.CallFunction<string>("MultiTransfer");
            Assert.AreEqual<string>(target, result);
        }
    }
}<commit_msg>add multi items transfer back test<commit_after>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace ChakraCore.NET.UnitTest
{
    [TestClass]
    public class ComplexProxyTest : UnitTestBase
    {
        protected override void SetupContext()
        {
            TestProxy.RegisterValueConverter(context);
            context.ValueConverter.RegisterArrayConverter<TestProxy>();
            runScript("ComplexProxy");
        }

        [TestMethod]
        public void MultiProxyTransfer()
        {
            int size = 10;
            TestProxy[] items = new TestProxy[size];
            string target = string.Empty;
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new TestProxy(i.ToString());
                target = target + i.ToString() + ",";
            }
            context.RootObject.WriteProperty<IEnumerable<TestProxy>>("proxies", items);

            var items_back=context.RootObject.ReadProperty<IEnumerable<TestProxy>>("proxies").ToArray();
            Assert.AreEqual(items_back.Length, items.Length);
            for (int i = 0; i < items.Length; i++)
            {
                Assert.AreSame(items[i], items_back[i]);
            }
            string result=context.RootObject.CallFunction<string>("MultiTransfer");
            Assert.AreEqual<string>(target, result);
        }
    }
}
{'fraction_non_alphanumeric': 0.10964230171073094, 'fraction_numerical': 0.0027216174183514776, 'mean_word_length': 2.212234706616729, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 15, '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': '1882581', 'n_tokens_mistral': 673, 'n_tokens_neox': 655, 'n_words': 130}