Ejemplo n.º 1
0
        public void cannot_handle_requests_that_are_not_CompleteRequest()
        {
            var         kernel          = new CSharpKernel();
            var         handler         = new CompleteRequestHandler(kernel);
            var         request         = Message.Create(new DisplayData(), null);
            Func <Task> messageHandling = () => handler.Handle(new JupyterRequestContext(_serverChannel, _ioPubChannel, request, _kernelStatus));

            messageHandling.Should().ThrowExactly <InvalidOperationException>();
        }
Ejemplo n.º 2
0
        public async Task send_completeReply_on_CompleteRequest()
        {
            var kernel  = new CSharpKernel();
            var handler = new CompleteRequestHandler(kernel);
            var request = Message.Create(new CompleteRequest("System.Console.", 15), null);
            await handler.Handle(new JupyterRequestContext(_serverChannel, _ioPubChannel, request, _kernelStatus));

            _serverRecordingSocket.DecodedMessages
            .Should().Contain(message =>
                              message.Contains(MessageTypeValues.CompleteReply));
        }