void Do(string code, Action <DynValue, RegCollMethods> asserts)
        {
            try
            {
                UserData.RegisterType <RegCollMethods>();
                UserData.RegisterType <RegCollItem>();
                UserData.RegisterType(typeof(IList <>));

                Script s = new Script();

                var obj = new RegCollMethods();
                s.Globals["o"]    = obj;
                s.Globals["ctor"] = UserData.CreateStatic <RegCollItem>();

                DynValue res = s.DoString(code);

                asserts(res, obj);
            }
            catch (ScriptRuntimeException ex)
            {
                Debug.WriteLine(ex.DecoratedMessage);
                throw;
            }
            finally
            {
                UserData.UnregisterType <RegCollMethods>();
                UserData.UnregisterType <RegCollItem>();
                UserData.UnregisterType <Array>();
                UserData.UnregisterType(typeof(IList <>));
                UserData.UnregisterType(typeof(IList <RegCollItem>));
                UserData.UnregisterType(typeof(IList <int>));
                //UserData.UnregisterType<IEnumerable>();
            }
        }
		void Do(string code, Action<DynValue, RegCollMethods> asserts)
		{
			try
			{
				UserData.RegisterType<RegCollMethods>();
				UserData.RegisterType<RegCollItem>();
				UserData.RegisterType(typeof(IList<>));

				Script s = new Script();

				var obj = new RegCollMethods();
				s.Globals["o"] = obj;
				s.Globals["ctor"] = UserData.CreateStatic<RegCollItem>();

				DynValue res = s.DoString(code);

				asserts(res, obj);
			}
			catch (ScriptRuntimeException ex)
			{
				Debug.WriteLine(ex.DecoratedMessage);
				throw;
			}
			finally
			{
				UserData.UnregisterType<RegCollMethods>();
				UserData.UnregisterType<RegCollItem>();
				UserData.UnregisterType<Array>();
				UserData.UnregisterType(typeof(IList<>));
				UserData.UnregisterType(typeof(IList<RegCollItem>));
				UserData.UnregisterType(typeof(IList<int>));
				//UserData.UnregisterType<IEnumerable>();
			}
		}