Common.cs 678 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.VisualStudio.TestTools.UnitTesting;
  7. using NTERA.Core;
  8. namespace NTERA.Interpreter.Tests
  9. {
  10. public static class Common
  11. {
  12. public static void AssertLocal(Interpreter interpreter, double value)
  13. {
  14. Assert.AreEqual(value, interpreter.Variables["LOCAL"].Real);
  15. }
  16. public static Interpreter Create(string code, IConsole console = null)
  17. {
  18. Interpreter interpreter = new Interpreter(console, code);
  19. interpreter.Exec();
  20. return interpreter;
  21. }
  22. }
  23. }