public void Goto_WithNonExistingLineNumber_ThrowsArgumentOutOfRangeException() { var runner = new ProgramRunner(lines); const string nonExistingNumber = "200"; runner.Goto(nonExistingNumber); }
public void Goto_WithExistingLineNumber_SetsCurrentStatement() { var runner = new ProgramRunner(lines); const string existingNumberWithRemStatement = "100"; runner.Goto(existingNumberWithRemStatement); var actual = (runner.RunningLine.Statement as Rem).Comment; Assert.AreEqual("The end", actual); }
public void MoveNext_AfterGoto_ReturnsTrue() { var runner = new ProgramRunner(lines); const string existingNumber = "30"; runner.Goto(existingNumber); var condition = runner.MoveNext(); Assert.IsTrue(condition); }
public void MoveNext_AfterGoto_KeepsCurrentStatement() { var runner = new ProgramRunner(lines); const string existingNumber = "30"; runner.Goto(existingNumber); var expected = runner.RunningLine; var condition = runner.MoveNext(); var actual = runner.RunningLine; Assert.AreEqual(expected, actual); }