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>());
 }
Exemple #2
0
 public TestableSubscriptionTransport()
 {
     Writer = new TestableWriter();
     Reader = new TestableReader();
 }