Common.cs 530 B

12345678910111213141516171819202122
  1. using NTERA.Core;
  2. using NUnit.Framework;
  3. namespace NTERA.Interpreter.Tests
  4. {
  5. public static class Common
  6. {
  7. public static void AssertLocal(Interpreter interpreter, double value)
  8. {
  9. Assert.AreEqual(value, interpreter.Variables["LOCAL"].Real);
  10. }
  11. public static Interpreter Run(string code, IConsole console = null)
  12. {
  13. Interpreter interpreter = new Interpreter(console, code);
  14. interpreter.Exec();
  15. return interpreter;
  16. }
  17. }
  18. }