コード例 #1
0
        public void Indexer_Set()
        {
            var f = new IndexerTestClass();

            ReflectionHelper.SetIndexer(f, 2, 123);
            Assert.AreEqual(2 * 123, ReflectionHelper.GetIndexer(f, 1));
        }
コード例 #2
0
        private void IndexerTest(string code, int expected)
        {
            Script S = new Script();

            IndexerTestClass obj = new IndexerTestClass();

            UserData.RegisterType <IndexerTestClass>();

            S.Globals.Set("o", UserData.Create(obj));

            DynValue v = S.DoString(code);

            Assert.AreEqual(DataType.Number, v.Type);
            Assert.AreEqual(expected, v.Number);
        }
コード例 #3
0
		private void IndexerTest(string code, int expected)
		{
			Script S = new Script();

			IndexerTestClass obj = new IndexerTestClass();

			UserData.RegisterType<IndexerTestClass>();

			S.Globals.Set("o", UserData.Create(obj));

			DynValue v = S.DoString(code);

			Assert.AreEqual(DataType.Number, v.Type);
			Assert.AreEqual(expected, v.Number);
		}
コード例 #4
0
 public void Indexer_Set()
 {
     var f = new IndexerTestClass();
     ReflectionHelper.SetIndexer(f, 2, 123);
     Assert.AreEqual(2*123, ReflectionHelper.GetIndexer(f, 1));
 }