Example #1
0
        public void TestSimpleIndexForMissingGuy()
        {
            var dict = new Dictionary <string, int>();

            dict["hi"] = 5;
            var ir = new IndexerRefExpression(new ObjectValue(dict), new StringValue("hioi"));
            var c  = new RootContext();
            var r  = ir.Evaluate(c);
        }
Example #2
0
        public void TestSimpleIndex()
        {
            var dict = new Dictionary <string, int>();

            dict["hi"] = 5;
            var ir = new IndexerRefExpression(new ObjectValue(dict), new StringValue("hi"));
            var c  = new RootContext();
            var r  = ir.Evaluate(c);

            Assert.IsNotNull(r, "result");
            Assert.AreEqual(5, r, "the final result");
        }