Esempio n. 1
0
        public void TestGetFromParent()
        {
            var c = new ScopeContext(new RootContext());

            c.Parent.SetVariableValue("p", 5);
            Assert.AreEqual(5, c.GetVariableValue("p"), "get p");
        }
Esempio n. 2
0
        public void TestGetSetNotAffectParent()
        {
            var c = new ScopeContext(new RootContext());

            c.SetVariableValue("p", 5);
            Assert.AreEqual(5, c.GetVariableValue("p"), "get p");
            Assert.IsFalse(c.Parent.GetVariableValueOrNull("p").Item1, "parent has the variable");
        }
Esempio n. 3
0
        public void TestBadGet()
        {
            var c = new ScopeContext(new RootContext());

            c.GetVariableValue("p");
        }