public void CreateClearBreakpointCommand() { // Arrange const int commandId = 3; const int breakpointId = 5; // Act var clearBreakpointCommand = new ClearBreakpointCommand(commandId, breakpointId); // Assert Assert.AreEqual(commandId, clearBreakpointCommand.Id); Assert.AreEqual( string.Format( "{{\"command\":\"clearbreakpoint\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"breakpoint\":{1}}}}}", commandId, breakpointId), clearBreakpointCommand.ToString()); }
internal async Task RemoveBreakpointAsync(NodeBreakpointBinding breakpointBinding, CancellationToken cancellationToken = new CancellationToken()) { DebugWriteCommand("Remove Breakpoint"); // Perform remove idempotently, as remove may be called in response to BreakpointUnound event if (breakpointBinding.Unbound) { return; } int breakpointId = breakpointBinding.BreakpointId; if (_connection.Connected) { var clearBreakpointsCommand = new ClearBreakpointCommand(CommandId, breakpointId); await TrySendRequestAsync(clearBreakpointsCommand, cancellationToken).ConfigureAwait(false); } NodeBreakpoint breakpoint = breakpointBinding.Breakpoint; _breakpointBindings.Remove(breakpointId); breakpoint.RemoveBinding(breakpointBinding); breakpointBinding.Unbound = true; EventHandler<BreakpointBindingEventArgs> breakpointUnbound = BreakpointUnbound; if (breakpointUnbound != null) { breakpointUnbound(this, new BreakpointBindingEventArgs(breakpoint, breakpointBinding)); } }