コード例 #1
0
 public ProtocolHandlerFacts()
 {
     _transport        = new TestableSubscriptionTransport();
     _transportReader  = _transport.Reader as TestableReader;
     _transportWriter  = _transport.Writer as TestableWriter;
     _documentExecuter = Substitute.For <IDocumentExecuter>();
     _documentExecuter.ExecuteAsync(null).ReturnsForAnyArgs(
         new ExecutionResult
     {
         Streams = new Dictionary <string, IObservable <ExecutionResult> >
         {
             { "1", Substitute.For <IObservable <ExecutionResult> >() }
         }
     });
     _subscriptionManager = new SubscriptionManager(_documentExecuter, new NullLoggerFactory(), NoopServiceScopeFactory.Instance);
     _sut    = new ProtocolMessageListener(new NullLogger <ProtocolMessageListener>(), new GraphQLSerializer());
     _server = new SubscriptionServer(
         _transport,
         _subscriptionManager,
         new[] { _sut },
         new NullLogger <SubscriptionServer>());
 }
コード例 #2
0
 public TestableSubscriptionTransport()
 {
     Writer = new TestableWriter();
     Reader = new TestableReader();
 }