public void ContainsName() { BindingEnvironment environment = new BindingEnvironment(); Assert.IsFalse(environment.ContainsName("foo")); environment.SetValue("foo", null); Assert.IsTrue(environment.ContainsName("foo")); environment.SetValue("bar", "foo"); Assert.IsTrue(environment.ContainsName("bar")); }
public void ContainsName() { BindingEnvironment environment = new BindingEnvironment(); Assert.IsFalse(environment.ContainsName("foo")); environment.SetValue("foo", null); Assert.IsTrue(environment.ContainsName("foo")); environment.SetValue("bar", "foo"); Assert.IsTrue(environment.ContainsName("bar")); }
public void ExecuteGlobalCommand() { GlobalCommand command = new GlobalCommand("global"); Machine machine = new Machine(); IBindingEnvironment environment = new BindingEnvironment(); command.Execute(environment); environment.SetValue("global", 100); Assert.IsFalse(environment.ContainsName("global")); Assert.IsTrue(machine.Environment.ContainsName("global")); Assert.AreEqual(100, machine.Environment.GetValue("global")); }
public void ExecuteVarCommandWithNullExpression() { VarCommand command = new VarCommand("foo", null); IBindingEnvironment environment = new BindingEnvironment(); IBindingEnvironment local = new LocalBindingEnvironment(environment); IBindingEnvironment local2 = new LocalBindingEnvironment(local); command.Execute(local2); Assert.IsTrue(local2.ContainsName("foo")); Assert.IsFalse(local.ContainsName("foo")); Assert.IsFalse(environment.ContainsName("foo")); Assert.IsNull(local2.GetValue("foo")); }
public void ExecuteVarCommand() { VarCommand command = new VarCommand("foo", new ConstantExpression(10)); IBindingEnvironment environment = new BindingEnvironment(); IBindingEnvironment local = new LocalBindingEnvironment(environment); IBindingEnvironment local2 = new LocalBindingEnvironment(local); command.Execute(local2); Assert.IsTrue(local2.ContainsName("foo")); Assert.IsFalse(local.ContainsName("foo")); Assert.IsFalse(environment.ContainsName("foo")); Assert.AreEqual(10, local2.GetValue("foo")); }