public void PrintNotInitInt() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("int a") .AppendLine("print a"); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }
public void InitNotDeclaredInt() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("b = 1") .AppendLine("if b then") .AppendLine("stop") .AppendLine("endif"); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }
public void LonelyEndIf() { var executor = new ValidationExecutor(); var commands = new StringBuilder(@" int a endif a = 1 "); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }
public void SkippedCloseCondition() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("int b") .AppendLine("b = 1") .AppendLine("if b then") .AppendLine("if b then") .AppendLine("print b") .AppendLine("endif"); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }
private bool AssertValid() { var executor = new ValidationExecutor(); return(executor.Execute(_commands, new ExecutorToolset(new Random()))); }