Beispiel #1
0
 private static void TestDefine(Tree<Cell> defineRow)
 {
     var processor = new CellProcessorBase();
     var define = new Define();
     var input = new CellTree(defineRow, new CellTree("stuff"));
     define.Interpret(processor, input);
     Assert.AreEqual(input, processor.Get<Procedures>().GetValue("myprocedure"));
 }
 private static void ParseCell(string cellContent, string symbolName)
 {
     var cell = new CellTreeLeaf(cellContent);
     var processor = new CellProcessorBase();
     processor.Get<Symbols>().Save(symbolName, "value");
     new ParseSymbol{Processor = processor}.Parse(typeof (string), TypedValue.Void, cell);
     Assert.AreEqual(" value", cell.Value.GetAttribute(CellAttribute.InformationSuffix));
 }
 public void CachesParsedValue()
 {
     var cell = new CellTreeLeaf("<<symbol");
     var processor = new CellProcessorBase();
     processor.Get<Symbols>().Save("symbol", "value");
     TypedValue result = processor.Parse(typeof (string), TypedValue.Void, cell);
     Assert.AreEqual("value", result.GetValue<string>());
     Assert.AreEqual(" value", cell.Value.GetAttribute(CellAttribute.InformationSuffix));
     processor.Parse(typeof (string), TypedValue.Void, cell);
     Assert.AreEqual(" value", cell.Value.GetAttribute(CellAttribute.InformationSuffix));
     Assert.AreEqual("value", result.GetValue<string>());
 }