Esempio n. 1
0
    public ChatSpec()
    {
        _chat            = new Chat();
        _transport       = new TestableSubscriptionTransport();
        _transportReader = _transport.Reader as TestableReader;
        _transportWriter = _transport.Writer as TestableWriter;
        _subscriptions   = new SubscriptionManager(
            new SchemaDocumentExecuter(new ChatSchema(_chat, new DefaultServiceProvider())),
            new NullLoggerFactory(),
            NoopServiceScopeFactory.Instance);

        _server = new SubscriptionServer(
            _transport,
            _subscriptions,
            new[] { new ProtocolMessageListener(new NullLogger <ProtocolMessageListener>(), new GraphQLSerializer()) },
            new NullLogger <SubscriptionServer>()
            );
    }
Esempio n. 2
0
        public ChatSpec()
        {
            _chat            = new Chat();
            _transport       = new TestableSubscriptionTransport();
            _transportReader = _transport.Reader as TestableReader;
            _transportWriter = _transport.Writer as TestableWriter;
            _subscriptions   = new SubscriptionManager(
                new DefaultSchemaExecuter <ChatSchema>(
                    new DocumentExecuter(),
                    new ChatSchema(_chat)),
                new NullLoggerFactory());

            _server = new SubscriptionServer(
                _transport,
                _subscriptions,
                Enumerable.Empty <IOperationMessageListener>(),
                new NullLogger <SubscriptionServer>()
                );
        }
Esempio n. 3
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>());
 }
Esempio n. 4
0
        public ChatSpec()
        {
            _chat            = new Chat();
            _transport       = new TestableSubscriptionTransport();
            _transportReader = _transport.Reader as TestableReader;
            _transportWriter = _transport.Writer as TestableWriter;
            _subscriptions   = new SubscriptionManager(
                new DefaultGraphQLExecuter <ChatSchema>(
                    new ChatSchema(_chat),
                    new DocumentExecuter(),
                    Options.Create(new GraphQLOptions()),
                    Enumerable.Empty <IDocumentExecutionListener>(),
                    Enumerable.Empty <IValidationRule>()
                    ),
                new NullLoggerFactory());

            _server = new SubscriptionServer(
                _transport,
                _subscriptions,
                new [] { new ProtocolMessageListener(new NullLogger <ProtocolMessageListener>()) },
                new NullLogger <SubscriptionServer>()
                );
        }