public void CheckSet() { interpreter.ExecuteLine("set a 5"); CheckValue(5, "a"); CheckCount(1); interpreter.ExecuteLine("set a 2"); CheckValue(2, "a"); CheckCount(1); interpreter.ExecuteLine("set b 1"); CheckValue(1, "b"); CheckCount(2); }
public static void Main() { var i = new Interpreter(new StringWriter()); var s = "set code\ndef test\n rem a\nset a 12\ncall test\nprint a\nend set code\nrun"; var s1 = s.Split('\n'); foreach (var e in s1) { i.ExecuteLine(e); } Assert.AreEqual("Переменная отсутствует в памяти\r\n", i); }