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