public void MoveNext_WhenRecallAfterComplete_ThrowsInvalidOperationException() { var runner = new ProgramRunner(lines); runner.Complete(); runner.MoveNext(); runner.MoveNext(); }
public void MoveNext_BeyondTheEndOfProgram_ThrowsInvalidOperationException() { var runner = new ProgramRunner(lines); while (runner.MoveNext()) { ; } runner.MoveNext(); }
public void MoveNext_AfterConstructorCall_ReturnsTrue() { var runner = new ProgramRunner(lines); var condition = runner.MoveNext(); Assert.IsTrue(condition); }
public void RunningLine_AfterMoveNext_RetursFirstLine() { var runner = new ProgramRunner(lines); var condition = runner.MoveNext(); var statement = runner.RunningLine.Statement; Assert.IsInstanceOfType(statement, typeof(Rem)); }
public void MoveNext_AfterComplete_ReturnsFalse() { var runner = new ProgramRunner(lines); runner.Complete(); var condition = runner.MoveNext(); Assert.IsFalse(condition); }
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); }