public RocketChatDriverFacts()
 {
     _mockClient = Substitute.For<IDdpClient>();
     _mockCollectionDatabase = Substitute.For<IStreamCollectionDatabase>();
     var mockLog = Substitute.For<ILogger>();
     _driver = new RocketChatDriver(mockLog, _mockClient, _mockCollectionDatabase);
 }
        public MessagingFacts()
        {
            _mockClient             = Substitute.For <IDdpClient>();
            _mockCollectionDatabase = Substitute.For <IStreamCollectionDatabase>();
            var mockLog = Substitute.For <ILogger>();

            _driver = new RocketChatDriver(mockLog, _mockClient, _mockCollectionDatabase);
        }
Exemple #3
0
 public RocketChatDriver(ILogger logger, IDdpClient client, IStreamCollectionDatabase collectionDatabaseDatabase, bool isBot = true,
                         JsonSerializerSettings jsonSerializerSettings = null)
 {
     IsBot                    = isBot;
     _logger                  = logger;
     _client                  = client;
     _collectionDatabase      = collectionDatabaseDatabase;
     _client.DataReceivedRaw += ClientOnDataReceivedRaw;
     _client.DdpReconnect    += OnDdpReconnect;
     SetJsonOptions(jsonSerializerSettings);
 }
 public RocketChatDriver(ILogger logger, IDdpClient client, IStreamCollectionDatabase collectionDatabaseDatabase, bool isBot = true,
                         JsonSerializerSettings jsonSerializerSettings = null)
 {
     IsBot = isBot;
     _logger = logger;
     _client = client;
     _collectionDatabase = collectionDatabaseDatabase;
     _client.DataReceivedRaw += ClientOnDataReceivedRaw;
     _client.DdpReconnect += OnDdpReconnect;
     SetJsonOptions(jsonSerializerSettings);
 }
Exemple #5
0
        public RocketChatDriver(string url, bool useSsl, ILogger logger = null, bool isBot = true, JsonSerializerSettings jsonSerializerSettings = null)
        {
            IsBot               = isBot;
            _logger             = logger ?? new DummyLogger();
            _collectionDatabase = new StreamCollectionDatabase();

            _logger.Info("Creating client...");
            _client = new DdpClient(url, useSsl, _logger);
            _client.DataReceivedRaw += ClientOnDataReceivedRaw;
            _client.DdpReconnect    += OnDdpReconnect;
            SetJsonOptions(jsonSerializerSettings);
        }
        public RocketChatDriver(string url, bool useSsl, ILogger logger = null, bool isBot = true, JsonSerializerSettings jsonSerializerSettings = null)
        {
            IsBot = isBot;
            _logger = logger ?? new DummyLogger();
            _collectionDatabase = new StreamCollectionDatabase();

            _logger.Info("Creating client...");
            _client = new DdpClient(url, useSsl, _logger);
            _client.DataReceivedRaw += ClientOnDataReceivedRaw;
            _client.DdpReconnect += OnDdpReconnect;
            SetJsonOptions(jsonSerializerSettings);
        }