public Execute ( IEnumerable |
||
parsedCommands | IEnumerable |
|
executorToolset | IExecutorToolset | |
리턴 | bool |
public void DeclareFewInt() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("int a") .AppendLine("int 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 ConditionIgnoreTest() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("int b") .AppendLine("b = -1") .AppendLine("if b then") .AppendLine("print a") .AppendLine("endif"); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }
public void MinusUsingNotInitInt() { var executor = new ValidationExecutor(); var commands = new StringBuilder() .AppendLine("int b") .AppendLine("b = 1") .AppendLine("int a") .AppendLine("int c") .AppendLine("c = a - b"); var parsedcommands = new Parser().ProcessCommands(commands.ToString()); Assert.IsFalse(executor.Execute(parsedcommands, new ExecutorToolset(new Random()))); }