/// <summary> /// Constructor of NLPController /// </summary> /// <param name="nlpService"> /// NLP service /// </param> /// <param name="fileService"> /// File service /// </param> /// <param name="azureOptionsMonitor"> /// Azure Blob Storage configuration /// </param> /// <param name="mongoFileService"> /// Mongo service /// </param> public NLPController(INLPService nlpService, IFileService fileService, IOptionsMonitor <AzureBlobStorageConfig> azureOptionsMonitor, MongoFileService mongoFileService) { _nlpService = nlpService; _fileService = fileService; _azureBlobStorageConfig = azureOptionsMonitor.CurrentValue; _mongoFileService = mongoFileService; }
/// <summary> /// Constructor of AnalysisController /// </summary> /// <param name="publisherService"> /// Publisher service interface /// </param> /// <param name="fileService"> /// File service interface /// </param> /// <param name="analysisService"> /// Analysis interface /// </param> /// <param name="azureOptionsMonitor"> /// Azure options /// </param> /// <param name="mongoFileService"> /// Mongo service interface /// </param> /// <param name="rabbitOptionsMonitor"> /// RabbitMQ options /// </param> public AnalysisController(PublisherService publisherService, IFileService fileService, IAnalysisService analysisService, IOptionsMonitor <AzureBlobStorageConfig> azureOptionsMonitor, MongoFileService mongoFileService, IOptionsMonitor <RabbitMQConfig> rabbitOptionsMonitor) { _publisherService = publisherService; _fileService = fileService; _analysisService = analysisService; _azureBlobStorageConfig = azureOptionsMonitor.CurrentValue; _mongoFileService = mongoFileService; _rabbitMQConfig = rabbitOptionsMonitor.CurrentValue; }
/// <summary> /// Main method /// </summary> /// <param name="args"> /// Arguments of the application /// </param> static void Main(string[] args) { Config config = ReadConfig(); _context = new DocumentAnalyzerDBContext(config.SqlConnection); _employeeService = new EmployeeService(_context); _mongoFileService = new MongoFileService(config.MongoConnectionString, config.MongoDatabaseName, config.MongoCollectionName); ReceiveFromQueue(config.HostName, config.QueueName); return; }
internal void SaveGetDelete(MongoFileService fs, IFileID id, string content, string actual) { GIVEN["a service instance"] = () => fs = new MongoFileService(Env.DB); When["saving a file"] = async() => id = await fs.Save(async stream => { using (var w = new StreamWriter(stream)) { await w.WriteAsync(content = "file contents"); await w.FlushAsync(); } }); And["getting the file"] = () => fs.Get(id, async stream => actual = await new StreamReader(stream).ReadToEndAsync() ); THEN["the returned file equals the original"] = () => actual.Should().Be(content); When["deleting the file"] = () => fs.Delete(id); Then["getting the file", ThrowsA <FileNotFoundException>()] = () => fs.Get(id, s => Task.CompletedTask); And["deleting the file", ThrowsA <FileNotFoundException>()] = () => fs.Delete(id); }
/// <summary> /// Constructor of FileController /// </summary> /// <param name="fileService"> /// File service /// </param> public FileController(IFileService fileService, MongoFileService mongoFileService) { _fileService = fileService; _mongoFileService = mongoFileService; }
/// <summary> /// Constructor of the MongoController /// </summary> /// <param name="fileService"> /// Monfo service /// </param> public MongoController(MongoFileService fileService) { _mongoFileService = fileService; }