public void CollectionOfCollections_After1000CallsFromApi_Contains10CollectionsWith100Logs() { // Arrange var countOfCalls = 1000; var fullCollectionsCount = 10; var countOfLogsInEachCollection = _appSettingsModifier.GetServerSettings().CapacityOfCollectionToInsert.Value.ConvertToInt(); // Act EmulateCalls(countOfCalls); //Assert Assert.Equal(fullCollectionsCount, _helperCollection._allCollections.Count(col => col.Count == countOfLogsInEachCollection)); }
public DataStoragesHelperType(IEnumerable <IDataStoragePlugin> dataStoragePluginsCollection , AppSettingsAccessor appSettingsModifier ) { _serverSettings = appSettingsModifier.GetServerSettings(); _appSettingsModifier = appSettingsModifier; _dataStoragePlugins = dataStoragePluginsCollection; appSettingsModifier.NotifyDependentEntetiesEvent += HandleUserSettingsUpdate; }
public LogsStorageWriter(CollectionOfLogs collectionOfLogs , IDevicesLogsRepository logsRepository , AppSettingsAccessor appSettingsModifier ) { _collectionOfLogs = collectionOfLogs; _logsRepository = logsRepository; _appSettingsModifier = appSettingsModifier; appSettingsModifier.NotifyDependentEntetiesEvent += HandleUserSettingsUpdate; _serverSettings = appSettingsModifier.GetServerSettings(); _autoResetEvent = new AutoResetEvent(false); }
public CollectionOfLogs(AppSettingsAccessor appSettingsModifier) { _serverSettings = appSettingsModifier.GetServerSettings(); resetEvent = new ManualResetEvent(false); _appSettingsModifier = appSettingsModifier; appSettingsModifier.NotifyDependentEntetiesEvent += HandleUserSettingsUpdate; List <DeviceLog> initialLogs = new List <DeviceLog>(_serverSettings.CapacityOfCollectionToInsert.Value.ConvertToInt()); _allCollections = new List <List <DeviceLog> >() { initialLogs }; _helperQueue = new Queue <List <DeviceLog> >(); }
private void HandleUserSettingsUpdate() { _serverSettings = _appSettingsModifier.GetServerSettings(); }
private void HandleUserSettingsUpdate() { _serverSettings = _appSettingsModifier.GetServerSettings(); _autoResetEvent.Set(); }