Example #1
0
        public void Can_evaluate_continue_and_evaluate_again()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
    x = x + 1
    x = x + 1
end sub");

            testDebugger.AddBreakpoint(4);
            testDebugger.AddBreakpoint(5);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakpointHit();

            var result = testDebugger.EvaluateExpression("x");

            result.Result.Value.Should().Be(33);

            testDebugger.Continue();
            testDebugger.WaitForBreakpointHit();

            result = testDebugger.EvaluateExpression("x");
            result.Result.Value.Should().Be(34);

            testDebugger.Continue();

            testDebugger.AssertSubrutineFinished();
        }
Example #2
0
        public void Can_break_at_statement()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakpointHit();

            testDebugger.Continue();
            testDebugger.AssertSubrutineFinished();
        }
        public void Breakpoint_works_after_cancellation()
        {
            var testDebugger = new TestDebuggerFacade();

            testDebugger.Load(@"
sub sub1()
    var x = 33
end sub");

            testDebugger.AddBreakpoint(3);
            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();
            testDebugger.ScriptCancellation.Cancel();
            testDebugger.AssertSubrutineFinished();

            testDebugger.CallSubrutineAsync("sub1");
            testDebugger.WaitForBreakHit();
            testDebugger.Continue();
            testDebugger.AssertSubrutineFinished();
        }