public object Evaluate(Context context) { IDictionary result = new DynamicHash(); for (var k = 0; k < this.keyexpressions.Count; k++) { result[this.keyexpressions[k].Evaluate(context)] = this.valueexpressions[k].Evaluate(context); } return(result); }
public void GetIndexedDictionaryEntryAsNil() { Machine machine = new Machine(); var hash = new DynamicHash(); hash[new Symbol("one")] = 1; hash[new Symbol("two")] = 2; IndexedExpression expression = new IndexedExpression(new ConstantExpression(hash), new ConstantExpression(new Symbol("three"))); var result = expression.Evaluate(machine.RootContext); Assert.IsNull(result); }
public void HashToString() { DynamicHash hash = new DynamicHash(); hash[new Symbol("one")] = 1; hash[new Symbol("two")] = 2; var result = hash.ToString(); Assert.IsTrue(result.StartsWith("{")); Assert.IsTrue(result.EndsWith("}")); Assert.IsTrue(result.Contains(":one=>1")); Assert.IsTrue(result.Contains(":two=>2")); }
public HttpOptions() { //defaults Method = "get"; AdditionalOptions = new DynamicHash(); }
public HttpOptions() { //defaults Method = "get"; AdditionalOptions = new DynamicHash(); }
public void EmptyHashToString() { DynamicHash hash = new DynamicHash(); Assert.AreEqual("{}", hash.ToString()); }