예제 #1
0
    public JsonRpcWithFatalExceptionsTests(ITestOutputHelper logger)
        : base(logger)
    {
        this.server = new Server();
        var streams = FullDuplexStream.CreateStreams();

        this.messageHandler = new DisposingMessageHandler(streams.Item1);
        this.clientRpc      = new JsonRpcWithFatalExceptions(this.messageHandler);
        this.serverRpc      = new JsonRpcWithFatalExceptions(new DisposingMessageHandler(streams.Item2), this.server);
        this.clientRpc.StartListening();
        this.serverRpc.StartListening();
    }
    public JsonRpcWithFatalExceptionsTests(ITestOutputHelper logger)
        : base(logger)
    {
        this.server = new Server();
        var streams = Nerdbank.FullDuplexStream.CreateStreams();

        this.messageHandler = new HeaderDelimitedMessageHandler(streams.Item1, streams.Item1);
        this.clientRpc      = new JsonRpcWithFatalExceptions(this.messageHandler);
        this.serverRpc      = new JsonRpcWithFatalExceptions(new HeaderDelimitedMessageHandler(streams.Item2, streams.Item2), this.server);

        this.serverRpc.TraceSource = new TraceSource("Server", SourceLevels.Error);
        this.clientRpc.TraceSource = new TraceSource("Client", SourceLevels.Error);

        this.serverRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));
        this.clientRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));

        this.clientRpc.StartListening();
        this.serverRpc.StartListening();
    }