Beispiel #1
0
 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));
 }
Beispiel #2
0
        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>();
        }
Beispiel #3
0
        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();
        }