public void HasValue() { BindingEnvironment environment = new BindingEnvironment(); environment.SetValue("foo", "bar"); Assert.IsTrue(environment.HasValue("foo")); Assert.IsFalse(environment.HasValue("undefined")); }
public object Evaluate(BindingEnvironment environment) { object value = environment.GetValue(this.name); if (value != null) { return(value); } if (environment.HasValue(this.name)) { return(value); } throw new InvalidOperationException(string.Format("NameError: name '{0}' not defined", this.name)); }