public void TestGetFromParent() { var c = new ScopeContext(new RootContext()); c.Parent.SetVariableValue("p", 5); Assert.AreEqual(5, c.GetVariableValue("p"), "get p"); }
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"); }
public void TestBadGet() { var c = new ScopeContext(new RootContext()); c.GetVariableValue("p"); }