public async Task handles_InterruptRequest() { var kernel = new CSharpKernel(); var handler = new InterruptRequestHandler(kernel); var request = Message.Create(new InterruptRequest(), null); await handler.Handle(new JupyterRequestContext(_serverChannel, _ioPubChannel, request, _kernelStatus)); }
public void cannot_handle_requests_that_are_not_InterruptRequest() { var kernel = new CSharpKernel(); var handler = new InterruptRequestHandler(kernel); var request = Message.Create(new DisplayData(), null); Func <Task> messageHandling = () => handler.Handle(new JupyterRequestContext(_serverChannel, _ioPubChannel, request, _kernelStatus)); messageHandling.Should().ThrowExactly <InvalidOperationException>(); }
public async Task sends_InterruptReply() { var kernel = new CSharpKernel(); var handler = new InterruptRequestHandler(kernel); var request = Message.Create(new InterruptRequest(), null); await handler.Handle(new JupyterRequestContext(_serverChannel, _ioPubChannel, request, _kernelStatus)); _serverRecordingSocket.DecodedMessages.SingleOrDefault(message => message.Contains(MessageTypeValues.InterruptReply)) .Should() .NotBeNullOrWhiteSpace(); }