示例#1
0
文件: ParseTest.cs 项目: adrfrank/FBF
 void ParseTestFunc(string text, int Errors=0)
 {
     Trace.WriteLine("--------------------------------");
     Trace.WriteLine(text);
     Trace.WriteLine("Errores esperados: " + Errors);
     IParser fbfParser = new FormulasBienFormadasParser();
     var result = fbfParser.Parse(text);
     Trace.WriteLine("Errores: "+result.Errors.Count);
     if (result.Errors.Count > 0)
     {
         foreach (var e in result.Errors)
         {
             Trace.WriteLine(e);
         }
     }
     Assert.IsNotNull(result);
     Assert.AreEqual(Errors, result.Errors.Count);
 }
示例#2
0
 public ActionResult Validate(string line)
 {
     IParser parser = new FormulasBienFormadasParser();
     var result= parser.Parse(line);
     return Json(result, JsonRequestBehavior.AllowGet);
 }