public void Indexer_Set() { var f = new IndexerTestClass(); ReflectionHelper.SetIndexer(f, 2, 123); Assert.AreEqual(2 * 123, ReflectionHelper.GetIndexer(f, 1)); }
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); }
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); }
public void Indexer_Set() { var f = new IndexerTestClass(); ReflectionHelper.SetIndexer(f, 2, 123); Assert.AreEqual(2*123, ReflectionHelper.GetIndexer(f, 1)); }