Пример #1
0
 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);
 }